diff -Nru bibledit-5.0.912/assets/editor.js bibledit-5.0.922/assets/editor.js --- bibledit-5.0.912/assets/editor.js 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/assets/editor.js 2020-11-16 18:52:48.000000000 +0000 @@ -21,25 +21,25 @@ { //

1 + 1.1 keyword Footnote text.

// Footnote uses \fr \fk \ft. - // Cross reference uses \xo \xk \xt. + // Cross reference uses \xo \xt. var length = quill.getLength (); quill.insertText (length, "\n", "paragraph", style, "user"); quill.insertText (length, caller, "character", "notebody" + noteId, "user"); length++; quill.insertText (length, " + ", "character", "", "user"); length += 3; - var referenceText = chapter + separator + verse + " "; + var referenceText = chapter + separator + verse; var referenceStyle = "fr"; if (style == "x") referenceStyle = "xo"; quill.insertText (length, referenceText, "character", referenceStyle, "user"); length += referenceText.length; if (style != "x") { var keywordStyle = "fk"; - quill.insertText (length, "| keyword |", "character", keywordStyle, "user"); - length += 11; + quill.insertText (length, " keyword", "character", keywordStyle, "user"); + length += 8; } var textStyle = "ft"; if (style == "x") textStyle = "xt"; - quill.insertText (length, "| Text.", "character", textStyle, "user"); + quill.insertText (length, " Text.", "character", textStyle, "user"); } diff -Nru bibledit-5.0.912/assets/view.cpp bibledit-5.0.922/assets/view.cpp --- bibledit-5.0.912/assets/view.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/assets/view.cpp 2020-09-26 18:50:07.000000000 +0000 @@ -32,6 +32,7 @@ #ifdef HAVE_BARE_BROWSER enable_zone ("bare_browser"); #endif + set_variable("VERSION", config_logic_version ()); } diff -Nru bibledit-5.0.912/bb/logic.cpp bibledit-5.0.922/bb/logic.cpp --- bibledit-5.0.912/bb/logic.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/bb/logic.cpp 2020-11-13 16:26:26.000000000 +0000 @@ -46,6 +46,7 @@ #include #include #include +#include void bible_logic_store_chapter (const string& bible, int book, int chapter, const string& usfm) @@ -815,6 +816,10 @@ information.append (translate ("But Bibledit is not entirely sure that all went well.")); information.append (" "); information.append (translate ("You may want to check whether the Bible text was saved correctly.")); + information.append (" "); + information.append (translate ("The text in bold was added.")); + information.append (" "); + information.append (translate ("The text in strikethrough was removed.")); node.text ().set (information.c_str()); node = document.append_child ("p"); string location = bible + " " + filter_passage_display (book, chapter, "") + "."; @@ -856,3 +861,279 @@ // Schedule the mail for sending to the user. email_schedule (user, subject, html); } + + +void bible_logic_optional_merge_irregularity_email (const string & bible, int book, int chapter, + const string & user, + const string & ancestor_usfm, + const string & edited_usfm, + const string & merged_usfm) +{ + // If the merged edited USFM is the same as the edited USFM, + // that means that the user's changes will get saved to the chapter. + if (edited_usfm == merged_usfm) return; + // But if the merged edited USFM differs from the original edited USFM, + // more checks need to be done to be sure that the user's edits made it. + + string subject = translate ("Check whether Bible text was saved"); + + // Create the body of the email. + xml_document document; + xml_node node; + node = document.append_child ("h3"); + node.text ().set (subject.c_str()); + + // Add some information for the user. + node = document.append_child ("p"); + string information; + information.append (translate ("Bibledit saved the Bible text below.")); + information.append (" "); + information.append (translate ("But Bibledit is not entirely sure that all went well.")); + information.append (" "); + information.append (translate ("You may want to check whether the Bible text was saved correctly.")); + information.append (" "); + information.append (translate ("The text in bold was added.")); + information.append (" "); + information.append (translate ("The text in strikethrough was removed.")); + node.text ().set (information.c_str()); + node = document.append_child ("p"); + string location = bible + " " + filter_passage_display (book, chapter, "") + "."; + node.text ().set (location.c_str ()); + + bool anomalies_found = false; + + // Go through all verses available in the USFM, + // and check the differences for each verse. + vector verses = usfm_get_verse_numbers (merged_usfm); + for (auto verse : verses) { + string ancestor_verse_usfm = usfm_get_verse_text (ancestor_usfm, verse); + string edited_verse_usfm = usfm_get_verse_text (edited_usfm, verse); + string merged_verse_usfm = usfm_get_verse_text (merged_usfm, verse); + // There's going to be a check to find out that all the changes the user made, + // are available among the changes resulting from the merge. + // If all the changes are there, all is good. + // If not, then email the user about this. + bool anomaly_found = false; + vector user_removals, user_additions, merged_removals, merged_additions; + filter_diff_diff (ancestor_verse_usfm, edited_verse_usfm, &user_removals, &user_additions); + filter_diff_diff (ancestor_verse_usfm, merged_verse_usfm, &merged_removals, &merged_additions); + //vector missed_removals, missed_additions; + for (auto user_removal : user_removals) { + //if (!in_array (user_removal, merged_removals)) missed_removals.push_back (user_removal); + if (!in_array (user_removal, merged_removals)) anomaly_found = true; + } + for (auto user_addition : user_additions) { + //if (!in_array (user_addition, merged_additions)) missed_additions.push_back (user_addition); + if (!in_array (user_addition, merged_additions)) anomaly_found = true; + } + if (!anomaly_found) continue; + anomalies_found = true; + Filter_Text filter_text_ancestor = Filter_Text (bible); + Filter_Text filter_text_edited = Filter_Text (bible); + Filter_Text filter_text_merged = Filter_Text (bible); + filter_text_ancestor.html_text_standard = new Html_Text (translate("Bible")); + filter_text_edited.html_text_standard = new Html_Text (translate("Bible")); + filter_text_merged.html_text_standard = new Html_Text (translate("Bible")); + filter_text_ancestor.text_text = new Text_Text (); + filter_text_edited.text_text = new Text_Text (); + filter_text_merged.text_text = new Text_Text (); + filter_text_ancestor.addUsfmCode (ancestor_verse_usfm); + filter_text_edited.addUsfmCode (edited_verse_usfm); + filter_text_merged.addUsfmCode (merged_verse_usfm); + filter_text_ancestor.run (styles_logic_standard_sheet()); + filter_text_edited.run (styles_logic_standard_sheet()); + filter_text_merged.run (styles_logic_standard_sheet()); + string ancestor_text = filter_text_ancestor.text_text->get (); + string edited_text = filter_text_edited.text_text->get (); + string merged_text = filter_text_merged.text_text->get (); + string modification; + node = document.append_child ("p"); + modification = translate ("You edited:") + " " + filter_diff_diff (ancestor_text, edited_text); + node.append_buffer (modification.c_str (), modification.size ()); + node = document.append_child ("p"); + modification = translate ("Bibledit saved:") + " " + filter_diff_diff (ancestor_text, merged_text); + node.append_buffer (modification.c_str (), modification.size ()); + } + + // If no differences were found, bail out. + // This also handles differences in spacing. + // If the differences consist of whitespace only, bail out here. + // See issue https://github.com/bibledit/cloud/issues/413 + if (!anomalies_found) return; + + // Convert the document to a string. + stringstream output; + document.print (output, "", format_raw); + string html = output.str (); + + // Schedule the mail for sending to the user. + email_schedule (user, subject, html); +} + + +const char * bible_logic_insert_operator () +{ + return "i"; +} +const char * bible_logic_delete_operator () +{ + return "d"; +} +const char * bible_logic_format_paragraph_operator () +{ + return "p"; +} +const char * bible_logic_format_character_operator () +{ + return "c"; +} + +// There are three containers with updating information. +// The function condenses this updating information. +// This condensed information works better for the Quill editor. +void bible_logic_condense_editor_updates (const vector & positions_in, + const vector & sizes_in, + const vector & additions_in, + const vector & content_in, + vector & positions_out, + vector & sizes_out, + vector & operators_out, + vector & content_out) +{ + positions_out.clear(); + sizes_out.clear(); + operators_out.clear(); + content_out.clear(); + + // https://stackoverflow.com/questions/40492414/why-does-stdnumeric-limitslong-longmax-fail + int previous_position = (numeric_limits::min)(); + bool previous_addition = false; + string previous_character = string(); + for (size_t i = 0; i < positions_in.size(); i++) { + int position = positions_in[i]; + int size = sizes_in[i]; + bool addition = additions_in[i]; + string character = content_in[i].substr (0, 1); + string format = content_in[i].substr (1); + + // The following situation occurs when changing the style of a paragraph. + // Like for example changing a paragraph style from "p" to "s". + // The current sequence for this change is: + // 1. Delete a new line at a known position. + // 2. Insert a new line at the same position, with a given format. + // Condense this as follows: + // 1. Apply the given paragraph format to the given position. + // Without condensing this, the following would happen: + // 1. Delete the new line before the second line. + // Result: The first line gets the format of the second line. + // 2. Insert the new line before the second line again. + // 3. Appy formatting to the second line. + // The net result is that the first line remains with the paragraph format of the second line. + bool newlineflag = addition && !previous_addition && (character == "\n") && (character == previous_character) && (position == previous_position); + if (newlineflag) { + // Remove the previous "delete new line". + positions_out.pop_back(); + sizes_out.pop_back(); + operators_out.pop_back(); + content_out.pop_back(); + // Add the paragraph format operation data. + positions_out.push_back(position); + sizes_out.push_back(size); + operators_out.push_back(bible_logic_format_paragraph_operator()); + content_out.push_back(format); + } else { + positions_out.push_back(position); + sizes_out.push_back(size); + if (addition) operators_out.push_back(bible_logic_insert_operator()); + else operators_out.push_back(bible_logic_delete_operator()); + content_out.push_back(character + format); + } + + // Store data for the next iteration. + previous_position = position; + previous_addition = addition; + previous_character = character; + } + +} + + +void bible_logic_html_to_editor_updates (const string & editor_html, + const string & server_html, + vector & positions, + vector & sizes, + vector & operators, + vector & content) +{ + // Clear outputs. + positions.clear(); + sizes.clear(); + operators.clear(); + content.clear(); + + // Convert the html to formatted text. + Editor_Html2Format editor_format; + Editor_Html2Format server_format; + editor_format.load (editor_html); + server_format.load (server_html); + editor_format.run (); + server_format.run (); + + // Convert the formatted text fragments to formatted UTF-8 characters. + vector editor_formatted_character_content; + for (size_t i = 0; i < editor_format.texts.size(); i++) { + string text = editor_format.texts[i]; + string format = editor_format.formats[i]; + size_t length = unicode_string_length (text); + for (size_t pos = 0; pos < length; pos++) { + string utf8_character = unicode_string_substr (text, pos, 1); + editor_formatted_character_content.push_back (utf8_character + format); + } + } + vector server_formatted_character_content; + vector server_utf8_characters; + for (size_t i = 0; i < server_format.texts.size(); i++) { + string text = server_format.texts[i]; + string format = server_format.formats[i]; + size_t length = unicode_string_length (text); + for (size_t pos = 0; pos < length; pos++) { + string utf8_character = unicode_string_substr (text, pos, 1); + server_formatted_character_content.push_back (utf8_character + format); + server_utf8_characters.push_back(utf8_character); + } + } + + // Find the differences between the two sets of content. + vector positions_diff; + vector sizes_diff; + vector additions_diff; + vector content_diff; + int new_line_diff_count; + filter_diff_diff_utf16 (editor_formatted_character_content, server_formatted_character_content, + positions_diff, sizes_diff, additions_diff, content_diff, new_line_diff_count); + + // Condense the differences a bit and render them to another format. + bible_logic_condense_editor_updates (positions_diff, sizes_diff, additions_diff, content_diff, + positions, sizes, operators, content); + + // Problem description: + // User action: Remove the new line at the end of the current paragraph. + // Result: The current paragraph takes the style of the next paragraph. + // User actions: While removing notes, this goes wrong. + // Solution: + // If there's new line(s) added or removed, apply all paragraph styles again. + if (new_line_diff_count) { + int position = 0; + for (size_t i = 0; i < server_utf8_characters.size(); i++) { + int size = (int)convert_to_u16string (server_utf8_characters[i]).length(); + if (server_utf8_characters[i] == "\n") { + positions.push_back(position); + sizes.push_back(size); + operators.push_back(bible_logic_format_paragraph_operator()); + content.push_back(server_formatted_character_content[i].substr (1)); + } + position += size; + } + } + +} diff -Nru bibledit-5.0.912/bb/logic.h bibledit-5.0.922/bb/logic.h --- bibledit-5.0.912/bb/logic.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/bb/logic.h 2020-11-04 14:05:20.000000000 +0000 @@ -49,6 +49,29 @@ void bible_logic_recent_save_email (const string & bible, int book, int chapter, int verse, const string & user, const string & old_usfm, const string & new_usfm); +void bible_logic_optional_merge_irregularity_email (const string & bible, int book, int chapter, + const string & user, + const string & ancestor_usfm, + const string & edited_usfm, + const string & merged_usfm); +const char * bible_logic_insert_operator (); +const char * bible_logic_delete_operator (); +const char * bible_logic_format_paragraph_operator (); +const char * bible_logic_format_character_operator (); +void bible_logic_condense_editor_updates (const vector & positions_in, + const vector & sizes_in, + const vector & additions_in, + const vector & content_in, + vector & positions_out, + vector & sizes_out, + vector & operators_out, + vector & content_out); +void bible_logic_html_to_editor_updates (const string & editor_html, + const string & server_html, + vector & positions, + vector & sizes, + vector & operators, + vector & content); #endif diff -Nru bibledit-5.0.912/bootstrap/bootstrap.cpp bibledit-5.0.922/bootstrap/bootstrap.cpp --- bibledit-5.0.912/bootstrap/bootstrap.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/bootstrap/bootstrap.cpp 2020-11-23 19:24:43.000000000 +0000 @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -75,10 +76,7 @@ #include #include #include -#include -#include -#include -#include +#include #include #include #include @@ -192,6 +190,21 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // Internal function to check whether a request coming from the browser is considered secure enough. @@ -370,7 +383,7 @@ return; } - if ((url == editone_index_url ()) && browser_request_security_okay (request) && editone_index_acl (request)) { + if ((url == editone_index_url ()) && browser_request_security_okay (request) && editone_index_acl ()) { request->reply = editone_index (request); return; } @@ -962,26 +975,13 @@ request->reply = navigation_poll (request); return; } - - if ((url == editone_load_url ()) && browser_request_security_okay (request) && editone_load_acl (request)) { - request->reply = editone_load (request); - return; - } - - if ((url == editone_save_url ()) && browser_request_security_okay (request) && editone_save_acl (request)) { - request->reply = editone_save (request); - return; - } - - if ((url == editone_verse_url ()) && browser_request_security_okay (request) && editone_verse_acl (request)) { - request->reply = editone_verse (request); - return; - } - - if ((url == editone_verse_url ()) && browser_request_security_okay (request) && editone_verse_acl (request)) { - request->reply = editone_verse (request); + +#ifdef HAVE_WINDOWS + if (url == navigation_paratext_url ()) { + request->reply = navigation_paratext (request); return; } +#endif if ((url == edit_preview_url ()) && browser_request_security_okay (request) && edit_preview_acl (request)) { request->reply = edit_preview (request); @@ -1122,6 +1122,81 @@ return; } + if ((url == edit2_index_url ()) && browser_request_security_okay (request) && edit2_index_acl (request)) { + request->reply = edit2_index (request); + return; + } + + if ((url == edit2_position_url ()) && browser_request_security_okay (request) && edit2_position_acl (request)) { + request->reply = edit2_position (request); + return; + } + + if ((url == edit2_navigate_url ()) && browser_request_security_okay (request) && edit2_navigate_acl (request)) { + request->reply = edit2_navigate (request); + return; + } + + if ((url == edit2_preview_url ()) && browser_request_security_okay (request) && edit2_preview_acl (request)) { + request->reply = edit2_preview (request); + return; + } + + if ((url == edit2_edit_url ()) && browser_request_security_okay (request) && edit2_edit_acl (request)) { + request->reply = edit2_edit (request); + return; + } + + if ((url == edit2_update_url ()) && browser_request_security_okay (request) && edit2_update_acl (request)) { + request->reply = edit2_update (request); + return; + } + + if ((url == editor_id_url ()) && browser_request_security_okay (request) && editor_id_acl (request)) { + request->reply = editor_id (request); + return; + } + + if ((url == edit2_load_url ()) && browser_request_security_okay (request) && edit2_load_acl (request)) { + request->reply = edit2_load (request); + return; + } + + if ((url == edit2_save_url ()) && browser_request_security_okay (request) && edit2_save_acl (request)) { + request->reply = edit2_save (request); + return; + } + + if ((url == editor_style_url ()) && browser_request_security_okay (request) && editor_style_acl (request)) { + request->reply = editor_style (request); + return; + } + + if ((url == editone2_index_url ()) && browser_request_security_okay (request) && editone2_index_acl (request)) { + request->reply = editone2_index (request); + return; + } + + if ((url == editone2_load_url ()) && browser_request_security_okay (request) && editone2_load_acl (request)) { + request->reply = editone2_load (request); + return; + } + + if ((url == editone2_save_url ()) && browser_request_security_okay (request) && editone2_save_acl (request)) { + request->reply = editone2_save (request); + return; + } + + if ((url == editone2_verse_url ()) && browser_request_security_okay (request) && editone2_verse_acl (request)) { + request->reply = editone2_verse (request); + return; + } + + if ((url == editone2_update_url ()) && browser_request_security_okay (request) && editone2_update_acl (request)) { + request->reply = editone2_update (request); + return; + } + // Forward the browser to the default home page. redirect_browser (request, index_index_url ()); } diff -Nru bibledit-5.0.912/config/libraries.h bibledit-5.0.922/config/libraries.h --- bibledit-5.0.912/config/libraries.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/config/libraries.h 2020-10-31 15:23:40.000000000 +0000 @@ -76,6 +76,7 @@ #include #include #include +#include // Headers dependencies. diff -Nru bibledit-5.0.912/configure bibledit-5.0.922/configure --- bibledit-5.0.912/configure 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/configure 2020-12-04 20:31:59.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for bibledit 5.0.912. +# Generated by GNU Autoconf 2.69 for bibledit 5.0.922. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='bibledit' PACKAGE_TARNAME='bibledit' -PACKAGE_VERSION='5.0.912' -PACKAGE_STRING='bibledit 5.0.912' +PACKAGE_VERSION='5.0.922' +PACKAGE_STRING='bibledit 5.0.922' PACKAGE_BUGREPORT='http://bibledit.org' PACKAGE_URL='' @@ -718,6 +718,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -806,6 +807,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1058,6 +1060,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1195,7 +1206,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1308,7 +1319,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bibledit 5.0.912 to adapt to many kinds of systems. +\`configure' configures bibledit 5.0.922 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1348,6 +1359,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1377,7 +1389,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bibledit 5.0.912:";; + short | recursive ) echo "Configuration of bibledit 5.0.922:";; esac cat <<\_ACEOF @@ -1486,7 +1498,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bibledit configure 5.0.912 +bibledit configure 5.0.922 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1826,7 +1838,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bibledit $as_me 5.0.912, which was +It was created by bibledit $as_me 5.0.922, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2689,7 +2701,7 @@ # Define the identity of the package. PACKAGE='bibledit' - VERSION='5.0.912' + VERSION='5.0.922' cat >>confdefs.h <<_ACEOF @@ -2804,7 +2816,7 @@ # Define the identity of the package. PACKAGE='bibledit' - VERSION='5.0.912' + VERSION='5.0.922' cat >>confdefs.h <<_ACEOF @@ -7107,7 +7119,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bibledit $as_me 5.0.912, which was +This file was extended by bibledit $as_me 5.0.922, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7173,7 +7185,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -bibledit config.status 5.0.912 +bibledit config.status 5.0.922 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru bibledit-5.0.912/configure.ac bibledit-5.0.922/configure.ac --- bibledit-5.0.912/configure.ac 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/configure.ac 2020-12-04 20:31:56.000000000 +0000 @@ -1,4 +1,4 @@ -AC_INIT([bibledit],[5.0.912],[http://bibledit.org]) +AC_INIT([bibledit],[5.0.922],[http://bibledit.org]) AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE([tar-ustar subdir-objects]) AC_CANONICAL_BUILD diff -Nru bibledit-5.0.912/database/config/user.cpp bibledit-5.0.922/database/config/user.cpp --- bibledit-5.0.912/database/config/user.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/database/config/user.cpp 2020-11-18 14:02:55.000000000 +0000 @@ -1346,3 +1346,17 @@ { setList (automatic_note_assignment_key (), values); } + + +const char * receive_focused_reference_from_paratext_key () +{ + return "receive-focused-reference-from-paratext"; +} +bool Database_Config_User::getReceiveFocusedReferenceFromParatext () +{ + return getBValue (receive_focused_reference_from_paratext_key (), true); +} +void Database_Config_User::setReceiveFocusedReferenceFromParatext (bool value) +{ + setBValue (receive_focused_reference_from_paratext_key (), value); +} diff -Nru bibledit-5.0.912/database/config/user.h bibledit-5.0.922/database/config/user.h --- bibledit-5.0.912/database/config/user.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/database/config/user.h 2020-11-18 14:13:36.000000000 +0000 @@ -229,6 +229,8 @@ void setOrderChangesByAuthor (bool value); vector getAutomaticNoteAssignment (); void setAutomaticNoteAssignment (vector values); + bool getReceiveFocusedReferenceFromParatext (); + void setReceiveFocusedReferenceFromParatext (bool value); private: void * webserver_request; string file (string user); diff -Nru bibledit-5.0.912/debian/changelog bibledit-5.0.922/debian/changelog --- bibledit-5.0.912/debian/changelog 2020-09-19 18:34:52.000000000 +0000 +++ bibledit-5.0.922/debian/changelog 2020-12-04 20:40:07.000000000 +0000 @@ -1,3 +1,9 @@ +bibledit (5.0.922-1) unstable; urgency=medium + + * New upstream version 5.0.922 + + -- Teus Benschop Fri, 04 Dec 2020 21:40:07 +0100 + bibledit (5.0.912-1) unstable; urgency=medium * New upstream version 5.0.912 diff -Nru bibledit-5.0.912/demo/logic.cpp bibledit-5.0.922/demo/logic.cpp --- bibledit-5.0.912/demo/logic.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/demo/logic.cpp 2020-11-22 13:44:27.000000000 +0000 @@ -34,8 +34,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -377,7 +377,7 @@ workspace_set_widths (request, widths); workspace_set_heights (request, row_heights); - urls[0] = editone_index_url (); + urls[0] = editone2_index_url (); urls[1] = resource_index_url (); request->database_config_user()->setActiveWorkspace (demo_workspace ()); diff -Nru bibledit-5.0.912/developer/index.html bibledit-5.0.922/developer/index.html --- bibledit-5.0.912/developer/index.html 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/developer/index.html 2020-11-26 16:21:00.000000000 +0000 @@ -15,6 +15,7 @@ Show alert and block keyboard for a short time

+

Chapter editor version 2 beta

##success##

##error##


diff -Nru bibledit-5.0.912/edit/edit.cpp bibledit-5.0.922/edit/edit.cpp
--- bibledit-5.0.912/edit/edit.cpp	2020-09-19 18:30:19.000000000 +0000
+++ bibledit-5.0.922/edit/edit.cpp	2020-11-22 13:57:08.000000000 +0000
@@ -64,5 +64,5 @@
   
   
   if (alive) return translate ("The passage has been opened in the existing Bible editor");
-  return "" + translate ("Open a Bible editor to edit the passage") + "";
+  return "" + translate ("Open a Bible editor to edit the passage") + "";
 }
diff -Nru bibledit-5.0.912/edit/index.js bibledit-5.0.922/edit/index.js
--- bibledit-5.0.912/edit/index.js	2020-09-19 18:30:19.000000000 +0000
+++ bibledit-5.0.922/edit/index.js	2020-11-15 19:26:10.000000000 +0000
@@ -55,6 +55,9 @@
   }
 
   $ ("#editor").on ("click", editorNoteCitationClicked);
+
+  $ ("#editor").bind ("paste", editorClipboardPasteHandler);
+  
 });
 
 
@@ -99,6 +102,18 @@
 }
 
 
+// This fixes an issue where upon pasting text in the editor,
+// the editor scrolls to the very top of the text.
+// If the text is long, then the focused verse is thrown off the screen.
+// Here it fixes that.
+// https://github.com/bibledit/cloud/issues/428
+function editorClipboardPasteHandler (event)
+{
+  var currentScrollTop = $("#workspacewrapper").scrollTop();
+  $("#workspacewrapper").animate({ scrollTop: currentScrollTop }, 100);
+}
+
+
 /*
 
 Section for the new Passage event from the Navigator.
@@ -196,7 +211,11 @@
       response = checksum_receive (response);
       if (response !== false) {
         // Only load new text when it is different.
-        if (response != editorGetHtml ()) {
+        // Extract the plain text from the html and compare that.
+        // https://github.com/bibledit/cloud/issues/449
+        var responseText = $(response).text();
+        var editorText = $(editorGetHtml ()).text();
+        if (responseText != editorText) {
           // Destroy existing editor.
           if (quill) delete quill;
           // Load the html in the DOM.
@@ -209,20 +228,21 @@
           css4embeddedstyles ();
           // Feedback.
           editorStatus (editorChapterLoaded);
-        }
-        // Reference for comparison at save time.
-        editorReferenceText = editorGetHtml ();
-        // Position caret straightaway.
-        if (reload) {
-          positionCaret (editorCaretPosition);
-        }
-        editorScheduleCaretPositioning ();
-        // Alert on reloading soon after save, or after text reload.
-        // https://github.com/bibledit/cloud/issues/346
-        editorLoadDate = new Date();
-        var seconds = (editorLoadDate.getTime() - editorSaveDate.getTime()) / 1000;
-        if ((seconds < 2) || reload) {
-          if (editorWriteAccess) editorReloadAlert (editorChapterVerseUpdatedLoaded);
+          // Reference for comparison at save time.
+          editorReferenceText = editorGetHtml ();
+          // Position caret straightaway.
+          if (reload) {
+            positionCaret (editorCaretPosition);
+          }
+          editorScheduleCaretPositioning ();
+          // Alert on reloading soon after save, or after text reload.
+          // https://github.com/bibledit/cloud/issues/346
+          editorLoadDate = new Date();
+          var seconds = (editorLoadDate.getTime() - editorSaveDate.getTime()) / 1000;
+          seconds = 2; // Disable timer.
+          if ((seconds < 2) || reload) {
+            if (editorWriteAccess) editorReloadAlert (editorChapterVerseUpdatedLoaded);
+          }
         }
       } else {
         // Checksum error: Reload.
@@ -278,6 +298,7 @@
       editorSaving = false;
       editorSaveDate = new Date();
       var seconds = (editorSaveDate.getTime() - editorLoadDate.getTime()) / 1000;
+      seconds = 2; // Disable timer.
       if (seconds < 2) {
         if (editorWriteAccess) editorReloadAlert (editorChapterVerseUpdatedLoaded);
       }
@@ -1078,6 +1099,7 @@
 
 function editorReloadAlert (message)
 {
+  return;
   // Take action only if the editor has focus and the user can type in it.
   if (quill.hasFocus ()) {
     notifyItSuccess (message)
diff -Nru bibledit-5.0.912/edit/load.cpp bibledit-5.0.922/edit/load.cpp
--- bibledit-5.0.912/edit/load.cpp	2020-09-19 18:30:19.000000000 +0000
+++ bibledit-5.0.922/edit/load.cpp	2020-11-09 19:39:42.000000000 +0000
@@ -66,7 +66,6 @@
   Editor_Usfm2Html editor_usfm2html;
   editor_usfm2html.load (usfm);
   editor_usfm2html.stylesheet (stylesheet);
-  editor_usfm2html.quill ();
   editor_usfm2html.run ();
   
   string html = editor_usfm2html.get ();
diff -Nru bibledit-5.0.912/edit/navigate.cpp bibledit-5.0.922/edit/navigate.cpp
--- bibledit-5.0.912/edit/navigate.cpp	2020-09-19 18:30:19.000000000 +0000
+++ bibledit-5.0.922/edit/navigate.cpp	2020-11-09 20:00:52.000000000 +0000
@@ -68,7 +68,6 @@
   Editor_Usfm2Html editor_usfm2html;
   editor_usfm2html.load (usfm);
   editor_usfm2html.stylesheet (stylesheet);
-  editor_usfm2html.quill ();
   editor_usfm2html.run ();
 
   
diff -Nru bibledit-5.0.912/edit/position.cpp bibledit-5.0.922/edit/position.cpp
--- bibledit-5.0.912/edit/position.cpp	2020-09-19 18:30:19.000000000 +0000
+++ bibledit-5.0.922/edit/position.cpp	2020-11-09 20:00:52.000000000 +0000
@@ -66,7 +66,6 @@
   Editor_Usfm2Html editor_usfm2html;
   editor_usfm2html.load (usfm);
   editor_usfm2html.stylesheet (stylesheet);
-  editor_usfm2html.quill ();
   editor_usfm2html.run ();
   
   int startingOffset = 0;
diff -Nru bibledit-5.0.912/edit/save.cpp bibledit-5.0.922/edit/save.cpp
--- bibledit-5.0.912/edit/save.cpp	2020-09-19 18:30:19.000000000 +0000
+++ bibledit-5.0.922/edit/save.cpp	2020-11-08 19:42:28.000000000 +0000
@@ -98,7 +98,6 @@
   string stylesheet = Database_Config_Bible::getEditorStylesheet (bible);
   
   Editor_Html2Usfm editor_export;
-  editor_export.quill ();
   editor_export.load (html);
   editor_export.stylesheet (stylesheet);
   editor_export.run ();
diff -Nru bibledit-5.0.912/edit2/edit.cpp bibledit-5.0.922/edit2/edit.cpp
--- bibledit-5.0.912/edit2/edit.cpp	1970-01-01 00:00:00.000000000 +0000
+++ bibledit-5.0.922/edit2/edit.cpp	2020-11-22 13:57:08.000000000 +0000
@@ -0,0 +1,68 @@
+/*
+ Copyright (©) 2003-2020 Teus Benschop.
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+string edit2_edit_url ()
+{
+  return "edit2/edit";
+}
+
+
+bool edit2_edit_acl (void * webserver_request)
+{
+  if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true;
+  bool read, write;
+  access_a_bible (webserver_request, read, write);
+  return read;
+}
+
+
+string edit2_edit (void * webserver_request)
+{
+  Webserver_Request * request = (Webserver_Request *) webserver_request;
+  
+  
+  string href = request->query ["href"];
+  Passage passage = filter_integer_to_passage (convert_to_int (href));
+  Ipc_Focus::set (request, passage.book, passage.chapter, convert_to_int (passage.verse));
+  Navigation_Passage::recordHistory (request, passage.book, passage.chapter, convert_to_int (passage.verse));
+  
+  
+  // Check whether a Bible editor is alive.
+  int timestamp = request->database_config_user()->getLiveBibleEditor ();
+  bool alive = (timestamp > (filter_date_seconds_since_epoch () - 5));
+  
+  
+  if (alive) return translate ("The passage has been opened in the existing Bible editor");
+  return "" + translate ("Open a Bible editor to edit the passage") + "";
+}
diff -Nru bibledit-5.0.912/edit2/edit.h bibledit-5.0.922/edit2/edit.h
--- bibledit-5.0.912/edit2/edit.h	1970-01-01 00:00:00.000000000 +0000
+++ bibledit-5.0.922/edit2/edit.h	2020-09-26 17:03:22.000000000 +0000
@@ -0,0 +1,32 @@
+/*
+ Copyright (©) 2003-2020 Teus Benschop.
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+#ifndef INCLUDED_EDIT2_EDIT_H
+#define INCLUDED_EDIT2_EDIT_H
+
+
+#include 
+
+
+string edit2_edit_url ();
+bool edit2_edit_acl (void * webserver_request);
+string edit2_edit (void * webserver_request);
+
+
+#endif
diff -Nru bibledit-5.0.912/edit2/embed.js bibledit-5.0.922/edit2/embed.js
--- bibledit-5.0.912/edit2/embed.js	1970-01-01 00:00:00.000000000 +0000
+++ bibledit-5.0.922/edit2/embed.js	2020-09-26 16:56:34.000000000 +0000
@@ -0,0 +1,106 @@
+/*
+ Copyright (©) 2003-2020 Teus Benschop.
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+
+var embedded_classnames = [];
+
+
+// Creates CSS for embedded character styles.
+function css4embeddedstyles ()
+{
+  var spans = $ (".ql-editor span");
+  spans.each (function () {
+    var classname = $ (this).attr ("class");
+    if (classname) {
+      var index = classname.indexOf ("0");
+      if (index > 0) {
+        if ($.inArray (classname, embedded_classnames) < 0) {
+          embedded_classnames.push (classname);
+          var name = classname.substring (2);
+          var bits = name.split ("0");
+          var font_style = null;
+          var font_weight = null;
+          var font_variant = null;
+          // var font_size = null;
+          var text_decoration = null;
+          var vertical_align = null;
+          var color = null;
+          var background_color = null;
+          for (i = 0; i < bits.length; i++) {
+            name = bits [i];
+            var element = document.createElement("span");
+            element.className = name;
+            document.body.appendChild (element);
+            var properties = window.getComputedStyle (element, null);
+            var value = properties.getPropertyValue ("font-style");
+            if (value != "normal") font_style = value;
+            value = properties.getPropertyValue ("font-weight");
+            if (value != "normal") font_weight = value;
+            value = properties.getPropertyValue ("font-variant");
+            if (value != "normal") font_variant = value;
+            // The font-size is calculated in "px", and is not very important, so is left out.
+            // value = properties.getPropertyValue ("font-size");
+            // if (value != "12px") font_size = value;
+            value = properties.getPropertyValue ("text-decoration");
+            if (value != "none") text_decoration = value;
+            value = properties.getPropertyValue ("vertical-align");
+            if (value != "baseline") vertical_align = value;
+            value = properties.getPropertyValue ("color");
+            if (value != "rgb(0, 0, 0)") color = value;
+            value = properties.getPropertyValue ("background-color");
+            if (value != "rgba(0, 0, 0, 0)") background_color = value;
+          }
+          if (font_style) $.stylesheet ("." + classname, "font-style", font_style);
+          if (font_weight) $.stylesheet ("." + classname, "font-weight", font_weight);
+          if (font_variant) $.stylesheet ("." + classname, "font-variant", font_variant);
+          //if (font_size) $.stylesheet ("." + classname, "font-size", font_size);
+          if (text_decoration) $.stylesheet ("." + classname, "text-decoration", text_decoration);
+          if (vertical_align) $.stylesheet ("." + classname, "vertical-align", vertical_align);
+          if (color) $.stylesheet ("." + classname, "color", color);
+          if (background_color) $.stylesheet ("." + classname, "background-color", background_color);
+        }
+      }
+    }
+  });
+}
+
+
+// Returns the character style to apply based on the actual and desired style.
+function editor_determine_character_style (actual, desired)
+{
+  // Deal with undefined actual style.
+  if (!actual) actual = "";
+  
+  // If the desired style is already applied, remove it again.
+  if (desired == actual) return "";
+
+  // If no character style has been applied yet, apply it.
+  if (actual == "") return desired;
+
+  // If the applied style is embedded already, just apply the desired style only.
+  if (actual.indexOf ("0") > 0) return desired;
+  
+  // Add the desired style to the one already there.
+  return actual + "0" + desired;
+}
+
+
+function post_embedded_style_application (style)
+{
+  if (style.indexOf ("0") >= 0) css4embeddedstyles ();
+}
diff -Nru bibledit-5.0.912/edit2/index.cpp bibledit-5.0.922/edit2/index.cpp
--- bibledit-5.0.912/edit2/index.cpp	1970-01-01 00:00:00.000000000 +0000
+++ bibledit-5.0.922/edit2/index.cpp	2020-11-30 06:23:49.000000000 +0000
@@ -0,0 +1,191 @@
+/*
+ Copyright (©) 2003-2020 Teus Benschop.
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+string edit2_index_url ()
+{
+  return "edit2/index";
+}
+
+
+bool edit2_index_acl (void * webserver_request)
+{
+  if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true;
+  bool read, write;
+  access_a_bible (webserver_request, read, write);
+  return write;
+}
+
+
+string edit2_index (void * webserver_request)
+{
+  Webserver_Request * request = (Webserver_Request *) webserver_request;
+  
+  
+  bool touch = request->session_logic ()->touchEnabled ();
+
+  
+  if (request->query.count ("switchbook") && request->query.count ("switchchapter")) {
+    int switchbook = convert_to_int (request->query ["switchbook"]);
+    int switchchapter = convert_to_int (request->query ["switchchapter"]);
+    int switchverse = 1;
+    if (request->query.count ("switchverse")) switchverse = convert_to_int (request->query ["switchverse"]);
+    Ipc_Focus::set (request, switchbook, switchchapter, switchverse);
+    Navigation_Passage::recordHistory (request, switchbook, switchchapter, switchverse);
+  }
+
+  
+  string page;
+  
+  
+  Assets_Header header = Assets_Header (translate("Edit"), request);
+  header.setNavigator ();
+  header.setEditorStylesheet ();
+  if (touch) header.jQueryTouchOn ();
+  header.notifItOn ();
+  header.addBreadCrumb (menu_logic_translate_menu (), menu_logic_translate_text ());
+  page = header.run ();
+  
+  
+  if (request->query.count ("changebible")) {
+    string changebible = request->query ["changebible"];
+    if (changebible == "") {
+      Dialog_List dialog_list = Dialog_List ("index", translate("Select which Bible to open in the editor"), "", "");
+      vector  bibles = access_bible_bibles (request);
+      for (auto & bible : bibles) {
+        dialog_list.add_row (bible, "changebible", bible);
+      }
+      page += dialog_list.run ();
+      return page;
+    } else {
+      request->database_config_user()->setBible (changebible);
+      // Going to another Bible, ensure that the focused book exists there.
+      int book = Ipc_Focus::getBook (request);
+      vector  books = request->database_bibles()->getBooks (changebible);
+      if (find (books.begin(), books.end(), book) == books.end()) {
+        if (!books.empty ()) book = books [0];
+        else book = 0;
+        Ipc_Focus::set (request, book, 1, 1);
+      }
+    }
+  }
+  
+  
+  Assets_View view;
+  
+  
+  // Active Bible, and check access.
+  string bible = access_bible_clamp (request, request->database_config_user()->getBible ());
+  if (request->query.count ("bible")) bible = access_bible_clamp (request, request->query ["bible"]);
+  view.set_variable ("bible", bible);
+  
+  
+  // Store the active Bible in the page's javascript.
+  view.set_variable ("navigationCode", Navigation_Passage::code (bible));
+  
+
+  int verticalCaretPosition = request->database_config_user ()->getVerticalCaretPosition (); 
+  string script =
+  "var editorChapterLoaded = '" + locale_logic_text_loaded () + "';\n"
+  "var editorChapterUpdating = '" + locale_logic_text_updating () + "';\n"
+  "var editorChapterUpdated = '" + locale_logic_text_updated () + "';\n"
+  "var editorWillSave = '" + locale_logic_text_will_save () + "';\n"
+  "var editorChapterSaving = '" + locale_logic_text_saving () + "';\n"
+  "var editorChapterSaved = '" + locale_logic_text_saved () + "';\n"
+  "var editorChapterRetrying = '" + locale_logic_text_retrying () + "';\n"
+  "var editorChapterVerseUpdatedLoaded = '" + locale_logic_text_reload () + "';\n"
+  "var verticalCaretPosition = " + convert_to_string (verticalCaretPosition) + ";\n"
+  "var verseSeparator = '" + Database_Config_General::getNotesVerseSeparator () + "';\n";
+  config_logic_swipe_enabled (webserver_request, script);
+  view.set_variable ("script", script);
+  
+  
+  string clss = Filter_Css::getClass (bible);
+  string font = Fonts_Logic::getTextFont (bible);
+  int direction = Database_Config_Bible::getTextDirection (bible);
+  int lineheight = Database_Config_Bible::getLineHeight (bible);
+  int letterspacing = Database_Config_Bible::getLetterSpacing (bible);
+  view.set_variable ("custom_class", clss);
+  view.set_variable ("custom_css", Filter_Css::getCss (clss,
+                                                       Fonts_Logic::getFontPath (font),
+                                                       direction,
+                                                       lineheight,
+                                                       letterspacing));
+  
+ 
+  // In basic mode the editor has no controls and fewer indicators.
+  // In basic mode, the user can just edit text, and cannot style it.
+  bool basic_mode = config_logic_basic_mode (webserver_request);
+  if (!basic_mode) view.enable_zone ("advancedmode");
+  
+  
+  // Whether to enable fast Bible editor switching.
+  if (!basic_mode && request->database_config_user ()->getFastEditorSwitchingAvailable ()) {
+    view.enable_zone ("fastswitcheditor");
+  }
+
+  
+  // Whether to enable the styles button.
+  if (request->database_config_user ()->getEnableStylesButtonVisualEditors ()) {
+    view.enable_zone ("stylesbutton");
+  }
+  
+  
+  page += view.render ("edit2", "index");
+  
+  
+  page += Assets_Page::footer ();
+  
+  
+  return page;
+}
+
+
+/*
+ Tests for the Bible editor:
+ * Autosave on going to another passage.
+ * Autosave on document unload.
+ * Autosave shortly after any change.
+ * Automatic reload when another user updates the chapter on the server.
+ * Position caret at correct verse.
+ * Scroll caret into view.
+ */
diff -Nru bibledit-5.0.912/edit2/index.h bibledit-5.0.922/edit2/index.h
--- bibledit-5.0.912/edit2/index.h	1970-01-01 00:00:00.000000000 +0000
+++ bibledit-5.0.922/edit2/index.h	2020-09-26 18:25:32.000000000 +0000
@@ -0,0 +1,32 @@
+/*
+ Copyright (©) 2003-2020 Teus Benschop.
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+#ifndef INCLUDED_EDIT2_INDEX_H
+#define INCLUDED_EDIT2_INDEX_H
+
+
+#include 
+
+
+string edit2_index_url ();
+bool edit2_index_acl (void * webserver_request);
+string edit2_index (void * webserver_request);
+
+
+#endif
diff -Nru bibledit-5.0.912/edit2/index.html bibledit-5.0.922/edit2/index.html
--- bibledit-5.0.912/edit2/index.html	1970-01-01 00:00:00.000000000 +0000
+++ bibledit-5.0.922/edit2/index.html	2020-11-25 12:24:55.000000000 +0000
@@ -0,0 +1,42 @@
+
+
+
+ + + + + + + + + + | + ##bible## + | + + + + | + translate ("editor") + + +
+
+ +
+
+ + + + + + + + + + + + +##navigationCode## diff -Nru bibledit-5.0.912/edit2/index.js bibledit-5.0.922/edit2/index.js --- bibledit-5.0.912/edit2/index.js 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/index.js 2020-11-29 18:26:53.000000000 +0000 @@ -0,0 +1,1419 @@ +/* +Copyright (©) 2003-2020 Teus Benschop. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +var quill = undefined; +var Delta = Quill.import ("delta"); +var chapterEditorUniqueID = Math.floor (Math.random() * 100000000); + + +$ (document).ready (function () +{ + // Reposition the editor's menu so it never scrolls out of view. + var bar = $ ("#editorheader").remove (); + $ ("#workspacemenu").append (bar); + + editorInitializeOnce (); + editorInitialize (); + + navigationNewPassage (); + + $ (window).on ("unload", edit2SaveChapter); + + editorBindUnselectable (); + $ ("#stylebutton").on ("click", editorStylesButtonHandler); + $ (window).on ("keydown", editorWindowKeyHandler); + + edit2PositionCaretViaAjaxStart (); + + if (swipe_operations) { + $ ("body").swipe ( { + swipeLeft:function (event, direction, distance, duration, fingerCount, fingerData) { + editorSwipeLeft (event); + }, + swipeRight:function (event, direction, distance, duration, fingerCount, fingerData) { + editorSwipeRight (event); + } + }); + } + + $ ("#editor").on ("click", editorNoteCitationClicked); + + $ ("#editor").bind ("paste", editorClipboardPasteHandler); + + setTimeout (edit2CoordinatingTimeout, 500); + +}); + + +function editorInitializeOnce () +{ + var Parchment = Quill.import ('parchment'); + + // Register block formatting class. + var ParagraphClass = new Parchment.Attributor.Class ('paragraph', 'b', { scope: Parchment.Scope.BLOCK }); + Quill.register (ParagraphClass, true); + + // Register inline formatting class. + var CharacterClass = new Parchment.Attributor.Class ('character', 'i', { scope: Parchment.Scope.INLINE }); + Quill.register (CharacterClass, true); +} + + +function editorInitialize () +{ + // Work around https://github.com/quilljs/quill/issues/1116 + // It sets the margins to 0 by adding an overriding class. + // The Quill editor will remove that class again. + $ ("#editor > p").each (function (index) { + var element = $(this); + element.addClass ("nomargins"); + }); + + // Instantiate editor. + quill = new Quill ('#editor', { }); + + // Cause it to paste plain text only. + quill.clipboard.addMatcher (Node.ELEMENT_NODE, function (node, delta) { + var plaintext = $ (node).text (); + return new Delta().insert (plaintext); + }); + + if (editorWriteAccess) if (!quill.hasFocus ()) quill.focus (); + + // Event handlers. + quill.on ("text-change", editorTextChangeHandler); + quill.on ("selection-change", editorSelectionChangeHandler); + + // Clear undo/redo stack. + quill.history.clear(); +} + + +// This fixes an issue where upon pasting text in the editor, +// the editor scrolls to the very top of the text. +// If the text is long, then the focused verse is thrown off the screen. +// Here it fixes that. +// https://github.com/bibledit/cloud/issues/428 +function editorClipboardPasteHandler (event) +{ + var currentScrollTop = $("#workspacewrapper").scrollTop(); + $("#workspacewrapper").animate({ scrollTop: currentScrollTop }, 100); +} + + +/* + +Section for the new Passage event from the Navigator. + +*/ + + +var editorNavigationBook; +var editorNavigationChapter; +var editorNavigationVerse; + + +function navigationNewPassage () +{ + if (typeof navigationBook != 'undefined') { + editorNavigationBook = navigationBook; + editorNavigationChapter = navigationChapter; + editorNavigationVerse = navigationVerse; + } else if (parent.window.navigationBook != 'undefined') { + editorNavigationBook = parent.window.navigationBook; + editorNavigationChapter = parent.window.navigationChapter; + editorNavigationVerse = parent.window.navigationVerse; + } else { + return; + } + + if ((editorNavigationBook != editorLoadedBook) || (editorNavigationChapter != editorLoadedChapter)) { + edit2SaveChapter (); + editorLoadChapter (); + } else { + editorScheduleCaretPositioning (); + } + editorHighlightVerseNumber (); +} + + +/* + +Section for editor load and save. + +Notes: +* It remembers the Bible, book, and chapter loaded. + The reason for remembering these is, among others, that the active Bible / book / chapter + on the server may change due to user actions, so when saving this chapter to the server, + it passes the correct Bible / book / chapter to the server along with the updated text. +* While loading the chapter, do not set the "contenteditable" to false, then to true, + because Google Chrome gets confused then. This was seen on version 33. + Other types of browsers and other versions were not tested on this behaviour. + +*/ + + +var editorLoadedBible; +var editorLoadedBook; +var editorLoadedChapter; +var editorReferenceText; +var editorTextChanged = false; +var edit2CaretPosition = 0; +var editorSaving = false; +var editorWriteAccess = false; + + +function editorLoadChapter () +{ + editorLoadedBible = navigationBible; + editorLoadedBook = editorNavigationBook; + editorLoadedChapter = editorNavigationChapter; + editorChapterIdOnServer = 0; + edit2CaretPosition = getCaretPosition (); + edit2CaretInitialized = false; + $.ajax ({ + url: "load", + type: "GET", + data: { bible: editorLoadedBible, book: editorLoadedBook, chapter: editorLoadedChapter, id: chapterEditorUniqueID }, + success: function (response) { + // Set the editor read-write or read-only. + editorWriteAccess = checksum_readwrite (response); + // If this is the second or third or higher editor in the workspace, + // make the editor read-only. + if (window.frameElement) { + iframe = $(window.frameElement); + var data_editor_number = iframe.attr("data-editor-no"); + if (data_editor_number > 1) { + editorWriteAccess = false; + } + } + // Checksumming. + response = checksum_receive (response); + if (response !== false) { + // Only load new text when it is different. + // Extract the plain text from the html and compare that. + // https://github.com/bibledit/cloud/issues/449 + var responseText = $(response).text(); + var editorText = $(editorGetHtml ()).text(); + if (responseText != editorText) { + // Destroy existing editor. + if (quill) delete quill; + // Load the html in the DOM. + $ ("#editor").empty (); + $ ("#editor").append (response); + // Create the editor based on the DOM's content. + editorInitialize (); + quill.enable (editorWriteAccess); + // CSS for embedded styles. + css4embeddedstyles (); + // Feedback. + editorStatus (editorChapterLoaded); + } + // Reference for comparison at save or update time. + editorReferenceText = editorGetHtml (); + // Position caret. + editorScheduleCaretPositioning (); + } else { + // Checksum error: Reload. + editorLoadChapter (); + } + edit2CaretInitialized = false; + }, + }); +} + + +function edit2SaveChapter () +{ + editorStatus (""); + if (editorSaving) { + edit2ContentChanged (); + return; + } + if (!editorWriteAccess) return; + editorTextChanged = false; + if (!editorLoadedBible) return; + if (!editorLoadedBook) return; + var html = editorGetHtml (); + if (html == editorReferenceText) return; + editorStatus (editorChapterSaving); + editorReferenceText = html; + editorChapterIdOnServer = 0; + var encodedHtml = filter_url_plus_to_tag (html); + var checksum = checksum_get (encodedHtml); + editorSaving = true; + $.ajax ({ + url: "save", + type: "POST", + async: false, + data: { bible: editorLoadedBible, book: editorLoadedBook, chapter: editorLoadedChapter, html: encodedHtml, checksum: checksum, id: chapterEditorUniqueID }, + success: function (response) { + editorStatus (response); + }, + error: function (jqXHR, textStatus, errorThrown) { + editorStatus (editorChapterRetrying); + editorReferenceText = ""; + edit2ContentChanged (); + edit2SaveChapter (); + }, + complete: function (xhr, status) { + editorSaving = false; + }, + }); +} + + +function editorGetHtml () +{ + var html = $ ("#editor > .ql-editor").html (); + // Remove verse focus class name, if it is: + // * the only class name. + html = html.split (' class="versebeam"').join (''); + // * between two more class names. + html = html.split (' versebeam ').join (''); + // * the first class name. + html = html.split ('versebeam ').join (''); + // * the last class name. + html = html.split (' versebeam').join (''); + // Remove class applied to caret. + html = html.split ('' + String.fromCharCode(65279) + '').join (''); + // Done. + return html; +} + + +/* + +Portion dealing with triggers for when the editor's content changes. + +*/ + + +// Three combined lists store information about edits made in the editor, +// during the time span between +// 1. the moment the changes are sent to the server/device, +// when there is a delay in the network, and +// 2. the moment the updates for the editor come back from the server/device. +// Storage as follows: +// 1. Offsets at which... +// 2. The given number of characters were inserted, and... +// 3. The given number of characters were deleted. +// With 2-byte UTF-16 characters, one character is given as a "1" in the lists. +// With 4-byte UTF-16 characters, one characters is represented by a "2" in the lists. +var edit2EditorChangeOffsets = []; +var edit2EditorChangeInserts = []; +var edit2EditorChangeDeletes = []; + + +// Arguments: delta: Delta, oldContents: Delta, source: String +function editorTextChangeHandler (delta, oldContents, source) +{ + // Record the change. + // It gives 4-byte UTF-16 characters as length value 2 instead of 1. + var retain = 0; + var insert = 0; + var del = 0; + for (let i = 0; i < delta.ops.length; i++) { + let obj = delta.ops[i]; + if (obj.retain) retain = obj.retain; + // For Unicode handling, see: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length + if (obj.insert) insert = obj.insert.length; + if (obj.delete) del = obj.delete; + } + edit2EditorChangeOffsets.push(retain); + edit2EditorChangeInserts.push(insert); + edit2EditorChangeDeletes.push(del); + // Ensure that it does not delete a chapter number or verse number. + if (!delta.ops [0].retain) { + quill.history.undo (); + } + // Start save delay timer. + edit2ContentChanged (); + // Set a flag for the undo workaround. + edit2UndoChanged = true; +} + + +var edit2ContentChangedTimeoutId; + + +function edit2ContentChanged () +{ + if (!editorWriteAccess) return; + editorTextChanged = true; + editorStatus (editorWillSave); + if (edit2ContentChangedTimeoutId) { + clearTimeout (edit2ContentChangedTimeoutId); + } + edit2ContentChangedTimeoutId = setTimeout (edit2EditorTriggerSave, 1000); +} + + +function edit2EditorTriggerSave () +{ + if (!edit2UpdateTrigger) { + edit2UpdateTrigger = true; + } else { + if (edit2ContentChangedTimeoutId) { + clearTimeout (edit2ContentChangedTimeoutId); + } + edit2ContentChangedTimeoutId = setTimeout (edit2EditorTriggerSave, 400); + } +} + + +/* + +Section for polling the server for updates on the loaded chapter. + +*/ + + +var editorChapterIdOnServer = 0; + + +function edit2EditorPollId () +{ + edit2AjaxActive = true; + $.ajax ({ + url: "../editor/id", + type: "GET", + data: { bible: editorLoadedBible, book: editorLoadedBook, chapter: editorLoadedChapter }, + success: function (response) { + if (editorChapterIdOnServer != 0) { + if (response != editorChapterIdOnServer) { + // The chapter identifier changed. + // That means that likely there's updated text on the server. + // Start the routine to load any possible updates into the editor. + edit2UpdateTrigger = true; + } + } + editorChapterIdOnServer = response; + }, + complete: function (xhr, status) { + edit2AjaxActive = false; + } + }); +} + + +/* + +Section responding to a moved caret. + +*/ + + +// Responds to a changed selection or caret. +// range: { index: Number, length: Number } +// oldRange: { index: Number, length: Number } +// source: String +function editorSelectionChangeHandler (range, oldRange, source) +{ + editorHighlightVerseNumber (); + + // Bail out if editor not focused. + if (!range) return; + + // Bail out if text was selected. + if (range.length != 0) return; + + edit2CaretMovedTimeoutStart (); +} + + +var edit2CaretInitialized = false; +var edit2CaretMovedTimeoutId; + + +function edit2CaretMovedTimeoutStart () +{ + if (edit2CaretMovedTimeoutId) clearTimeout (edit2CaretMovedTimeoutId); + edit2CaretMovedTimeoutId = setTimeout (edit2CaretMovedTimeoutFinish, 200); +} + + +function edit2CaretMovedTimeoutFinish () +{ + // Since the user moved the caret by hand, + // cancel any scheduled caret positioning. + edit2PositionCaretViaAjaxStop (); + // Trigger the caret moved handler. + edit2CaretMovedTrigger = true; +} + + +function edit2HandleCaretMoved () +{ + // If the caret has not yet been positioned, postpone the action. + if (!edit2CaretInitialized) { + edit2CaretMovedTimeoutStart (); + edit2PositionCaretViaAjaxStart (); + return; + } + + if (quill.hasFocus ()) { + // Initiate a new ajax request. + edit2AjaxActive = true; + $.ajax ({ + url: "navigate", + type: "GET", + data: { bible: editorLoadedBible, book: editorLoadedBook, chapter: editorLoadedChapter, offset: getCaretPosition () }, + success: function (response) { + if (response != "") { + // Set the focused verse immediately, + // rather than waiting on the Navigator signal that likely will come later. + // This fixes a clicking / scrolling problem. + editorNavigationVerse = response; + editorScheduleWindowScrolling (); + editorHighlightVerseNumber (); + } + }, + error: function (jqXHR, textStatus, errorThrown) { + // On (network) failure, reschedule the update. + edit2CaretMovedTimeoutStart (); + }, + complete: function (xhr, status) { + edit2AjaxActive = false; + } + }); + } else { + edit2CaretMovedTimeoutStart (); + } + + editorActiveStylesFeedback (); +} + + +/* + +Section with window events and their basic handlers. + +*/ + +var edit2UndoChanged = false; + + +function editorWindowKeyHandler (event) +{ + if (!editorWriteAccess) return; + // Ctrl-S: Style. + if ((event.ctrlKey == true) && (event.keyCode == 83)) { + editorStylesButtonHandler (); + return false; + } + // Escape. + if (event.keyCode == 27) { + editorClearStyles (); + } + // Undo. + if ((event.metaKey == true) && (event.shiftKey == false) && (event.key == 'z')) { + edit2UndoChanged = false; + //var position = getCaretPosition (); + quill.history.undo(); + if (edit2UndoChanged == false) { + // This should fix an issue with the Quill editor. + // When doing an undo, and the history stack is empty, + // the Quill editor places the caret at the end of the text block. + // The solution should have been to reposition the caret. + // But repositioning the caret appears not to work. + // After repositioning the caret, the caret remains at the end of the text block. + //positionCaret (position); + //positionCaretDelayed (position) + //quill.setSelection (position, 0, "silent"); + } + return false; + } + // Redo. + if ((event.metaKey == true) && (event.shiftKey == true) && (event.key == 'z')) { + // Checking on 2020-11-26 the .redo() did not work. + quill.history.redo(); + return false; + } +} + + +/* + +Section for user interface updates and feedback. + +*/ + + +function editorStatus (text) +{ + $ ("#editorstatus").empty (); + $ ("#editorstatus").append (text); + editorSelectiveNotification (text); +} + + +function editorActiveStylesFeedback () +{ + var caret = getCaretPosition (); + if (caret == undefined) return; + var format = quill.getFormat (); + var paragraph = ""; + if (format.paragraph) paragraph = format.paragraph; + var character = ""; + if (format.character) character = format.character; + if (character.search ("note") >= 0) character = ""; + character = character.split ("0").join (" "); + var styles = paragraph + " " + character; + styles = styles.replace ("versebeam", ""); + var element = $ ("#activestyles"); + element.text (styles); +} + + +function editorSelectiveNotification (message) +{ + if (message == editorChapterLoaded) return; + if (message == editorChapterUpdating) return; + if (message == editorChapterUpdated) return; + if (message == editorWillSave) return; + if (message == editorChapterSaving) return; + if (message == editorChapterSaved) return; + if (message == "") return; + notifyItError (message); +} + + +/* + +Section for getting and setting the caret position. + +*/ + + +function getCaretPosition () +{ + var position = undefined; + var range = quill.getSelection(); + if (range) position = range.index; + return position; +} + + +var edit2PositionCaretDelayedTimerId; +var edit2PositionCaretValue; + + +function positionCaretDelayed (position) +{ + if (edit2PositionCaretDelayedTimerId) { + clearTimeout (edit2PositionCaretDelayedTimerId); + } + edit2PositionCaretValue = position; + edit2PositionCaretDelayedTimerId = setTimeout (positionCaretDelayedTimeout, 100); +} + + +function positionCaretDelayedTimeout () +{ + quill.setSelection (edit2PositionCaretValue, 0, "silent"); + //positionCaret (edit2PositionCaretValue); +} + + +function positionCaret (position) +{ + if (position == undefined) return; + var currentPosition = getCaretPosition (); + if (currentPosition == undefined) return; + position = parseInt (position); + if (position == currentPosition) return; + quill.setSelection (position, 0, "silent"); + editorActiveStylesFeedback (); +} + + +var edit2PositionCaretViaAjaxTimerId; + + +function edit2PositionCaretViaAjaxStop () +{ + if (edit2PositionCaretViaAjaxTimerId) { + clearTimeout (edit2PositionCaretViaAjaxTimerId); + } +} + +function edit2PositionCaretViaAjaxStart () +{ + edit2PositionCaretViaAjaxStop (); + // Very frequent positioning calls have been seen in some browsers, so they are filtered here. + edit2PositionCaretViaAjaxTimerId = setTimeout (edit2PositionCaretViaAjaxStartExecute, 100); +} + + +function edit2PositionCaretViaAjaxStartExecute () +{ + if (isNoVerseBook (editorLoadedBook)) return; + $.ajax ({ + url: "position", + type: "GET", + data: { bible: editorLoadedBible, book: editorLoadedBook, chapter: editorLoadedChapter }, + success: function (response) { + if (response != "") { + response = response.split ("\n"); + var start = response [0]; + var end = response [1]; + var offset = getCaretPosition (); + if ((offset < start) || (offset > end)) { + positionCaret (start); + } + edit2CaretInitialized = true; + } + editorScheduleWindowScrolling (); + }, + error: function (jqXHR, textStatus, errorThrown) { + // Network error: Reschedule. + editorScheduleCaretPositioning (); + } + }); +} + + +/* + + Section for highlighting the focused verse. + +*/ + + +var editorHighlightVerseNumberTimeoutId; + + +function editorHighlightVerseNumber () +{ + if (editorHighlightVerseNumberTimeoutId) clearTimeout (editorHighlightVerseNumberTimeoutId); + editorHighlightVerseNumberTimeoutId = setTimeout (editorHighlightVerseNumberExecute, 200); +} + + +function editorHighlightVerseNumberExecute () +{ + $ (".i-v").each (function (index) { + var element = $(this); + var verseNumber = element.text (); + if (verseNumber == editorNavigationVerse) { + element.addClass ("versebeam"); + } else { + element.removeClass ("versebeam"); + } + }); +} + + +/* + +Section for scrolling the caret into view. + +*/ + + +function editorScrollVerseIntoView () +{ + if (isNoVerseBook (editorLoadedBook)) return; + var position = getCaretPosition (); + if (position == undefined) return; + var bounds = quill.getBounds (position); + var workspaceHeight = $("#workspacewrapper").height(); + var currentScrollTop = $("#workspacewrapper").scrollTop(); + var scrollTo = bounds.top - (workspaceHeight * verticalCaretPosition / 100); + scrollTo = parseInt (scrollTo); + var lowerBoundary = currentScrollTop - (workspaceHeight / 10); + var upperBoundary = currentScrollTop + (workspaceHeight / 10); + if ((scrollTo < lowerBoundary) || (scrollTo > upperBoundary)) { + $("#workspacewrapper").animate({ scrollTop: scrollTo }, 500); + } +} + + +/* + +Section for the styles handling. + +*/ + + +function editorStylesButtonHandler () +{ + if (!editorWriteAccess) return; + $.ajax ({ + url: "../editor/style", + type: "GET", + cache: false, + success: function (response) { + editorShowResponse (response); + editorBindUnselectable (); + dynamicClickHandlers (); + }, + }); + return false; +} + + +function editorBindUnselectable () +{ + var elements = $ (".unselectable"); + elements.off ("mousedown"); + elements.on ("mousedown", function (event) { + event.preventDefault(); + }); +} + + +function editorShowResponse (response) +{ + if (!editorWriteAccess) return; + $ ("#stylebutton").hide (); + $ ("#nostyles").hide (); + var area = $ ("#stylesarea"); + area.empty (); + area.append (response); +} + + +function editorClearStyles () +{ + var area = $ ("#stylesarea"); + area.empty (); + $ ("#stylebutton").show (); + $ ("#nostyles").show (); +} + + +function dynamicClickHandlers () +{ + var elements = $ ("#stylesarea > a"); + elements.on ("click", function (event) { + event.preventDefault(); + editorClearStyles (); + //$ ("#editor").focus (); + var href = event.currentTarget.href; + href = href.substring (href.lastIndexOf ('/') + 1); + if (href == "cancel") return; + if (href == "all") { + displayAllStyles (); + } else { + requestStyle (href); + } + }); + + $ ("#styleslist").on ("change", function (event) { + var selection = $ ("#styleslist option:selected").text (); + var style = selection.substring (0, selection.indexOf (" ")); + event.preventDefault(); + editorClearStyles (); + //$ ("#editor").focus (); + requestStyle (style); + }); +} + + +function requestStyle (style) +{ + $.ajax ({ + url: "../editor/style", + type: "GET", + data: { style: style }, + cache: false, + success: function (response) { + response = response.split ("\n"); + var style = response [0]; + var action = response [1]; + if (action == "p") { + applyParagraphStyle (style); + } else if (action == 'c') { + applyCharacterStyle (style); + } else if (action == 'n') { + applyNotesStyle (style); + edit2ContentChanged (); + } else if (action == "m") { + applyMonoStyle (style); + edit2ContentChanged (); + } + }, + }); +} + + +function displayAllStyles () +{ + $.ajax ({ + url: "../editor/style", + type: "GET", + data: { all: "" }, + cache: false, + success: function (response) { + editorShowResponse (response); + editorBindUnselectable (); + dynamicClickHandlers (); + }, + }); +} + + +function applyParagraphStyle (style) +{ + if (!editorWriteAccess) return; + if (!quill.hasFocus ()) quill.focus (); + quill.format ("paragraph", style, "user"); + editorActiveStylesFeedback (); +} + + +function applyCharacterStyle (style) +{ + if (!editorWriteAccess) return; + if (!quill.hasFocus ()) quill.focus (); + // No formatting of a verse. + var range = quill.getSelection(); + if (range) { + for (i = range.index; i < range.index + range.length; i++) { + var format = quill.getFormat (i); + if (format.character && format.character == "v") { + return; + } + } + } + // Apply style. + var format = quill.getFormat (); + style = editor_determine_character_style (format.character, style) + quill.format ("character", style, "user"); + // Check on embedded style applied. + post_embedded_style_application (style); + // Feedback. + editorActiveStylesFeedback (); +} + + +function applyMonoStyle (style) +{ + if (!editorWriteAccess) return; + + quill.focus (); + + var caret = getCaretPosition (); + + var start = caret; + var text = quill.getText (start, 1); + if (text == "\n") caret--; + for (i = caret; i >= 0; i--) { + var text = quill.getText (i, 1); + if (text == "\n") break; + start = i; + } + + var end = caret; + for (i = caret; true; i++) { + end = i; + var text = quill.getText (i, 1); + if (text == "\n") break; + } + + text = quill.getText (start, end - start); + var char = text.substring (0, 1); + if (char == "\\") { + text = text.substring (1); + var pos = text.indexOf (' '); + text = text.substring (pos + 1); + } + text = "\\" + style + " " + text; + + quill.deleteText (start, end - start); + quill.insertText (start, text, "paragraph", "mono"); + + editorActiveStylesFeedback (); +} + + +/* + +Section for the notes. + +*/ + + +var editorInsertedNotesCount = 0; + + +function applyNotesStyle (style) +{ + if (!editorWriteAccess) return; + + quill.focus (); + + // Check for and optionally append the gap between text body and notes. + var notes = $ (".b-notes"); + if (notes.length == 0) { + var length = quill.getLength (); + quill.insertText (length, "\n", "paragraph", "notes", "user") + } + + // Get a new note identifier. + var date = new Date(); + var noteId = String (date.getTime()); + + var caller = String ((editorInsertedNotesCount % 9) + 1); + + // Insert note caller at caret. + var caret = getCaretPosition (); + quill.setSelection (caret, 0); + quill.insertText (caret, caller, "character", "notecall" + noteId, "user"); + + // Append note text to notes section. + assetsEditorAddNote (quill, style, caller, noteId, editorNavigationChapter, verseSeparator, editorNavigationVerse); + + editorInsertedNotesCount++; + + editorActiveStylesFeedback (); +} + + +function editorNoteCitationClicked (event) +{ + var target = $(event.target); + var cls = target.attr ("class"); + if (cls.substr (0, 6) != "i-note") return; + cls = cls.substr (2); + var length = quill.getLength (); + if (cls.search ("call") > 0) { + cls = cls.replace ("call", "body"); + // Start searching for note bodies at the end. + for (i = length; i >= 0; i--) { + var format = quill.getFormat (i, 1); + if (format.character && format.character == cls) { + quill.setSelection (i + 4, 0); + editorScrollVerseIntoView (); + editorActiveStylesFeedback (); + return; + } + } + } + if (cls.search ("body") > 0) { + cls = cls.replace ("body", "call"); + // Start searching for note callers at the start. + for (i = 0; i < length; i++) { + var format = quill.getFormat (i, 1); + if (format.character && format.character == cls) { + quill.setSelection (i + 1, 0); + editorScrollVerseIntoView (); + editorActiveStylesFeedback (); + return; + } + } + } +} + + +/* + +Caret positioning and subsequent window scrolling. + +The purpose of this section is to coordinate the two events, +so that caret positioning is done first, +and window scrolling last. + +*/ + + +var editorPositioningTimerId; +var editorPendingCaretPositioning = false; +var editorPendingWindowScrolling = false; + + +function editorScheduleCaretPositioning () +{ + editorPendingCaretPositioning = true; + editorPendingWindowScrolling = false; + editorPositioningTimerStart (); +} + + +function editorScheduleWindowScrolling () +{ + editorPendingWindowScrolling = true; + editorPositioningTimerStart (); +} + + +function editorPositioningTimerStart () +{ + if (editorPositioningTimerId) clearTimeout (editorPositioningTimerId); + editorPositioningTimerId = setTimeout (editorPositioningRun, 200); +} + + +function editorPositioningRun () +{ + if (editorPendingCaretPositioning) { + edit2PositionCaretViaAjaxStart (); + editorPendingCaretPositioning = false; + editorPendingWindowScrolling = false; + } + if (editorPendingWindowScrolling) { + editorPendingWindowScrolling = false; + editorScrollVerseIntoView (); + } +} + + + +// Debug + + + +function editorLog (msg) +{ + var date = new Date(); + var seconds = date.getSeconds(); + var milliseconds = date.getMilliseconds(); + console.log (seconds + " " + milliseconds + ": " + msg); +} + + +/* + + Section for swipe navigation. + + */ + + +function editorSwipeLeft (event) +{ + if (typeof navigateNextChapter != 'undefined') { + navigateNextChapter (event); + } else if (parent.window.navigateNextChapter != 'undefined') { + parent.window.navigateNextChapter (event); + } +} + + +function editorSwipeRight (event) +{ + if (typeof navigatePreviousChapter != 'undefined') { + navigatePreviousChapter (event); + } else if (parent.window.navigatePreviousChapter != 'undefined') { + parent.window.navigatePreviousChapter (event); + } +} + + +/* + +Section for reload notifications. + +*/ + + +function editorReloadAlert (message) +{ + // Take action only if the editor has focus and the user can type in it. + if (quill.hasFocus ()) { + notifyItSuccess (message) + quill.enable (false); + setTimeout (editorReloadAlertTimeout, 3000); + } +} + + +function editorReloadAlertTimeout () +{ + quill.enable (editorWriteAccess); + quill.focus (); +} + + + +/* + +Section for the coordinating timer. +This deals with the various events. +It monitors the ongoing AJAX actions for loading and updating and saving. +It decides which action to take. +It ensures that no two actions overlap or interfere with one another. +It also handles network latency, +by ensuring that the next call to the server +only occurs after the first call has been completed. +https://github.com/bibledit/cloud/issues/424 + +*/ + + +var edit2UpdateTrigger = false; +var edit2CaretMovedTrigger = false; +var edit2AjaxActive = false; +var edit2PollSelector = 0; +var edit2PollDate = new Date(); + + +function edit2CoordinatingTimeout () +{ + // Handle situation that an AJAX call is ongoing. + if (edit2AjaxActive) { + + } + else if (edit2CaretMovedTrigger) { + edit2CaretMovedTrigger = false; + edit2HandleCaretMoved (); + } + else if (edit2UpdateTrigger) { + edit2UpdateTrigger = false; + edit2UpdateExecute (); + } + // Handle situation that no process is ongoing. + // Now the regular pollers can run again. + else { + // There are two regular pollers. + // Wait 500 ms, then start one of the pollers. + // So each poller runs once a second. + var difference = new Date () - edit2PollDate; + if (difference > 500) { + edit2PollSelector++; + if (edit2PollSelector > 1) edit2PollSelector = 0; + if (edit2PollSelector == 0) { + edit2EditorPollId (); + } + if (edit2PollSelector == 1) { + + } + edit2PollDate = new Date(); + } + } + setTimeout (edit2CoordinatingTimeout, 100); +} + + + +/* + +Section for the smart editor updating logic. + +*/ + + +var editorHtmlAtStartOfUpdate = null; +var useShadowQuill = false; + + +function edit2UpdateExecute () +{ + // Determine whether the conditions for an editor update are all met. + var goodToGo = true; + if (!editorLoadedBible) goodToGo = false; + if (!editorLoadedBook) goodToGo = false; + if (!editorLoadedChapter) goodToGo = false; + if (!goodToGo) { + return; + } + + // Clear the editor's edits. + // The user can continue making changes in the editor. + // These changes get recorded. + edit2EditorChangeOffsets = []; + edit2EditorChangeInserts = []; + edit2EditorChangeDeletes = []; + + // A snapshot of the text originally loaded in the editor via AJAX. + var encodedLoadedHtml = filter_url_plus_to_tag (editorReferenceText); + + // A snapshot of the current editor text at this point of time. + editorHtmlAtStartOfUpdate = editorGetHtml(); + var encodedEditedHtml = filter_url_plus_to_tag (editorHtmlAtStartOfUpdate); + + // The editor "saves..." if there's changes, and "updates..." if there's no changes. + if (editorHtmlAtStartOfUpdate == editorReferenceText) { + editorStatus (editorChapterUpdating); + } else { + editorStatus (editorChapterSaving); + } + + var checksum1 = checksum_get (encodedLoadedHtml); + var checksum2 = checksum_get (encodedEditedHtml); + + edit2AjaxActive = true; + + $.ajax ({ + url: "update", + type: "POST", + async: true, + data: { bible: editorLoadedBible, book: editorLoadedBook, chapter: editorLoadedChapter, loaded: encodedLoadedHtml, edited: encodedEditedHtml, checksum1: checksum1, checksum2: checksum2, id: chapterEditorUniqueID }, + error: function (jqXHR, textStatus, errorThrown) { + editorStatus (editorChapterRetrying); + edit2ContentChanged (); + }, + success: function (response) { + + // Flag for editor read-write or read-only. + // Do not set the read-only status of the editor here. + // This is already set at text-load. + // It is also dependent on the frame number the editor is in. + // To not make it more complex than needed, leave read-only out. + var readwrite = checksum_readwrite (response); + + // Checksumming. + response = checksum_receive (response); + if (response !== false) { + + // Use a shadow copy of the Quill editor in case the user made edits + // between the moment the update routine was initiated, + // and the moment the updates from the server/device are being applied. + // This shadow copy will be updated with the uncorrected changes from the server/device. + // The html from this editor will then server as the "loaded text". + useShadowQuill = (edit2EditorChangeOffsets.length > 0); + if (useShadowQuill) startShadowQuill (editorHtmlAtStartOfUpdate); + + // Split the response into the separate bits. + var bits = []; + bits = response.split ("#_be_#"); + + // The first bit is the feedback message to the user. + editorStatus (bits.shift()); + + // The next bit is the new chapter identifier. + oneverseChapterId = bits.shift(); + + // Apply the remaining data, the differences, to the editor. + while (bits.length > 0) { + var position = parseInt (bits.shift ()); + var operator = bits.shift(); + // Position 0 in the incoming changes always refers to the initial new line in the editor. + // Do not insert or delete that new line, but just apply any formatting there. + if (position == 0) { + if (operator == "p") { + var style = bits.shift (); + quill.formatLine (0, 0, {"paragraph": style}, "silent"); + if (useShadowQuill) quill2.formatLine (0, 0, {"paragraph": style}, "silent"); + } + } else { + // The initial new line is not counted in Quill. + position--; + // The position for the shadow copy of Quill, if it's there. + var position2 = position; + // Handle the insert operation. + if (operator == "i") { + // Get the information. + var text = bits.shift (); + var style = bits.shift (); + var size = parseInt (bits.shift()); + // Correct the position + // and the positions stored during the update procedure's network latency. + position = oneverseUpdateIntermediateEdits (position, size, true, false); + // Handle the insert operation. + if (text == "\n") { + // New line. + quill.insertText (position, text, {}, "silent"); + if (useShadowQuill) quill2.insertText (position2, text, {}, "silent"); + quill.formatLine (position + 1, 1, {"paragraph": style}, "silent"); + if (useShadowQuill) quill2.formatLine (position2 + 1, 1, {"paragraph": style}, "silent"); + } else { + // Ordinary character: Insert formatted text. + quill.insertText (position, text, {"character": style}, "silent"); + if (useShadowQuill) quill2.insertText (position2, text, {"character": style}, "silent"); + } + } + // Handle delete operator. + else if (operator == "d") { + // Get the bits of information. + var size = parseInt (bits.shift()); + // Correct the position and the positions + // stored during the update procedure's network latency. + position = oneverseUpdateIntermediateEdits (position, size, false, true); + // Do the delete operation. + quill.deleteText (position, size, "silent"); + if (useShadowQuill) quill2.deleteText (position2, size, "silent"); + } + // Handle format paragraph operator. + else if (operator == "p") { + var style = bits.shift (); + quill.formatLine (position + 1, 1, {"paragraph": style}, "silent"); + if (useShadowQuill) quill2.formatLine (position2 + 1, 1, {"paragraph": style}, "silent"); + } + // Handle format character operator. + else if (operator == "c") { + var style = bits.shift (); + } + } + } + + } else { + // If the checksum is not valid, the response will become false. + // Checksum error. + editorStatus (editorChapterRetrying); + } + + // The browser may reformat the loaded html, so take the possible reformatted data for reference. + editorReferenceText = editorGetHtml (); + if (useShadowQuill) editorReferenceText = $ ("#edittemp > .ql-editor").html (); + $ ("#edittemp").empty (); + + // Create CSS for embedded styles. + css4embeddedstyles (); + }, + complete: function (xhr, status) { + edit2AjaxActive = false; + } + }); + +} + + +var quill2 = undefined; + + +function startShadowQuill (html) +{ + if (quill2) delete quill2; + $ ("#edittemp").empty (); + $ ("#edittemp").append (html); + quill2 = new Quill ('#edittemp', { }); +} + + +function oneverseUpdateIntermediateEdits (position, size, ins_op, del_op) +{ + // The offsets of the changes from the server/device are going to be corrected + // with the offsets of the edits made in the editor. + // This is to handle continued user-typing while the editor is being updated, + // Update, and get updated by, the edits made since the update operation began. + // UTF-16 characters 4 bytes long have a size of 2 in Javascript. + // So the routine takes care of that too. + var i; + for (i = 0; i < edit2EditorChangeOffsets.length; i++) { + // Any delete or insert at a lower offset or the same offset + // modifies the position where to apply the incoming edit from the server/device. + if (edit2EditorChangeOffsets[i] <= position) { + position += edit2EditorChangeInserts[i]; + position -= edit2EditorChangeDeletes[i] + } + // Any offset higher than the current position gets modified accordingly. + // If inserting at the current position, increase that offset. + // If deleting at the current position, decrease that offset. + if (edit2EditorChangeOffsets[i] > position) { + if (ins_op) edit2EditorChangeOffsets[i] += size; + if (del_op) edit2EditorChangeOffsets[i] -= size; + } + } + + return position +} + diff -Nru bibledit-5.0.912/edit2/keys.js bibledit-5.0.922/edit2/keys.js --- bibledit-5.0.912/edit2/keys.js 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/keys.js 2020-09-26 16:56:34.000000000 +0000 @@ -0,0 +1,74 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +// Returns true if the keypress can be ignored for triggering a content change. +function editKeysIgnoreForContentChange (event) +{ + if (event) { + // Escape. + if (event.keyCode == 27) return true; + // Modifiers. + if (editKeysModifierKeysPressed (event)) return true; + // Arrows. + if (event.keyCode == 37) return true; + if (event.keyCode == 38) return true; + if (event.keyCode == 39) return true; + if (event.keyCode == 40) return true; + } + return false; +} + + +// Returns true if the keypress can be ignored for triggering a caret change. +function editKeysIgnoreForCaretChange (event) +{ + if (event) { + // Ctrl-G. + if ((event.ctrlKey == true) && (event.keyCode == 71)) { + return true; + } + // Modifiers. + if (editKeysModifierKeysPressed (event)) return true; + // Work around the phenomenon that in some browsers it gives an extra key code 229. + if (event.keyCode == 229) return true; + // Alt-Up / Alt-Down. + if (event.altKey) { + if (event.keyCode == 38) return true; + if (event.keyCode == 40) return true; + } + } + return false; +} + + +// Returns true if any of the modifier keys are pressed. +function editKeysModifierKeysPressed (event) +{ + // Shift / Ctrl / Alt / Alt Gr / Win keys. + if (event.keyCode == 16) return true; + if (event.keyCode == 17) return true; + if (event.keyCode == 18) return true; + if (event.keyCode == 225) return true; + if (event.keyCode == 91) return true; + // Mac right cmd key. + if (event.keyCode == 93) return true; + // Caps lock. + if (event.keyCode == 20) return true; + return false; +} diff -Nru bibledit-5.0.912/edit2/load.cpp bibledit-5.0.922/edit2/load.cpp --- bibledit-5.0.912/edit2/load.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/load.cpp 2020-11-09 20:00:52.000000000 +0000 @@ -0,0 +1,84 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +string edit2_load_url () +{ + return "edit2/load"; +} + + +bool edit2_load_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return write; +} + + +string edit2_load (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + string bible = request->query ["bible"]; + int book = convert_to_int (request->query ["book"]); + int chapter = convert_to_int (request->query ["chapter"]); + string unique_id = request->query ["id"]; + + // Store a copy of the USFM loaded in the editor for later reference. + storeLoadedUsfm2 (webserver_request, bible, book, chapter, unique_id); + + string stylesheet = Database_Config_Bible::getEditorStylesheet (bible); + + string usfm = request->database_bibles()->getChapter (bible, book, chapter); + + Editor_Usfm2Html editor_usfm2html; + editor_usfm2html.load (usfm); + editor_usfm2html.stylesheet (stylesheet); + editor_usfm2html.run (); + + string html = editor_usfm2html.get (); + + // To make editing empty verses easier, convert spaces to non-breaking spaces, so they appear in the editor. + if (usfm_contains_empty_verses (usfm)) { + string search = " "; + string replace = "" + unicode_non_breaking_space_entity () + ""; + html = filter_string_str_replace (search, replace, html); + } + + string user = request->session_logic ()->currentUser (); + bool write = access_bible_book_write (webserver_request, user, bible, book); + + return Checksum_Logic::send (html, write); +} diff -Nru bibledit-5.0.912/edit2/load.h bibledit-5.0.922/edit2/load.h --- bibledit-5.0.912/edit2/load.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/load.h 2020-09-26 18:00:55.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDIT2_LOAD_H +#define INCLUDED_EDIT2_LOAD_H + + +#include + + +string edit2_load_url (); +bool edit2_load_acl (void * webserver_request); +string edit2_load (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/edit2/logic.cpp bibledit-5.0.922/edit2/logic.cpp --- bibledit-5.0.912/edit2/logic.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/logic.cpp 2020-09-26 18:00:55.000000000 +0000 @@ -0,0 +1,66 @@ +/* +Copyright (©) 2003-2020 Teus Benschop. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +#include +#include +#include +#include +#include + + +string edit2_logic_volatile_key (string bible, int book, int chapter, string editor) +{ + string key; + key.append (bible); + key.append (" "); + key.append (filter_string_fill (convert_to_string (book), 2, '0')); + key.append (" "); + key.append (filter_string_fill (convert_to_string (chapter), 3, '0')); + key.append (" "); + key.append (editor); + return key; +} + + +void storeLoadedUsfm2 (void * webserver_request, string bible, int book, int chapter, string editor, const char * message) +{ + (void) message; + + Webserver_Request * request = (Webserver_Request *) webserver_request; + + int userid = filter_string_user_identifier (webserver_request); + + string key = edit2_logic_volatile_key (bible, book, chapter, editor); + + string usfm = request->database_bibles ()->getChapter (bible, book, chapter); + + Database_Volatile::setValue (userid, key, usfm); +} + + +string getLoadedUsfm2 (void * webserver_request, string bible, int book, int chapter, string editor) +{ + int userid = filter_string_user_identifier (webserver_request); + + string key = edit2_logic_volatile_key (bible, book, chapter, editor); + + string usfm = Database_Volatile::getValue (userid, key); + + return usfm; +} diff -Nru bibledit-5.0.912/edit2/logic.h bibledit-5.0.922/edit2/logic.h --- bibledit-5.0.912/edit2/logic.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/logic.h 2020-09-26 17:57:08.000000000 +0000 @@ -0,0 +1,31 @@ +/* +Copyright (©) 2003-2020 Teus Benschop. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +#ifndef INCLUDED_EDIT2_LOGIC_H +#define INCLUDED_EDIT2_LOGIC_H + + +#include + + +void storeLoadedUsfm2 (void * webserver_request, string bible, int book, int chapter, string editor, const char * message = ""); +string getLoadedUsfm2 (void * webserver_request, string bible, int book, int chapter, string editor); + + +#endif diff -Nru bibledit-5.0.912/edit2/navigate.cpp bibledit-5.0.922/edit2/navigate.cpp --- bibledit-5.0.912/edit2/navigate.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/navigate.cpp 2020-11-09 20:00:52.000000000 +0000 @@ -0,0 +1,155 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +string edit2_navigate_url () +{ + return "edit2/navigate"; +} + + +bool edit2_navigate_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return write; +} + + +string edit2_navigate (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + + string bible = request->query ["bible"]; + int book = convert_to_int (request->query ["book"]); + int chapter = convert_to_int (request->query ["chapter"]); + + + // At first the browser used the rangy library to get the offset of the caret. + // But the rangy library provides the offset relative to the element that contains the caret, + // not relative to the main editor element. + // Therefore a pure Javascript implementation was Googled for and implemented. + // This provides the offset of the caret relative to the
. + size_t offset = convert_to_int (request->query ["offset"]); + + + string stylesheet = Database_Config_Bible::getEditorStylesheet (bible); + string usfm = request->database_bibles()->getChapter (bible, book, chapter); + + + Editor_Usfm2Html editor_usfm2html; + editor_usfm2html.load (usfm); + editor_usfm2html.stylesheet (stylesheet); + editor_usfm2html.run (); + + + // The caret offset should be in the main text body. + // If it is in a note body, skip the verse updating. + if (offset > editor_usfm2html.textLength) return ""; + + + // Get the number of verses in the USFM. + // This covers combined verses also. + int last_offset = 0; + vector verses = usfm_get_verse_numbers (usfm); + for (size_t i = 0; i < verses.size (); i++) { + if (editor_usfm2html.verseStartOffsets.count (i)) { + last_offset = editor_usfm2html.verseStartOffsets [i]; + } else { + editor_usfm2html.verseStartOffsets [i] = last_offset; + } + } + + + // Get the starting offsets for each verse. + vector starting_offsets; + for (size_t i = 0; i < verses.size (); i++) { + starting_offsets.push_back (editor_usfm2html.verseStartOffsets [i]); + } + starting_offsets.push_back (editor_usfm2html.textLength); + + + // Get the ending offsets for each verse. + vector ending_offsets; + for (size_t i = 0; i < verses.size (); i++) { + size_t offset = starting_offsets [i]; + for (size_t i2 = 0; i2 < starting_offsets.size (); i2++) { + if (starting_offsets [i2] > offset) { + offset = starting_offsets [i2]; + break; + } + } + ending_offsets.push_back (offset - 1); + } + + + // If the offset is between the focused verse's min and max values, then do nothing. + int verse = Ipc_Focus::getVerse (request); + for (size_t i = 0; i < verses.size (); i++) { + if (verse == verses[i]) { + if ((size_t) offset >= starting_offsets [i]) { + if ((size_t) offset <= ending_offsets [i]) { + return ""; + } + } + } + } + + + // Look for the verse that matches the offset. + verse = -1; + for (auto & element : editor_usfm2html.verseStartOffsets) { + int key = element.first; + size_t value = element.second; + if (offset >= value) { + // A verse number was found. + verse = key; + } + } + + + // Only act if a verse was found + if (verse >= 0) { + // Only update navigation in case the verse changed. + // This avoids unnecessary focus operations in the clients. + if (verse != Ipc_Focus::getVerse (request)) { + Ipc_Focus::set (request, book, chapter, verse); + } + // The editor should scroll the verse into view, + // because the caret is in the Bible text. + return convert_to_string (verse); + // If the caret were in the notes area, + // then the editor should not scroll the verse into view. + } + + + return ""; +} diff -Nru bibledit-5.0.912/edit2/navigate.h bibledit-5.0.922/edit2/navigate.h --- bibledit-5.0.912/edit2/navigate.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/navigate.h 2020-09-26 18:00:55.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDIT2_NAVIGATE_H +#define INCLUDED_EDIT2_NAVIGATE_H + + +#include + + +string edit2_navigate_url (); +bool edit2_navigate_acl (void * webserver_request); +string edit2_navigate (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/edit2/position.cpp bibledit-5.0.922/edit2/position.cpp --- bibledit-5.0.912/edit2/position.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/position.cpp 2020-11-09 20:00:52.000000000 +0000 @@ -0,0 +1,98 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +string edit2_position_url () +{ + return "edit2/position"; +} + + +bool edit2_position_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return write; +} + + +string edit2_position (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + + // Get Bible: If an empty Bible is given, bail out. + string bible = request->query ["bible"]; + if (bible.empty ()) return ""; + // Get book: If no book is given: Bail out. + int book = convert_to_int (request->query ["book"]); + if (!book) return ""; + // Get chapter. + int chapter = convert_to_int (request->query ["chapter"]); + + + string stylesheet = Database_Config_Bible::getEditorStylesheet (bible); + string usfm = request->database_bibles()->getChapter (bible, book, chapter); + int verse = Ipc_Focus::getVerse (request); + + + Editor_Usfm2Html editor_usfm2html; + editor_usfm2html.load (usfm); + editor_usfm2html.stylesheet (stylesheet); + editor_usfm2html.run (); + + int startingOffset = 0; + int endingOffset = 0; + // To deal with a combined verse, go through the offsets, and pick the correct one. + for (auto element : editor_usfm2html.verseStartOffsets) { + int vs = element.first; + int offset = element.second; + if (vs <= verse) startingOffset = offset; + if (endingOffset == 0) { + if (vs > verse) { + endingOffset = offset; + } + } + } + if (verse) { + startingOffset += convert_to_string (verse).length () + 1; + } + if (endingOffset) { + endingOffset--; + } else { + endingOffset = editor_usfm2html.textLength; + } + + string data = convert_to_string (startingOffset); + data.append ("\n"); + data.append (convert_to_string (endingOffset)); + + return data; +} diff -Nru bibledit-5.0.912/edit2/position.h bibledit-5.0.922/edit2/position.h --- bibledit-5.0.912/edit2/position.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/position.h 2020-09-26 18:00:55.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDIT2_POSITION_H +#define INCLUDED_EDIT2_POSITION_H + + +#include + + +string edit2_position_url (); +bool edit2_position_acl (void * webserver_request); +string edit2_position (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/edit2/preview.cpp bibledit-5.0.922/edit2/preview.cpp --- bibledit-5.0.912/edit2/preview.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/preview.cpp 2020-09-26 18:00:55.000000000 +0000 @@ -0,0 +1,117 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +string edit2_preview_url () +{ + return "edit2/preview"; +} + + +bool edit2_preview_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return read; +} + + +string edit2_preview (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + bool touch = request->session_logic ()->touchEnabled (); + bool timeout = request->query.count ("timeout"); + string caller = request->query ["caller"]; + + string page; + + Assets_Header header = Assets_Header (translate("Preview"), request); + header.setNavigator (); + header.setEditorStylesheet (); + if (touch) header.jQueryTouchOn (); + header.addBreadCrumb (menu_logic_translate_menu (), menu_logic_translate_text ()); + if (timeout) header.refresh (5, "../" + caller + "/index"); + page = header.run (); + + Assets_View view; + + // Get active Bible, and check read access to it. + // If needed, change Bible to one it has read access to. + string bible = access_bible_clamp (request, request->database_config_user()->getBible ()); + + string cls = Filter_Css::getClass (bible); + string font = Fonts_Logic::getTextFont (bible); + int direction = Database_Config_Bible::getTextDirection (bible); + int lineheight = Database_Config_Bible::getLineHeight (bible); + int letterspacing = Database_Config_Bible::getLetterSpacing (bible); + view.set_variable ("custom_class", cls); + view.set_variable ("custom_css", Filter_Css::getCss (cls, + Fonts_Logic::getFontPath (font), + direction, + lineheight, + letterspacing)); + + int book = Ipc_Focus::getBook (webserver_request); + int chapter = Ipc_Focus::getChapter (webserver_request); + + string stylesheet = Database_Config_Bible::getEditorStylesheet (bible); + + string usfm = request->database_bibles()->getChapter (bible, book, chapter); + + Editor_Usfm2Html editor_usfm2html; + editor_usfm2html.load (usfm); + editor_usfm2html.stylesheet (stylesheet); + editor_usfm2html.run (); + + string html = editor_usfm2html.get (); + view.set_variable ("html", html); + + if (timeout) { + view.enable_zone ("timeout"); + view.set_variable ("caller", caller); + } + + page += view.render ("edit", "preview"); + + page += Assets_Page::footer (); + + return page; +} diff -Nru bibledit-5.0.912/edit2/preview.h bibledit-5.0.922/edit2/preview.h --- bibledit-5.0.912/edit2/preview.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/preview.h 2020-09-26 18:00:55.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDIT2_PREVIEW_H +#define INCLUDED_EDIT2_PREVIEW_H + + +#include + + +string edit2_preview_url (); +bool edit2_preview_acl (void * webserver_request); +string edit2_preview (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/edit2/preview.html bibledit-5.0.922/edit2/preview.html --- bibledit-5.0.912/edit2/preview.html 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/preview.html 2020-09-26 16:56:34.000000000 +0000 @@ -0,0 +1,9 @@ + + + + +
##html##
+ + diff -Nru bibledit-5.0.912/edit2/preview.js bibledit-5.0.922/edit2/preview.js --- bibledit-5.0.912/edit2/preview.js 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/preview.js 2020-11-21 18:51:17.000000000 +0000 @@ -0,0 +1,133 @@ +/* +Copyright (©) 2003-2020 Teus Benschop. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +$ (document).ready (function () +{ + // Make the menu to never scroll out of view. + var bar = $ ("#editorheader").remove (); + $ ("#workspacemenu").append (bar); + + previewIdPollerTimeoutStart (); +}); + + +var previewNavigationBook; +var previewNavigationChapter; +var previewNavigationVerse; + + +function navigationNewPassage () +{ + if (typeof navigationBook != 'undefined') { + previewNavigationBook = navigationBook; + previewNavigationChapter = navigationChapter; + previewNavigationVerse = navigationVerse; + } else if (parent.window.navigationBook != 'undefined') { + previewNavigationBook = parent.window.navigationBook; + previewNavigationChapter = parent.window.navigationChapter; + previewNavigationVerse = parent.window.navigationVerse; + } else { + return; + } + + if ((previewNavigationBook != previewLoadedBook) || (previewNavigationChapter != previewLoadedChapter)) { + previewLoadChapter (); + } + + previewScrollVerseIntoView (); +} + + +var previewLoadedBible; +var previewLoadedBook; +var previewLoadedChapter; +var previewChapterInitialized = false; + + +function previewLoadChapter () +{ + previewLoadedBible = navigationBible; + previewLoadedBook = previewNavigationBook; + previewLoadedChapter = previewNavigationChapter; + previewChapterIdOnServer = 0; + if (previewChapterInitialized) location.reload (); + else previewChapterInitialized = true; +} + + +var previewChapterIdOnServer = 0; +var previewChapterIdPollerTimeoutId; + + +function previewIdPollerTimeoutStart () +{ + if (previewChapterIdPollerTimeoutId) clearTimeout (previewChapterIdPollerTimeoutId); + previewChapterIdPollerTimeoutId = setTimeout (editorEditorPollId, 1000); +} + + +function editorEditorPollId () +{ + $.ajax ({ + url: "../editor/id", + type: "GET", + data: { bible: previewLoadedBible, book: previewLoadedBook, chapter: previewLoadedChapter }, + success: function (response) { + if (previewChapterIdOnServer != 0) { + if (response != previewChapterIdOnServer) { + previewLoadChapter (); + previewChapterIdOnServer = 0; + } + } + previewChapterIdOnServer = response; + }, + complete: function (xhr, status) { + previewIdPollerTimeoutStart (); + } + }); +} + + +function previewScrollVerseIntoView () +{ + $ ("#workspacewrapper").stop (); + var verses = [0]; + var navigated = false; + $ (".v").each (function (index) { + var element = $(this); + verses = usfm_get_verse_numbers (element[0].textContent); + if (verses.indexOf (parseInt (previewNavigationVerse)) >= 0) { + if (navigated == false) { + var verseTop = element.offset().top; + var workspaceHeight = $("#workspacewrapper").height(); + var currentScrollTop = $("#workspacewrapper").scrollTop(); + var scrollTo = verseTop - (workspaceHeight / 2) + currentScrollTop; + var lowerBoundary = currentScrollTop - (workspaceHeight / 10); + var upperBoundary = currentScrollTop + (workspaceHeight / 10); + if ((scrollTo < lowerBoundary) || (scrollTo > upperBoundary)) { + $("#workspacewrapper").animate({ scrollTop: scrollTo }, 500); + } + navigated = true; + } + } + }); + if (editorNavigationVerse == 0) { + $ ("#workspacewrapper").animate ({ scrollTop: 0 }, 500); + } +} diff -Nru bibledit-5.0.912/edit2/save.cpp bibledit-5.0.922/edit2/save.cpp --- bibledit-5.0.912/edit2/save.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/save.cpp 2020-11-29 18:27:16.000000000 +0000 @@ -0,0 +1,205 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +string edit2_save_url () +{ + return "edit2/save"; +} + + +bool edit2_save_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return read; +} + + +string edit2_save (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + bool post_complete = (request->post.count ("bible") && request->post.count ("book") && request->post.count ("chapter") && request->post.count ("html") && request->post.count ("checksum")); + if (!post_complete) { + return translate("Insufficient information"); + } + + string bible = request->post["bible"]; + int book = convert_to_int (request->post["book"]); + int chapter = convert_to_int (request->post["chapter"]); + string html = request->post["html"]; + string checksum = request->post["checksum"]; + string unique_id = request->post ["id"]; + + if (Checksum_Logic::get (html) != checksum) { + request->response_code = 409; + return translate("Checksum error"); + } + + html = filter_url_tag_to_plus (html); + html = filter_string_trim (html); + + if (html.empty ()) { + Database_Logs::log (translate ("There was no text.") + " " + translate ("Nothing was saved.") + " " + translate ("The original text of the chapter was reloaded.")); + return translate("Nothing to save"); + } + + if (!unicode_string_is_valid (html)) { + Database_Logs::log ("The text was not valid Unicode UTF-8. The chapter could not saved and has been reverted to the last good version."); + return translate("Save failure"); + } + + if (!access_bible_book_write (request, "", bible, book)) { + return translate("No write access"); + } + + string stylesheet = Database_Config_Bible::getEditorStylesheet (bible); + + Editor_Html2Usfm editor_export; + editor_export.load (html); + editor_export.stylesheet (stylesheet); + editor_export.run (); + string user_usfm = editor_export.get (); + + string ancestor_usfm = getLoadedUsfm2 (webserver_request, bible, book, chapter, unique_id); + + vector book_chapter_text = usfm_import (user_usfm, stylesheet); + if (book_chapter_text.size () != 1) { + Database_Logs::log (translate ("User tried to save something different from exactly one chapter.")); + return translate("Incorrect chapter"); + } + + int book_number = book_chapter_text[0].book; + int chapter_number = book_chapter_text[0].chapter; + user_usfm = book_chapter_text[0].data; + bool chapter_ok = (((book_number == book) || (book_number == 0)) && (chapter_number == chapter)); + if (!chapter_ok) { + return translate("Incorrect chapter") + " " + convert_to_string (chapter_number); + } + + // Collect some data about the changes for this user + // and for a possible merge of the user's data with the server's data. + string username = request->session_logic()->currentUser (); + int oldID = request->database_bibles()->getChapterId (bible, book, chapter); + string server_usfm = request->database_bibles()->getChapter (bible, book, chapter); + string newText = user_usfm; + string oldText = ancestor_usfm; + + // Safekeep the USFM to save for later. + string change = user_usfm; + + // Merge if the ancestor is there and differs from what's in the database. + vector conflicts; + if (!ancestor_usfm.empty ()) { + if (server_usfm != ancestor_usfm) { + // Prioritize the user's USFM. + user_usfm = filter_merge_run (ancestor_usfm, server_usfm, user_usfm, true, conflicts); + Database_Logs::log (translate ("Merging chapter.")); + } + } + + // Check on the merge. + bible_logic_merge_irregularity_mail ({username}, conflicts); + + // Check whether the USFM on disk has changed compared to the USFM that was loaded in the editor. + // If there's a difference, email the user. + // Although a merge was done, still, it's good to alert the user on this. + // The rationale is that if Bible text was saved through Send/receive, + // or if another user saved Bible text, + // it's worth to check on this. + // Because the user's editor may not yet have loaded this updated Bible text. + // https://github.com/bibledit/cloud/issues/340 + if (ancestor_usfm != server_usfm) { + bible_logic_recent_save_email (bible, book, chapter, 0, username, ancestor_usfm, server_usfm); + } + + // Safely store the chapter. + string explanation; + string message = usfm_safely_store_chapter (request, bible, book, chapter, user_usfm, explanation); + bible_logic_unsafe_save_mail (message, explanation, username, user_usfm); + + if (!message.empty ()) return message; + + // In server configuration, store details for the user's changes. +#ifndef HAVE_CLIENT + int newID = request->database_bibles()->getChapterId (bible, book, chapter); + Database_Modifications database_modifications; + database_modifications.recordUserSave (username, bible, book, chapter, oldID, oldText, newID, newText); + if (sendreceive_git_repository_linked (bible)) { + Database_Git::store_chapter (username, bible, book, chapter, oldText, newText); + } + rss_logic_schedule_update (username, bible, book, chapter, oldText, newText); +#else + (void) oldID; +#endif + + // Store a copy of the USFM loaded in the editor for later reference. + storeLoadedUsfm2 (webserver_request, bible, book, chapter, unique_id); + + // Convert the stored USFM to html. + // This converted html should be the same as the saved html. + // If it differs, signal the browser to reload the chapter. + // This also cares for renumbering and cleaning up any added or removed footnotes. + Editor_Usfm2Html editor_usfm2html; + editor_usfm2html.load (user_usfm); + editor_usfm2html.stylesheet (stylesheet); + editor_usfm2html.run (); + string converted_html = editor_usfm2html.get (); + // Convert to XML for comparison. + // Remove spaces before comparing, so that entering a space in the editor does not cause a reload. + html = html2xml (html); + html = filter_string_str_replace (" ", "", html); + html = filter_string_str_replace (unicode_non_breaking_space_entity (), "", html); + filter_string_replace_between (html, "<", ">", ""); + converted_html = html2xml (converted_html); + converted_html = filter_string_str_replace (" ", "", converted_html); + converted_html = filter_string_str_replace (unicode_non_breaking_space_entity (), "", converted_html); + filter_string_replace_between (converted_html, "<", ">", ""); + // If round trip conversion differs, send a known string to the browser, + // to signal the browser to reload the reformatted chapter. + if (html != converted_html) return locale_logic_text_reformat (); + + return locale_logic_text_saved (); +} diff -Nru bibledit-5.0.912/edit2/save.h bibledit-5.0.922/edit2/save.h --- bibledit-5.0.912/edit2/save.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/save.h 2020-09-26 18:00:55.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDIT2_SAVE_H +#define INCLUDED_EDIT2_SAVE_H + + +#include + + +string edit2_save_url (); +bool edit2_save_acl (void * webserver_request); +string edit2_save (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/edit2/update.cpp bibledit-5.0.922/edit2/update.cpp --- bibledit-5.0.912/edit2/update.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/update.cpp 2020-11-29 12:08:42.000000000 +0000 @@ -0,0 +1,396 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +string edit2_update_url () +{ + return "edit2/update"; +} + + +bool edit2_update_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return read; +} + + +string edit2_update (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + + // Whether the update is good to go. + bool good2go = true; + + + // The messages to return. + vector messages; + + + // Check the relevant bits of information. + if (good2go) { + bool parameters_ok = true; + if (!request->post.count ("bible")) parameters_ok = false; + if (!request->post.count ("book")) parameters_ok = false; + if (!request->post.count ("chapter")) parameters_ok = false; + if (!request->post.count ("loaded")) parameters_ok = false; + if (!request->post.count ("edited")) parameters_ok = false; + if (!parameters_ok) { + messages.push_back (translate("Don't know what to update")); + good2go = false; + } + } + + + // Get the relevant bits of information. + string bible; + int book = 0; + int chapter = 0; + string loaded_html; + string edited_html; + string checksum1; + string checksum2; + string unique_id; + if (good2go) { + bible = request->post["bible"]; + book = convert_to_int (request->post["book"]); + chapter = convert_to_int (request->post["chapter"]); + loaded_html = request->post["loaded"]; + edited_html = request->post["edited"]; + checksum1 = request->post["checksum1"]; + checksum2 = request->post["checksum2"]; + unique_id = request->post ["id"]; + } + + + // Checksums of the loaded and edited html. + if (good2go) { + if (Checksum_Logic::get (loaded_html) != checksum1) { + request->response_code = 409; + messages.push_back (translate ("Checksum error")); + good2go = false; + } + } + if (good2go) { + if (Checksum_Logic::get (edited_html) != checksum2) { + request->response_code = 409; + messages.push_back (translate ("Checksum error")); + good2go = false; + } + } + + + // Decode html encoded in javascript, and clean it. + loaded_html = filter_url_tag_to_plus (loaded_html); + edited_html = filter_url_tag_to_plus (edited_html); + loaded_html = filter_string_trim (loaded_html); + edited_html = filter_string_trim (edited_html); + + + // Check on valid UTF-8. + if (good2go) { + if (!unicode_string_is_valid (loaded_html) || !unicode_string_is_valid (edited_html)) { + messages.push_back (translate ("Cannot update: Needs Unicode")); + good2go = false; + } + } + + + bool bible_write_access = false; + if (good2go) { + bible_write_access = access_bible_book_write (request, "", bible, book); + } + + + string stylesheet; + if (good2go) stylesheet = Database_Config_Bible::getEditorStylesheet (bible); + + + // Collect some data about the changes for this user. + string username = request->session_logic()->currentUser (); +#ifdef HAVE_CLOUD + int oldID = 0; + if (good2go) oldID = request->database_bibles()->getChapterId (bible, book, chapter); +#endif + string old_chapter_usfm; + if (good2go) old_chapter_usfm = request->database_bibles()->getChapter (bible, book, chapter); + + + // Determine what version of USFM to save to the chapter. + // Later in the code, it will do a three-way merge, to obtain that USFM. + // This needs the loaded USFM as the ancestor, + // the edited USFM as a change-set, + // and the existing USFM as a prioritized change-set. + string loaded_chapter_usfm; + if (good2go) { + Editor_Html2Usfm editor_export; + editor_export.load (loaded_html); + editor_export.stylesheet (stylesheet); + editor_export.run (); + loaded_chapter_usfm = editor_export.get (); + } + string edited_chapter_usfm; + if (good2go) { + Editor_Html2Usfm editor_export; + editor_export.load (edited_html); + editor_export.stylesheet (stylesheet); + editor_export.run (); + edited_chapter_usfm = editor_export.get (); + } + string existing_chapter_usfm = filter_string_trim (old_chapter_usfm); + + + // Check that the edited USFM contains no more than, and exactly like, + // the book and chapter that was loaded in the editor. + if (good2go && bible_write_access) { + vector book_chapter_text = usfm_import (edited_chapter_usfm, stylesheet); + if (book_chapter_text.size () != 1) { + Database_Logs::log (translate ("A user tried to save something different from exactly one chapter")); + messages.push_back (translate("Incorrect chapter")); + } + int book_number = book_chapter_text[0].book; + int chapter_number = book_chapter_text[0].chapter; + edited_chapter_usfm = book_chapter_text[0].data; + bool chapter_ok = (((book_number == book) || (book_number == 0)) && (chapter_number == chapter)); + if (!chapter_ok) { + messages.push_back (translate("Incorrect chapter") + " " + convert_to_string (chapter_number)); + } + } + + + // Set a flag if there is a reason to save the editor text, since it was edited. + // This is important because the same routine is used for saving the editor text + // as well as updating the editor text. + // So if the text in the editor was not changed, it should not save it, + // as saving the editor text would overwrite saves made by other(s). + bool text_was_edited = (loaded_chapter_usfm != edited_chapter_usfm); + + + // Do a three-way merge if needed. + // There's a need for this if there were user-edits, + // and if the USFM on the server differs from the USFM loaded in the editor. + // The three-way merge reconciles those differences. + if (good2go && bible_write_access && text_was_edited) { + if (loaded_chapter_usfm != existing_chapter_usfm) { + vector conflicts; + // Do a merge while giving priority to the USFM already in the chapter. + string merged_chapter_usfm = filter_merge_run (loaded_chapter_usfm, edited_chapter_usfm, existing_chapter_usfm, true, conflicts); + // Mail the user if there is a merge anomaly. + bible_logic_optional_merge_irregularity_email (bible, book, chapter, username, loaded_chapter_usfm, edited_chapter_usfm, merged_chapter_usfm); + bible_logic_merge_irregularity_mail ({username}, conflicts); + // Let the merged data now become the edited data (so it gets saved properly). + edited_chapter_usfm = merged_chapter_usfm; + } + } + + + // Check whether the USFM on disk has changed compared to the USFM that was loaded in the editor. + // If there's a difference, email the user. + // Although a merge was done, still, it's good to alert the user on this. + // The rationale is that if Bible text was saved through Send/receive, + // or if another user saved Bible text, + // it's worth to check on this. + // Because the user's editor may not yet have loaded this updated Bible text. + // https://github.com/bibledit/cloud/issues/340 + // The above is no longer needed since the chapter editor does no longer "load" text. + // Instead of loading text, the existing text gets updated. + // The message below will no longer be given. + // It might cause confusion more than it clarifies. + //if (good2go && bible_write_access && text_was_edited) { + //if (loaded_chapter_usfm != existing_chapter_usfm) { + //bible_logic_recent_save_email (bible, book, chapter, 0, username, loaded_chapter_usfm, existing_chapter_usfm); + //} + //} + + + // Safely store the chapter. + string explanation; + string message; + if (good2go && bible_write_access && text_was_edited) { + message = usfm_safely_store_chapter (request, bible, book, chapter, edited_chapter_usfm, explanation); + bible_logic_unsafe_save_mail (message, explanation, username, edited_chapter_usfm); + if (!message.empty ()) messages.push_back (message); + } + + + // The new chapter identifier and new chapter USFM. + int newID = request->database_bibles()->getChapterId (bible, book, chapter); + string new_chapter_usfm; + if (good2go) { + new_chapter_usfm = request->database_bibles()->getChapter (bible, book, chapter); + } + + + if (good2go && bible_write_access && text_was_edited) { + // If storing the chapter worked out well, there's no message to display. + if (message.empty ()) { +#ifdef HAVE_CLOUD + // The Cloud stores details of the user's changes. + Database_Modifications database_modifications; + database_modifications.recordUserSave (username, bible, book, chapter, oldID, old_chapter_usfm, newID, new_chapter_usfm); + if (sendreceive_git_repository_linked (bible)) { + Database_Git::store_chapter (username, bible, book, chapter, old_chapter_usfm, new_chapter_usfm); + } + rss_logic_schedule_update (username, bible, book, chapter, old_chapter_usfm, new_chapter_usfm); +#endif + // Feedback to user. + messages.push_back (locale_logic_text_saved ()); + } else { + // Feedback about anomaly to user. + messages.push_back (message); + } + } + + + // If there's no message at all, return at least something to the editor. + if (messages.empty ()) messages.push_back (locale_logic_text_saved ()); + + + // The response to send to back to the editor. + string response; + string separator = "#_be_#"; + // The response starts with the save message(s) if any. + // The message(s) contain information about save success or failure. + // Send it to the browser for display to the user. + response.append (filter_string_implode (messages, " | ")); + + + // Add separator and the new chapter identifier to the response. + response.append (separator); + response.append (convert_to_string (newID)); + + + // The main purpose of the following block of code is this: + // To send the differences between what the editor has now and what the server has now. + // The purpose of sending the differences to the editor is this: + // The editor can update its contents, so the editor will have what the server has. + // This is the format to send the changes in: + // insert - position - text - format + // delete - position + if (good2go) { + // Determine the server's current chapter content, and the editor's current chapter content. + string editor_html (edited_html); + string server_html; + { + Editor_Usfm2Html editor_usfm2html; + editor_usfm2html.load (new_chapter_usfm); + editor_usfm2html.stylesheet (stylesheet); + editor_usfm2html.run (); + server_html = editor_usfm2html.get (); + } + vector positions; + vector sizes; + vector operators; + vector content; + bible_logic_html_to_editor_updates (editor_html, server_html, positions, sizes, operators, content); + // Encode the condensed differences for the response to the Javascript editor. + for (size_t i = 0; i < positions.size(); i++) { + response.append ("#_be_#"); + response.append (convert_to_string (positions[i])); + response.append ("#_be_#"); + string operation = operators[i]; + response.append (operation); + if (operation == bible_logic_insert_operator ()) { + string text = content[i]; + string character = unicode_string_substr (text, 0, 1); + response.append ("#_be_#"); + response.append (character); + size_t length = unicode_string_length (text); + string format = unicode_string_substr (text, 1, length - 1); + response.append ("#_be_#"); + response.append (format); + // Also add the size of the character in UTF-16 format, 2-bytes or 4 bytes, as size 1 or 2. + response.append ("#_be_#"); + response.append (convert_to_string (sizes[i])); + } + else if (operation == bible_logic_delete_operator ()) { + // When deleting a UTF-16 character encoded in 4 bytes, + // then the size in Quilljs is 2 instead of 1. + // So always give the size when deleting a character. + response.append ("#_be_#"); + response.append (convert_to_string (sizes[i])); + } + else if (operation == bible_logic_format_paragraph_operator ()) { + response.append ("#_be_#"); + response.append (content[i]); + } + else if (operation == bible_logic_format_character_operator ()) { + response.append ("#_be_#"); + response.append (content[i]); + } + } + } + + // Things to try out in the C++ and Javacript update routines. + + // Test changing the format of the first paragraph. + + // Test changing the format of the second paragraph. + + // Test changing the format of the last paragraph. + + // Test deleting an entire paragraph. + + // Test adding a character to a formatted word, to see if the character format gets transferred properly. + + // Test that if this editor is the second or higher one in a workspace, + // it is read-only. And updating the editor's contents does not grab focus. + + // Test inserting and updating 4-byte UTF-16 characters like the 😀. + + // Test continued typing during serious network latency. + + // Test using the Cloud together with client devices with send and receive. + + bool write = access_bible_book_write (webserver_request, username, bible, book); + response = Checksum_Logic::send (response, write); + + // Ready. + //this_thread::sleep_for(chrono::seconds(5)); + return response; +} diff -Nru bibledit-5.0.912/edit2/update.h bibledit-5.0.922/edit2/update.h --- bibledit-5.0.912/edit2/update.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/edit2/update.h 2020-11-25 06:29:41.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDIT2_UPDATE_H +#define INCLUDED_EDIT2_UPDATE_H + + +#include + + +string edit2_update_url (); +bool edit2_update_acl (void * webserver_request); +string edit2_update (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/editone/index.cpp bibledit-5.0.922/editone/index.cpp --- bibledit-5.0.912/editone/index.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editone/index.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,155 +0,0 @@ -/* - Copyright (©) 2003-2020 Teus Benschop. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -string editone_index_url () -{ - return "editone/index"; -} - - -bool editone_index_acl (void * webserver_request) -{ - if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; - bool read, write; - access_a_bible (webserver_request, read, write); - return read; -} - - -string editone_index (void * webserver_request) -{ - Webserver_Request * request = (Webserver_Request *) webserver_request; - - bool touch = request->session_logic ()->touchEnabled (); - - if (request->query.count ("switchbook") && request->query.count ("switchchapter")) { - int switchbook = convert_to_int (request->query ["switchbook"]); - int switchchapter = convert_to_int (request->query ["switchchapter"]); - Ipc_Focus::set (request, switchbook, switchchapter, 1); - Navigation_Passage::recordHistory (request, switchbook, switchchapter, 1); - } - - string page; - - Assets_Header header = Assets_Header (translate("Edit verse"), request); - header.setNavigator (); - header.setEditorStylesheet (); - if (touch) header.jQueryTouchOn (); - header.notifItOn (); - header.addBreadCrumb (menu_logic_translate_menu (), menu_logic_translate_text ()); - page = header.run (); - - Assets_View view; - - if (request->query.count ("changebible")) { - string changebible = request->query ["changebible"]; - if (changebible == "") { - Dialog_List dialog_list = Dialog_List ("index", translate("Select which Bible to open in the editor"), "", ""); - vector bibles = access_bible_bibles (request); - for (auto bible : bibles) { - dialog_list.add_row (bible, "changebible", bible); - } - page += dialog_list.run (); - return page; - } else { - request->database_config_user()->setBible (changebible); - } - } - - // Get active Bible, and check read access to it. - // If needed, change Bible to one it has read access to. - string bible = access_bible_clamp (request, request->database_config_user()->getBible ()); - if (request->query.count ("bible")) bible = access_bible_clamp (request, request->query ["bible"]); - view.set_variable ("bible", bible); - - // Store the active Bible in the page's javascript. - view.set_variable ("navigationCode", Navigation_Passage::code (bible)); - - int verticalCaretPosition = request->database_config_user ()->getVerticalCaretPosition (); - string script = - "var oneverseEditorVerseLoaded = '" + locale_logic_text_loaded () + "';\n" - "var oneverseEditorWillSave = '" + locale_logic_text_will_save () + "';\n" - "var oneverseEditorVerseSaving = '" + locale_logic_text_saving () + "';\n" - "var oneverseEditorVerseSaved = '" + locale_logic_text_saved () + "';\n" - "var oneverseEditorVerseRetrying = '" + locale_logic_text_retrying () + "';\n" - "var oneverseEditorVerseUpdatedLoaded = '" + locale_logic_text_reload () + "';\n" - "var verticalCaretPosition = " + convert_to_string (verticalCaretPosition) + ";\n" - "var verseSeparator = '" + Database_Config_General::getNotesVerseSeparator () + "';\n"; - config_logic_swipe_enabled (webserver_request, script); - view.set_variable ("script", script); - - string cls = Filter_Css::getClass (bible); - string font = Fonts_Logic::getTextFont (bible); - int direction = Database_Config_Bible::getTextDirection (bible); - int lineheight = Database_Config_Bible::getLineHeight (bible); - int letterspacing = Database_Config_Bible::getLetterSpacing (bible); - view.set_variable ("custom_class", cls); - view.set_variable ("custom_css", Filter_Css::getCss (cls, - Fonts_Logic::getFontPath (font), - direction, - lineheight, - letterspacing)); - - // Whether to enable fast Bible editor switching. - if (request->database_config_user ()->getFastEditorSwitchingAvailable ()) { - view.enable_zone ("fastswitcheditor"); - } - - // Whether to enable the styles button. - if (request->database_config_user ()->getEnableStylesButtonVisualEditors ()) { - view.enable_zone ("stylesbutton"); - } - - page += view.render ("editone", "index"); - - page += Assets_Page::footer (); - - return page; -} - -// Tests for the editor: -// * Autosave on going to another passage. -// * Autosave on document unload. -// * Autosave shortly after any change. -// * Save the + sign of a note. -// * No loss of white space right after the verse number. diff -Nru bibledit-5.0.912/editone/index.h bibledit-5.0.922/editone/index.h --- bibledit-5.0.912/editone/index.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editone/index.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - Copyright (©) 2003-2020 Teus Benschop. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - -#ifndef INCLUDED_EDITONE_INDEX_H -#define INCLUDED_EDITONE_INDEX_H - - -#include - - -string editone_index_url (); -bool editone_index_acl (void * webserver_request); -string editone_index (void * webserver_request); - - -#endif diff -Nru bibledit-5.0.912/editone/index.html bibledit-5.0.922/editone/index.html --- bibledit-5.0.912/editone/index.html 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editone/index.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ - -
-
- - - - - - - | - ##bible## - | - - - | - translate ("editor") - - | - translate ("preview") - -
-
-
-
-
- - - - - - - - - -##navigationCode## diff -Nru bibledit-5.0.912/editone/index.js bibledit-5.0.922/editone/index.js --- bibledit-5.0.912/editone/index.js 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editone/index.js 1970-01-01 00:00:00.000000000 +0000 @@ -1,958 +0,0 @@ -/* -Copyright (©) 2003-2020 Teus Benschop. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - - -var quill = undefined; -var Delta = Quill.import ("delta"); -var verseEditorUniqueID = Math.floor (Math.random() * 100000000); - - -$ (document).ready (function () -{ - // Make the editor's menu to never scroll out of view. - var bar = $ ("#editorheader").remove (); - $ ("#workspacemenu").append (bar); - - visualVerseEditorInitializeOnce (); - visualVerseEditorInitializeLoad (); - - navigationNewPassage (); - - $ (window).on ("unload", oneverseEditorUnload); - - oneverseIdPollerOn (); - - oneverseBindUnselectable (); - - $ ("#stylebutton").on ("click", oneverseStylesButtonHandler); - - $ (window).on ("keydown", oneverseWindowKeyHandler); - - if (swipe_operations) { - $ ("body").swipe ( { - swipeLeft:function (event, direction, distance, duration, fingerCount, fingerData) { - oneverseSwipeLeft (event); - }, - swipeRight:function (event, direction, distance, duration, fingerCount, fingerData) { - oneverseSwipeRight (event); - } - }); - } - - $ ("#oneeditor").on ("click", oneEditorNoteCitationClicked); - -}); - - -function visualVerseEditorInitializeOnce () -{ - var Parchment = Quill.import ('parchment'); - - // Register block formatting class. - var ParagraphClass = new Parchment.Attributor.Class ('paragraph', 'b', { scope: Parchment.Scope.BLOCK }); - Quill.register (ParagraphClass, true); - - // Register inline formatting class. - var CharacterClass = new Parchment.Attributor.Class ('character', 'i', { scope: Parchment.Scope.INLINE }); - Quill.register (CharacterClass, true); -} - - -function visualVerseEditorInitializeLoad () -{ - // Work around https://github.com/quilljs/quill/issues/1116 - // It sets the margins to 0 by adding an overriding class. - // The Quill editor will remove that class again. - $ ("#oneeditor > p").each (function (index) { - var element = $(this); - element.addClass ("nomargins"); - }); - - // Instantiate editor. - quill = new Quill ('#oneeditor', { }); - - // Cause it to paste plain text only. - quill.clipboard.addMatcher (Node.ELEMENT_NODE, function (node, delta) { - var plaintext = $ (node).text (); - return new Delta().insert (plaintext); - }); - - if (oneverseEditorWriteAccess) if (!quill.hasFocus ()) quill.focus (); - - // Event handlers. - quill.on ("text-change", visualVerseEditorTextChangeHandler); - quill.on ("selection-change", visualVerseEditorSelectionChangeHandler); -} - - -var oneverseBible; -var oneverseBook; -var oneverseNavigationBook; -var oneverseChapter; -var oneverseNavigationChapter; -var oneverseVerse; -var oneverseNavigationVerse; -var oneverseVerseLoading; -var oneverseVerseLoaded; -var oneverseEditorChangedTimeout; -var oneverseLoadedText; -var oneverseIdChapter = 0; -var oneverseReloadCozChanged = false; -var oneverseReloadCozError = false; -var oneverseReloadPosition = undefined; -var oneverseEditorTextChanged = false; -var oneverseSaveAsync; -var oneverseLoadAjaxRequest; -var oneverseSaving = false; -var oneverseEditorWriteAccess = true; -var oneverseEditorLoadDate = new Date(0); -var oneverseEditorSaveDate = new Date(0); - - -// -// -// Section for the new Passage event from the Navigator. -// -// - - -function navigationNewPassage () -{ - if (typeof navigationBook != 'undefined') { - oneverseNavigationBook = navigationBook; - oneverseNavigationChapter = navigationChapter; - oneverseNavigationVerse = navigationVerse; - } else if (parent.window.navigationBook != 'undefined') { - oneverseNavigationBook = parent.window.navigationBook; - oneverseNavigationChapter = parent.window.navigationChapter; - oneverseNavigationVerse = parent.window.navigationVerse; - } else { - return; - } - - //if ((oneverseNavigationBook != oneverseBook) || (oneverseNavigationChapter != oneverseChapter)) { - //} - // Fixed: Reload text message when switching to another chapter. - // https://github.com/bibledit/cloud/issues/408 - // Going to another verse, it also resets the editor save timer, - // and the chapter identifier poller. - oneverseIdPollerOff (); - oneverseEditorSaveDate = new Date(0); - oneverseEditorSaveVerse (true); - oneverseEditorSaveDate = new Date(0); - oneverseReloadCozChanged = false; - oneverseReloadCozError = false; - oneverseEditorLoadVerse (); - oneverseIdPollerOn (); -} - - -// -// -// Section for editor load and save. -// -// - - -function oneverseEditorLoadVerse () -{ - if ((oneverseNavigationBook != oneverseBook) || (oneverseNavigationChapter != oneverseChapter) || (oneverseNavigationVerse != oneverseVerse) || oneverseReloadCozChanged || oneverseReloadCozError ) { - oneverseBible = navigationBible; - oneverseBook = oneverseNavigationBook; - oneverseChapter = oneverseNavigationChapter; - oneverseVerse = oneverseNavigationVerse; - oneverseVerseLoading = oneverseNavigationVerse; - oneverseIdChapter = 0; - if (oneverseReloadCozChanged) { - oneverseReloadPosition = oneverseCaretPosition (); - } else { - oneverseReloadPosition = undefined; - // When saving and immediately going to another verse, do not give an alert. - oneverseEditorSaveDate = new Date(0); - } - if (oneverseLoadAjaxRequest && oneverseLoadAjaxRequest.readystate != 4) { - oneverseLoadAjaxRequest.abort(); - } - oneverseLoadAjaxRequest = $.ajax ({ - url: "load", - type: "GET", - data: { bible: oneverseBible, book: oneverseBook, chapter: oneverseChapter, verse: oneverseVerseLoading, id: verseEditorUniqueID }, - success: function (response) { - // Flag for editor read-write or read-only. - oneverseEditorWriteAccess = checksum_readwrite (response); - // If this is the second or third or higher editor in the workspace, - // make the editor read-only. - if (window.frameElement) { - iframe = $(window.frameElement); - var data_editor_number = iframe.attr("data-editor-no"); - if (data_editor_number > 1) { - oneverseEditorWriteAccess = false; - } - } - // Checksumming. - response = checksum_receive (response); - // Splitting. - var bits; - if (response !== false) { - bits = response.split ("#_be_#"); - if (bits.length != 3) response == false; - } - if (response !== false) { - $ ("#oneprefix").empty (); - $ ("#oneprefix").append (bits [0]); - $ ("#oneprefix").off ("click"); - $ ("#oneprefix").on ("click", oneVerseHtmlClicked); - } - if (response !== false) { - // Destroy existing editor. - if (quill) delete quill; - // Load the html in the DOM. - $ ("#oneeditor").empty (); - $ ("#oneeditor").append (bits [1]); - oneverseVerseLoaded = oneverseVerseLoading; - oneverseEditorStatus (oneverseEditorVerseLoaded); - // Create the editor based on the DOM's content. - visualVerseEditorInitializeLoad (); - quill.enable (oneverseEditorWriteAccess); - // The browser may reformat the loaded html, so take the possible reformatted data for reference. - oneverseLoadedText = $ (".ql-editor").html (); - oneverseCaretMovedTimeoutStart (); - // Create CSS for embedded styles. - css4embeddedstyles (); - } - if (response !== false) { - $ ("#onesuffix").empty (); - $ ("#onesuffix").append (bits [2]); - $ ("#onesuffix").off ("click"); - $ ("#onesuffix").on ("click", oneVerseHtmlClicked); - } - if (response !== false) { - oneverseScrollVerseIntoView (); - oneversePositionCaret (); - // https://github.com/bibledit/cloud/issues/346 - oneverseEditorLoadDate = new Date(); - // In case of network error, don't keep showing the notification. - if (!oneverseReloadCozError) { - var seconds = oneverseEditorLoadDate.getTime() - oneverseEditorSaveDate.getTime() / 1000; - if ((seconds < 2) | oneverseReloadCozChanged) { - console.log ("seconds", seconds, "flag", oneverseReloadCozChanged); - if (oneverseEditorWriteAccess) oneverseReloadAlert (oneverseEditorVerseUpdatedLoaded); - } - } - oneverseReloadCozChanged = false; - oneverseReloadCozError = false; - } - if (response === false) { - // Checksum or other error: Reload. - oneverseReloadCozError = true; - oneverseEditorLoadVerse (); - } - }, - }); - } -} - - -function oneverseEditorUnload () -{ - oneverseEditorSaveVerse (true); -} - - -function oneverseEditorSaveVerse (sync) -{ - if (oneverseSaving) { - oneverseEditorChanged (); - return; - } - if (!oneverseEditorWriteAccess) return; - oneverseEditorTextChanged = false; - if (!oneverseBible) return; - if (!oneverseBook) return; - if (!oneverseVerseLoaded) return; - var html = $ (".ql-editor").html (); - if (html == oneverseLoadedText) return; - oneverseEditorStatus (oneverseEditorVerseSaving); - - // Chapter identifier poller off as network latency may lead to problems if left on. - oneverseIdPollerOff (); - - oneverseLoadedText = html; - oneverseIdChapter = 0; - oneverseSaveAsync = true; - if (sync) oneverseSaveAsync = false; - var encodedHtml = filter_url_plus_to_tag (html); - var checksum = checksum_get (encodedHtml); - oneverseSaving = true; - $.ajax ({ - url: "save", - type: "POST", - async: oneverseSaveAsync, - data: { bible: oneverseBible, book: oneverseBook, chapter: oneverseChapter, verse: oneverseVerseLoaded, html: encodedHtml, checksum: checksum, id: verseEditorUniqueID }, - error: function (jqXHR, textStatus, errorThrown) { - oneverseEditorStatus (oneverseEditorVerseRetrying); - oneverseLoadedText = ""; - oneverseEditorChanged (); - if (!oneverseSaveAsync) oneverseEditorSaveVerse (true); - }, - success: function (response) { - oneverseEditorStatus (response); - }, - complete: function (xhr, status) { - oneverseSaveAsync = true; - oneverseSaving = false; - oneverseEditorSaveDate = new Date(); - oneverseIdPollerOn (); - } - }); -} - - -// -// -// Portion dealing with triggers for editor's content change. -// -// - - -// Arguments: delta: Delta, oldContents: Delta, source: String -function visualVerseEditorTextChangeHandler (delta, oldContents, source) -{ - // Ensure that it does not delete a chapter number or verse number. - if (!delta.ops [0].retain) { - quill.history.undo (); - } - // Start save delay timer. - oneverseEditorChanged (); -} - - -function oneverseEditorChanged () -{ - if (!oneverseEditorWriteAccess) return; - oneverseEditorTextChanged = true; - oneverseEditorStatus (oneverseEditorWillSave); - if (oneverseEditorChangedTimeout) { - clearTimeout (oneverseEditorChangedTimeout); - } - oneverseEditorChangedTimeout = setTimeout (oneverseEditorSaveVerse, 1000); -} - - -// -// -// Section for user interface updates and feedback. -// -// - - -function oneverseEditorStatus (text) -{ - $ ("#onestatus").empty (); - $ ("#onestatus").append (text); - oneverseEditorSelectiveNotification (text); -} - - -function oneverseActiveStylesFeedback () -{ - var format = quill.getFormat (); - var paragraph = "..."; - if (format.paragraph) paragraph = format.paragraph; - var character = ""; - if (format.character) character = format.character; - if (character.search ("note") >= 0) character = ""; - character = character.split ("0").join (" "); - var styles = paragraph + " " + character; - var element = $ ("#oneverseactivestyles"); - element.text (styles); -} - - -function oneverseEditorSelectiveNotification (message) -{ - if (message == oneverseEditorVerseLoaded) return; - if (message == oneverseEditorWillSave) return; - if (message == oneverseEditorVerseSaving) return; - if (message == oneverseEditorVerseSaved) return; - notifyItError (message); -} - - -// -// -// Section for polling the server for updates on the loaded chapter. -// -// - - -var oneverseIdTimeout; -var oneverseIdAjaxRequest; - - -function oneverseIdPollerOff () -{ - if (oneverseIdTimeout) { - clearTimeout (oneverseIdTimeout); - } - if (oneverseIdAjaxRequest && oneverseIdAjaxRequest.readystate != 4) { - oneverseIdAjaxRequest.abort(); - } -} - - -function oneverseIdPollerOn () -{ - oneverseIdPollerOff (); - oneverseIdTimeout = setTimeout (oneverseEditorPollId, 1000); -} - - -function oneverseEditorPollId () -{ - // Due to network latency, there may be multiple ongoing polls. - // Multiple polls may return multiple chapter identifiers. - // This could lead to false "text reloaded" notifications. - // https://github.com/bibledit/cloud/issues/424 - // To handle this, switch the poller off. - oneverseIdPollerOff (); - - if (oneverseSaving) { - oneverseIdPollerOn (); - return; - } - oneverseIdAjaxRequest = $.ajax ({ - url: "../edit/id", - type: "GET", - data: { bible: oneverseBible, book: oneverseBook, chapter: oneverseChapter }, - cache: false, - success: function (response) { - if (oneverseIdChapter != 0) { - if (response != oneverseIdChapter) { - if (oneverseEditorTextChanged) { - oneverseEditorSaveVerse (true); - } - oneverseReloadCozChanged = true; - oneverseEditorLoadVerse (); - oneverseIdChapter = 0; - } - } - oneverseIdChapter = response; - }, - error: function (jqXHR, textStatus, errorThrown) { - }, - complete: function (xhr, status) { - if (status != "abort") { - oneverseIdPollerOn (); - } - } - }); -} - - -// -// -// Section for getting and setting the caret position. -// -// - - -function oneverseCaretPosition () -{ - var position = undefined; - var range = quill.getSelection(); - if (range) position = range.index; - return position; -} - - -function oneversePositionCaret () -{ - setTimeout (oneversePositionCaretTimeout, 100); -} - - -function oneversePositionCaretTimeout () -{ - var position; - if (oneverseReloadPosition != undefined) { - position = oneverseReloadPosition; - oneverseReloadPosition = undefined; - } else { - position = 1 + oneverseVerse.length; - } - quill.setSelection (position, 0, "silent"); -} - - -// -// -// Section for scrolling the editable portion into the center. -// -// - - -function oneverseScrollVerseIntoView () -{ - $("#workspacewrapper").stop(); - var verseTop = $("#oneeditor").offset().top; - var workspaceHeight = $("#workspacewrapper").height(); - var currentScrollTop = $("#workspacewrapper").scrollTop(); - var scrollTo = verseTop - (workspaceHeight * verticalCaretPosition / 100) + currentScrollTop; - var lowerBoundary = currentScrollTop - (workspaceHeight / 10); - var upperBoundary = currentScrollTop + (workspaceHeight / 10); - if ((scrollTo < lowerBoundary) || (scrollTo > upperBoundary)) { - $("#workspacewrapper").animate({ scrollTop: scrollTo }, 500); - } -} - - -// -// -// Section for the styles handling. -// -// - - -function oneverseStylesButtonHandler () -{ - if (!oneverseEditorWriteAccess) return; - $.ajax ({ - url: "../edit/styles", - type: "GET", - cache: false, - success: function (response) { - oneverseShowResponse (response); - oneverseBindUnselectable (); - oneverseDynamicClickHandlers (); - }, - }); - return false; -} - - -function oneverseBindUnselectable () -{ - var elements = $ (".unselectable"); - elements.off ("mousedown"); - elements.on ("mousedown", function (event) { - event.preventDefault(); - }); -} - - -function oneverseShowResponse (response) -{ - if (!oneverseEditorWriteAccess) return; - $ ("#stylebutton").hide (); - $ ("#nostyles").hide (); - var area = $ ("#stylesarea"); - area.empty (); - area.append (response); -} - - -function oneverseClearStyles () -{ - var area = $ ("#stylesarea"); - area.empty (); - $ ("#stylebutton").show (); - $ ("#nostyles").show (); -} - - -function oneverseDynamicClickHandlers () -{ - var elements = $ ("#stylesarea > a"); - elements.on ("click", function (event) { - event.preventDefault(); - oneverseClearStyles (); - var href = event.currentTarget.href; - href = href.substring (href.lastIndexOf ('/') + 1); - if (href == "cancel") return; - if (href == "all") { - oneverseDisplayAllStyles (); - } else { - oneverseRequestStyle (href); - } - }); - - $ ("#styleslist").on ("change", function (event) { - var selection = $ ("#styleslist option:selected").text (); - var style = selection.substring (0, selection.indexOf (" ")); - event.preventDefault(); - oneverseClearStyles (); - oneverseRequestStyle (style); - }); -} - - -function oneverseRequestStyle (style) -{ - $.ajax ({ - url: "../edit/styles", - type: "GET", - data: { style: style }, - cache: false, - success: function (response) { - response = response.split ("\n"); - var style = response [0]; - var action = response [1]; - if (action == "p") { - oneverseApplyParagraphStyle (style); - } else if (action == 'c') { - oneverseApplyCharacterStyle (style); - } else if (action == 'n') { - oneverseApplyNotesStyle (style); - } else if (action == "m") { - oneverseApplyMonoStyle (style); - } - }, - }); -} - - -function oneverseDisplayAllStyles () -{ - $.ajax ({ - url: "../edit/styles", - type: "GET", - data: { all: "" }, - cache: false, - success: function (response) { - oneverseShowResponse (response); - oneverseBindUnselectable (); - oneverseDynamicClickHandlers (); - }, - }); -} - - -function oneverseApplyParagraphStyle (style) -{ - if (!oneverseEditorWriteAccess) return; - if (!quill.hasFocus ()) quill.focus (); - quill.format ("paragraph", style, "user"); - oneverseActiveStylesFeedback (); -} - - -function oneverseApplyCharacterStyle (style) -{ - if (!oneverseEditorWriteAccess) return; - if (!quill.hasFocus ()) quill.focus (); - // No formatting of a verse. - var range = quill.getSelection(); - if (range) { - for (i = range.index; i < range.index + range.length; i++) { - var format = quill.getFormat (i); - if (format.character && format.character == "v") { - return; - } - } - } - // Apply style. - var format = quill.getFormat (); - style = editor_determine_character_style (format.character, style) - quill.format ("character", style, "user"); - // Deal with embedded character styles. - post_embedded_style_application (style); - // Feedback. - oneverseActiveStylesFeedback (); -} - - -function oneverseApplyMonoStyle (style) -{ - if (!oneverseEditorWriteAccess) return; - - quill.focus (); - - var range = quill.getSelection(); - var caret = range.index; - - var start = caret; - var text = quill.getText (start, 1); - if (text == "\n") caret--; - for (i = caret; i >= 0; i--) { - var text = quill.getText (i, 1); - if (text == "\n") break; - start = i; - } - - var end = caret; - for (i = caret; true; i++) { - end = i; - var text = quill.getText (i, 1); - if (text == "\n") break; - } - - text = quill.getText (start, end - start); - var char = text.substring (0, 1); - if (char == "\\") { - text = text.substring (1); - var pos = text.indexOf (' '); - text = text.substring (pos + 1); - } - text = "\\" + style + " " + text; - - quill.deleteText (start, end - start); - quill.insertText (start, text, "paragraph", "mono"); - - oneverseActiveStylesFeedback (); -} - - -// -// -// Section with window events and their basic handlers. -// -// - - -function oneverseWindowKeyHandler (event) -{ - if (!oneverseEditorWriteAccess) return; - // Ctrl-S: Style. - if ((event.ctrlKey == true) && (event.keyCode == 83)) { - oneverseStylesButtonHandler (); - return false; - } - // Escape. - if (event.keyCode == 27) { - oneverseClearStyles (); - } -} - - -// -// -// Section responding to a moved caret. -// -// - - -// Responds to a changed selection or caret. -// range: { index: Number, length: Number } -// oldRange: { index: Number, length: Number } -// source: String -function visualVerseEditorSelectionChangeHandler (range, oldRange, source) -{ - // Bail out if editor not focused. - if (!range) return; - - // Bail out if text was selected. - if (range.length != 0) return; - - oneverseCaretMovedTimeoutStart (); -} - - -var oneverseCaretMovedTimeoutId; - - -function oneverseCaretMovedTimeoutStart () -{ - if (oneverseCaretMovedTimeoutId) clearTimeout (oneverseCaretMovedTimeoutId); - oneverseCaretMovedTimeoutId = setTimeout (oneverseActiveStylesFeedback, 200); -} - - -// -// -// Section for the notes. -// -// - - -var oneverseInsertedNotesCount = 0; - - -function oneverseApplyNotesStyle (style) -{ - if (!oneverseEditorWriteAccess) return; - - quill.focus (); - - // Check for and optionally append the gap between text body and notes. - var notes = $ (".b-notes"); - if (notes.length == 0) { - var length = quill.getLength (); - quill.insertText (length, "\n", "paragraph", "notes", "user") - } - - // Get a new node identifier based on the local time. - var date = new Date(); - var noteId = String (date.getTime()); - - var caller = String ((oneverseInsertedNotesCount % 9) + 1); - - // Insert note caller at caret. - var range = quill.getSelection(); - var caret = range.index; - quill.setSelection (caret, 0); - quill.insertText (caret, caller, "character", "notecall" + noteId, "user"); - - // Append note text to notes section. - assetsEditorAddNote (quill, style, caller, noteId, oneverseNavigationChapter, verseSeparator, oneverseNavigationVerse); - - oneverseInsertedNotesCount++; - - oneverseActiveStylesFeedback (); -} - - -function oneEditorNoteCitationClicked (event) -{ - var target = $(event.target); - var cls = target.attr ("class"); - if (cls.substr (0, 6) != "i-note") return; - cls = cls.substr (2); - var length = quill.getLength (); - if (cls.search ("call") > 0) { - cls = cls.replace ("call", "body"); - // Start searching for note bodies at the end. - for (i = length; i >= 0; i--) { - var format = quill.getFormat (i, 1); - if (format.character && format.character == cls) { - quill.setSelection (i + 4, 0); - oneverseActiveStylesFeedback (); - return; - } - } - } - if (cls.search ("body") > 0) { - cls = cls.replace ("body", "call"); - // Start searching for note callers at the start. - for (i = 0; i < length; i++) { - var format = quill.getFormat (i, 1); - if (format.character && format.character == cls) { - quill.setSelection (i + 1, 0); - oneverseActiveStylesFeedback (); - return; - } - } - } -} - - -// -// -// Section for navigating to another passage. -// -// - - -function oneVerseHtmlClicked (event) -{ - // If the user selects text, do nothing. - var text = ""; - if (window.getSelection) { - text = window.getSelection().toString(); - } else if (document.selection && document.selection.type != "Control") { - text = document.selection.createRange().text; - } - if (text.length) return; - - var verse = ""; - - var iterations = 0; - var target = $(event.target); - var tagName = target.prop("tagName"); - if (tagName == "P") target = $ (target.children ().last ()); - while ((iterations < 10) && (!target.hasClass ("v"))) { - var previous = $(target.prev ()); - if (previous.length == 0) { - target = $ (target.parent ().prev ()); - target = $ (target.children ().last ()); - } else { - target = previous; - } - iterations++; - } - - // Too many iterations: Undefined location. - if (iterations >= 10) return - - if (target.length == 0) verse = "0"; - - if (target.hasClass ("v")) { - verse = target[0].innerText; - } - - $.ajax ({ - url: "verse", - type: "GET", - data: { verse: verse }, - cache: false - }); -} - - -// -// -// Section for swipe navigation. -// -// - - -function oneverseSwipeLeft (event) -{ - if (typeof navigateNextVerse != 'undefined') { - navigateNextVerse (event); - } else if (parent.window.navigateNextVerse != 'undefined') { - parent.window.navigateNextVerse (event); - } -} - - -function oneverseSwipeRight (event) -{ - if (typeof navigatePreviousVerse != 'undefined') { - navigatePreviousVerse (event); - } else if (parent.window.navigatePreviousVerse != 'undefined') { - parent.window.navigatePreviousVerse (event); - } -} - - -/* - -Section for reload notifications. - -*/ - - -function oneverseReloadAlert (message) -{ - // Take action only if the editor has focus and the user can type in it. - if (!quill.hasFocus ()) return; - // Do the notification stuff. - notifyItSuccess (message) - quill.enable (false); - setTimeout (oneverseReloadAlertTimeout, 3000); -} - - -function oneverseReloadAlertTimeout () -{ - quill.enable (oneverseEditorWriteAccess); - quill.focus (); -} - - diff -Nru bibledit-5.0.912/editone/load.cpp bibledit-5.0.922/editone/load.cpp --- bibledit-5.0.912/editone/load.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editone/load.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,127 +0,0 @@ -/* - Copyright (©) 2003-2020 Teus Benschop. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -using namespace pugi; - - -string editone_load_url () -{ - return "editone/load"; -} - - -bool editone_load_acl (void * webserver_request) -{ - if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; - bool read, write; - access_a_bible (webserver_request, read, write); - return read; -} - - -string editone_load (void * webserver_request) -{ - Webserver_Request * request = (Webserver_Request *) webserver_request; - - string bible = request->query ["bible"]; - int book = convert_to_int (request->query ["book"]); - int chapter = convert_to_int (request->query ["chapter"]); - int verse = convert_to_int (request->query ["verse"]); - string unique_id = request->query ["id"]; - - string stylesheet = Database_Config_Bible::getEditorStylesheet (bible); - - string chapter_usfm = request->database_bibles()->getChapter (bible, book, chapter); - - vector verses = usfm_get_verse_numbers (chapter_usfm); - int highest_verse = 0; - if (!verses.empty ()) highest_verse = verses.back (); - - // The Quill-based editor removes empty paragraphs at the end. - // Therefore it does not include them. - string editable_usfm = usfm_get_verse_text_quill (chapter_usfm, verse); - - string prefix_usfm = usfm_get_verse_range_text (chapter_usfm, 0, verse - 1, editable_usfm, true); - string suffix_usfm = usfm_get_verse_range_text (chapter_usfm, verse + 1, highest_verse, editable_usfm, true); - - // Store a copy of the USFM loaded in the editor for later reference. - // Note that this verse editor has been tested that it uses the correct sequence - // while storing this snapshot. - // When the user goes to another verse in the editor, the system follows this sequence: - // 1. It saves the edited text in the current verse. - // 2. It updates the chapter snapshot. - // 3. It loads the other verse. - // 4. It updates the chapter snapshot. - storeLoadedUsfm (webserver_request, bible, book, chapter, unique_id); - - string prefix_html; - string not_used; - editone_logic_prefix_html (prefix_usfm, stylesheet, prefix_html, not_used); - - // The focused editable verse also has any footnotes contained in that verse. - // It is convenient to have the footnote as near as possible to the verse text. - // This is helpful for editing the verse and note. - string focused_verse_html; - editone_logic_editable_html (editable_usfm, stylesheet, focused_verse_html); - - string suffix_html; - editone_logic_suffix_html ("", suffix_usfm, stylesheet, suffix_html); - - // If the verse was empty, ensure that it has a non-breaking space as the last character, - // for easier text entry in the verse. - string plain_text = filter_string_html2text (focused_verse_html); - plain_text = filter_string_trim (plain_text); - string vs = convert_to_string (verse); - bool editable_verse_is_empty = plain_text == vs; - if (editable_verse_is_empty) { - string search = "

"; - string replace = "" + unicode_non_breaking_space_entity () + "

"; - focused_verse_html = filter_string_str_replace (search, replace, focused_verse_html); - } - - // Moves any notes from the prefix to the suffix. - editone_logic_move_notes (prefix_html, suffix_html); - - string data; - data.append (prefix_html); - data.append ("#_be_#"); - data.append (focused_verse_html); - data.append ("#_be_#"); - data.append (suffix_html); - - string user = request->session_logic ()->currentUser (); - bool write = access_bible_book_write (webserver_request, user, bible, book); - data = Checksum_Logic::send (data, write); - - return data; -} diff -Nru bibledit-5.0.912/editone/load.h bibledit-5.0.922/editone/load.h --- bibledit-5.0.912/editone/load.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editone/load.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - Copyright (©) 2003-2020 Teus Benschop. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - -#ifndef INCLUDED_EDITONE_LOAD_H -#define INCLUDED_EDITONE_LOAD_H - - -#include - - -string editone_load_url (); -bool editone_load_acl (void * webserver_request); -string editone_load (void * webserver_request); - - -#endif diff -Nru bibledit-5.0.912/editone/logic.cpp bibledit-5.0.922/editone/logic.cpp --- bibledit-5.0.912/editone/logic.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editone/logic.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,193 +0,0 @@ -/* -Copyright (©) 2003-2020 Teus Benschop. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - - -#include -#include -#include -#include -#include - - -void editone_logic_prefix_html (string usfm, string stylesheet, string & html, string & last_p_style) -{ - if (!usfm.empty ()) { - Editor_Usfm2Html editor_usfm2html; - editor_usfm2html.load (usfm); - editor_usfm2html.stylesheet (stylesheet); - editor_usfm2html.run (); - html = editor_usfm2html.get (); - // No identical id's in the same DOM. - html = filter_string_str_replace (" id=\"notes\"", " id=\"prefixnotes\"", html); - // The last paragraph style in this USFM fragment, the prefix to the editable fragment. - // If the last paragraph has any content in it, - // for correct visual representation of the editable fragment, that follows this, - // clear that style. - last_p_style = editor_usfm2html.currentParagraphStyle; - if (!editor_usfm2html.currentParagraphContent.empty ()) last_p_style.clear (); - } -} - - -void editone_logic_editable_html (string usfm, string stylesheet, string & html) -{ - if (!usfm.empty ()) { - Editor_Usfm2Html editor_usfm2html; - editor_usfm2html.load (usfm); - editor_usfm2html.stylesheet (stylesheet); - editor_usfm2html.quill (); - editor_usfm2html.run (); - html = editor_usfm2html.get (); - } -} - - -void editone_logic_suffix_html (string editable_last_p_style, string usfm, string stylesheet, string & html) -{ - if (!usfm.empty ()) { - Editor_Usfm2Html editor_usfm2html; - editor_usfm2html.load (usfm); - editor_usfm2html.stylesheet (stylesheet); - editor_usfm2html.run (); - html = editor_usfm2html.get (); - // No identical id in the same DOM. - html = filter_string_str_replace (" id=\"notes\"", " id=\"suffixnotes\"", html); - } - - // If the first paragraph of the suffix does not have a paragraph style applied, - // apply the last paragraph style of the focused verse to the first paragraph of the suffix. - // For example, html like this: - //

7 For Yahweh knows the way of the righteous,

but the way of the wicked shall perish.

- // ... will become like this: - //

7For Yahweh knows the way of the righteous,

but the way of the wicked shall perish.

- if (!html.empty ()) { - if (!editable_last_p_style.empty ()) { - xml_document document; - html = html2xml (html); - document.load_string (html.c_str(), parse_ws_pcdata_single); - xml_node p_node = document.first_child (); - string p_style = p_node.attribute ("class").value (); - if (p_style.empty ()) { - p_node.append_attribute ("class") = editable_last_p_style.c_str (); - } - stringstream output; - document.print (output, "", format_raw); - html = output.str (); - } - } -} - - -string editone_logic_html_to_usfm (string stylesheet, string html) -{ - // It used to convert XML entities to normal characters. - // For example, it used to convert "<" to "<". - // But doing this too early in the conversion chain led to the following problem: - // The XML parser was taking the "<" character as part of an XML element. - // It than didn't find the closing ">" marker, and then complained about parsing errors. - // And it dropped whatever followed the "<" marker. - // So it now no longer unescapes the XML special characters this early in the chain. - // It does it much later now, before saving the USFM that the converter produces. - - // Convert special spaces to normal ones. - html = any_space_to_standard_space (html); - - // Convert the html back to USFM in the special way for editing one verse. - string usfm = editor_export_verse_quill (stylesheet, html); - - // Done. - return usfm; -} - - -// Move the notes from the $prefix to the $suffix. -void editone_logic_move_notes (string & prefix, string & suffix) -{ - // No input: Ready. - if (prefix.empty ()) return; - - // Do a html to xml conversion to avoid a mismatched tag error. - prefix = html2xml (prefix); - - // Load the prefix. - xml_document document; - document.load_string (prefix.c_str(), parse_ws_pcdata_single); - - // If there's any notes, it should be at the end. - xml_node div_node = document.last_child (); - string id = div_node.attribute ("id").value (); - - // No note(s): Ready. - if (id != "prefixnotes") return; - - // Get the note(s) leaving out the surrounding data. - string notes_text; - for (xml_node child : div_node.children ()) { - if (strcmp (child.name (), "p") != 0) continue; - stringstream ss; - child.print (ss, "", format_raw); - string note = ss.str (); - notes_text.append (note); - } - - // Remove the note(s) from the prefix. - document.remove_child (div_node); - { - stringstream ss; - document.print (ss, "", format_raw); - prefix = ss.str (); - } - - // Do a html to xml conversion to avoid a mismatched tag error. - suffix = html2xml (suffix); - - // Load the suffix. - document.load_string (suffix.c_str(), parse_ws_pcdata_single); - - // If there's any notes, it should be at the end. - div_node = document.last_child (); - id = div_node.attribute ("id").value (); - - // If there's no notes container, add it. - if (id.empty ()) { - div_node = document.append_child ("div"); - div_node.append_attribute ("id") = "suffixnotes"; - div_node.append_child ("hr"); - } - - // Contain the prefix's notes and add them to the suffix's notes container. - notes_text.insert (0, "
"); - notes_text.append ("
"); - div_node.append_buffer (notes_text.c_str (), notes_text.size ()); - - // Put the notes in the correct order, if needed. - if (!id.empty ()) { - xml_node hr_node = div_node.first_child (); - xml_node new_node = div_node.last_child (); - div_node.insert_move_after (new_node, hr_node); - } - - // Convert the DOM to suffix text. - { - stringstream ss; - document.print (ss, "", format_raw); - suffix = ss.str (); - } -} - - diff -Nru bibledit-5.0.912/editone/logic.h bibledit-5.0.922/editone/logic.h --- bibledit-5.0.912/editone/logic.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editone/logic.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -/* -Copyright (©) 2003-2020 Teus Benschop. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - - -#ifndef INCLUDED_EDITONE_LOGIC_H -#define INCLUDED_EDITONE_LOGIC_H - - -#include - - -void editone_logic_prefix_html (string usfm, string stylesheet, string & html, string & last_p_style); -void editone_logic_editable_html (string usfm, string stylesheet, string & html); -void editone_logic_suffix_html (string editable_last_p_style, string usfm, string stylesheet, string & html); -string editone_logic_html_to_usfm (string stylesheet, string html); -void editone_logic_move_notes (string & prefix, string & suffix); - - -#endif diff -Nru bibledit-5.0.912/editone/save.cpp bibledit-5.0.922/editone/save.cpp --- bibledit-5.0.912/editone/save.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editone/save.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,176 +0,0 @@ -/* - Copyright (©) 2003-2020 Teus Benschop. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -string editone_save_url () -{ - return "editone/save"; -} - - -bool editone_save_acl (void * webserver_request) -{ - if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; - bool read, write; - access_a_bible (webserver_request, read, write); - return read; -} - - -string editone_save (void * webserver_request) -{ - Webserver_Request * request = (Webserver_Request *) webserver_request; - - - // Check on information about where to save the verse. - bool save = (request->post.count ("bible") && request->post.count ("book") && request->post.count ("chapter") && request->post.count ("verse") && request->post.count ("html")); - if (!save) { - return translate("Don't know where to save"); - } - - - string bible = request->post["bible"]; - int book = convert_to_int (request->post["book"]); - int chapter = convert_to_int (request->post["chapter"]); - int verse = convert_to_int (request->post["verse"]); - string html = request->post["html"]; - string checksum = request->post["checksum"]; - string unique_id = request->post ["id"]; - - - // Checksum. - if (Checksum_Logic::get (html) != checksum) { - request->response_code = 409; - return translate ("Checksum error"); - } - - - // Decode html encoded in javascript. - html = filter_url_tag_to_plus (html); - - - // Check there's anything to save at all. - html = filter_string_trim (html); - if (html.empty ()) { - return translate ("Nothing to save"); - } - - - // Check on valid UTF-8. - if (!unicode_string_is_valid (html)) { - return translate ("Cannot save: Needs Unicode"); - } - - - if (!access_bible_book_write (request, "", bible, book)) { - return translate ("No write access"); - } - - - string stylesheet = Database_Config_Bible::getEditorStylesheet (bible); - - - string verse_usfm = editone_logic_html_to_usfm (stylesheet, html); - - - // Collect some data about the changes for this user. - string username = request->session_logic()->currentUser (); -#ifdef HAVE_CLOUD - int oldID = request->database_bibles()->getChapterId (bible, book, chapter); -#endif - string old_chapter_usfm = request->database_bibles()->getChapter (bible, book, chapter); - - - // If the most recent save operation on this chapter - // caused the chapter to be different, email the user, - // suggesting to check if the user's edit came through. - // The rationale is that if Bible text was saved through Send/receive, - // or if another user saved Bible text, - // it's worth to check on this. - // Because the user's editor may not yet have loaded this updated Bible text. - // https://github.com/bibledit/cloud/issues/340 - string loaded_usfm = getLoadedUsfm (webserver_request, bible, book, chapter, unique_id); - if (loaded_usfm != old_chapter_usfm) { - bible_logic_recent_save_email (bible, book, chapter, verse, username, loaded_usfm, old_chapter_usfm); - } - - - // Safely store the verse. - string explanation; - string message = usfm_safely_store_verse (request, bible, book, chapter, verse, verse_usfm, explanation, true); - bible_logic_unsafe_save_mail (message, explanation, username, verse_usfm); - // If storing the verse worked out well, there's no message to display. - if (message.empty ()) { - // Get the chapter text now, that is, after the save operation completed. - string new_chapter_usfm = request->database_bibles()->getChapter (bible, book, chapter); - // Check whether the text on disk was changed while the user worked with the older copy. - if (!loaded_usfm.empty () && (loaded_usfm != old_chapter_usfm)) { - // Do a merge for better editing reliability. - vector conflicts; - // Prioritize the USFM already in the chapter. - new_chapter_usfm = filter_merge_run (loaded_usfm, new_chapter_usfm, old_chapter_usfm, true, conflicts); - request->database_bibles()->storeChapter (bible, book, chapter, new_chapter_usfm); - Database_Logs::log (translate ("Merging chapter.")); - } -#ifdef HAVE_CLOUD - // The Cloud stores details of the user's changes. - int newID = request->database_bibles()->getChapterId (bible, book, chapter); - Database_Modifications database_modifications; - database_modifications.recordUserSave (username, bible, book, chapter, oldID, old_chapter_usfm, newID, new_chapter_usfm); - if (sendreceive_git_repository_linked (bible)) { - Database_Git::store_chapter (username, bible, book, chapter, old_chapter_usfm, new_chapter_usfm); - } - rss_logic_schedule_update (username, bible, book, chapter, old_chapter_usfm, new_chapter_usfm); -#endif - - - // Store a copy of the USFM now saved as identical to what's loaded in the editor for later reference. - storeLoadedUsfm (webserver_request, bible, book, chapter, unique_id); - - return locale_logic_text_saved (); - } - - - // The message contains information about save failure. - // Send it to the browser for display to the user. - return message; -} diff -Nru bibledit-5.0.912/editone/save.h bibledit-5.0.922/editone/save.h --- bibledit-5.0.912/editone/save.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editone/save.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - Copyright (©) 2003-2020 Teus Benschop. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - -#ifndef INCLUDED_EDITONE_SAVE_H -#define INCLUDED_EDITONE_SAVE_H - - -#include - - -string editone_save_url (); -bool editone_save_acl (void * webserver_request); -string editone_save (void * webserver_request); - - -#endif diff -Nru bibledit-5.0.912/editone/verse.cpp bibledit-5.0.922/editone/verse.cpp --- bibledit-5.0.912/editone/verse.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editone/verse.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -/* - Copyright (©) 2003-2020 Teus Benschop. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - -#include -#include -#include -#include -#include -#include - - -string editone_verse_url () -{ - return "editone/verse"; -} - - -bool editone_verse_acl (void * webserver_request) -{ - if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; - bool read, write; - access_a_bible (webserver_request, read, write); - return read; -} - - -string editone_verse (void * webserver_request) -{ - Webserver_Request * request = (Webserver_Request *) webserver_request; - - - // Only act if a verse was found - string sverse = request->query ["verse"]; - if (!sverse.empty ()) { - - - // Only update navigation in case the verse changed. - // This avoids unnecessary focus operations in the clients. - int iverse = convert_to_int (sverse); - if (iverse != Ipc_Focus::getVerse (request)) { - int book = Ipc_Focus::getBook (request); - int chapter = Ipc_Focus::getChapter (request); - Ipc_Focus::set (request, book, chapter, iverse); - } - - - } - - - return ""; -} diff -Nru bibledit-5.0.912/editone/verse.h bibledit-5.0.922/editone/verse.h --- bibledit-5.0.912/editone/verse.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editone/verse.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - Copyright (©) 2003-2020 Teus Benschop. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - -#ifndef INCLUDED_EDITONE_VERSE_H -#define INCLUDED_EDITONE_VERSE_H - - -#include - - -string editone_verse_url (); -bool editone_verse_acl (void * webserver_request); -string editone_verse (void * webserver_request); - - -#endif diff -Nru bibledit-5.0.912/editone2/index.cpp bibledit-5.0.922/editone2/index.cpp --- bibledit-5.0.912/editone2/index.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/index.cpp 2020-11-21 20:07:39.000000000 +0000 @@ -0,0 +1,157 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +string editone2_index_url () +{ + return "editone2/index"; +} + + +bool editone2_index_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return read; +} + + +string editone2_index (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + bool touch = request->session_logic ()->touchEnabled (); + + if (request->query.count ("switchbook") && request->query.count ("switchchapter")) { + int switchbook = convert_to_int (request->query ["switchbook"]); + int switchchapter = convert_to_int (request->query ["switchchapter"]); + Ipc_Focus::set (request, switchbook, switchchapter, 1); + Navigation_Passage::recordHistory (request, switchbook, switchchapter, 1); + } + + string page; + + Assets_Header header = Assets_Header (translate("Edit verse"), request); + header.setNavigator (); + header.setEditorStylesheet (); + if (touch) header.jQueryTouchOn (); + header.notifItOn (); + header.addBreadCrumb (menu_logic_translate_menu (), menu_logic_translate_text ()); + page = header.run (); + + Assets_View view; + + if (request->query.count ("changebible")) { + string changebible = request->query ["changebible"]; + if (changebible == "") { + Dialog_List dialog_list = Dialog_List ("index", translate("Select which Bible to open in the editor"), "", ""); + vector bibles = access_bible_bibles (request); + for (auto bible : bibles) { + dialog_list.add_row (bible, "changebible", bible); + } + page += dialog_list.run (); + return page; + } else { + request->database_config_user()->setBible (changebible); + } + } + + // Get active Bible, and check read access to it. + // If needed, change Bible to one it has read access to. + string bible = access_bible_clamp (request, request->database_config_user()->getBible ()); + if (request->query.count ("bible")) bible = access_bible_clamp (request, request->query ["bible"]); + view.set_variable ("bible", bible); + + // Store the active Bible in the page's javascript. + view.set_variable ("navigationCode", Navigation_Passage::code (bible)); + + int verticalCaretPosition = request->database_config_user ()->getVerticalCaretPosition (); + string script = + "var oneverseEditorVerseLoaded = '" + locale_logic_text_loaded () + "';\n" + "var oneverseEditorVerseUpdating = '" + locale_logic_text_updating () + "';\n" + "var oneverseEditorVerseUpdated = '" + locale_logic_text_updated () + "';\n" + "var oneverseEditorWillSave = '" + locale_logic_text_will_save () + "';\n" + "var oneverseEditorVerseSaving = '" + locale_logic_text_saving () + "';\n" + "var oneverseEditorVerseSaved = '" + locale_logic_text_saved () + "';\n" + "var oneverseEditorVerseRetrying = '" + locale_logic_text_retrying () + "';\n" + "var oneverseEditorVerseUpdatedLoaded = '" + locale_logic_text_reload () + "';\n" + "var verticalCaretPosition = " + convert_to_string (verticalCaretPosition) + ";\n" + "var verseSeparator = '" + Database_Config_General::getNotesVerseSeparator () + "';\n"; + config_logic_swipe_enabled (webserver_request, script); + view.set_variable ("script", script); + + string cls = Filter_Css::getClass (bible); + string font = Fonts_Logic::getTextFont (bible); + int direction = Database_Config_Bible::getTextDirection (bible); + int lineheight = Database_Config_Bible::getLineHeight (bible); + int letterspacing = Database_Config_Bible::getLetterSpacing (bible); + view.set_variable ("custom_class", cls); + view.set_variable ("custom_css", Filter_Css::getCss (cls, + Fonts_Logic::getFontPath (font), + direction, + lineheight, + letterspacing)); + + // Whether to enable fast Bible editor switching. + if (request->database_config_user ()->getFastEditorSwitchingAvailable ()) { + view.enable_zone ("fastswitcheditor"); + } + + // Whether to enable the styles button. + if (request->database_config_user ()->getEnableStylesButtonVisualEditors ()) { + view.enable_zone ("stylesbutton"); + } + + page += view.render ("editone2", "index"); + + page += Assets_Page::footer (); + + return page; +} + +// Tests for the editor: +// * Autosave on going to another passage. +// * Autosave on document unload. +// * Autosave shortly after any change. +// * Save the + sign of a note. +// * No loss of white space right after the verse number. diff -Nru bibledit-5.0.912/editone2/index.h bibledit-5.0.922/editone2/index.h --- bibledit-5.0.912/editone2/index.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/index.h 2020-09-27 10:11:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDITONE2_INDEX_H +#define INCLUDED_EDITONE2_INDEX_H + + +#include + + +string editone2_index_url (); +bool editone2_index_acl (void * webserver_request); +string editone2_index (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/editone2/index.html bibledit-5.0.922/editone2/index.html --- bibledit-5.0.912/editone2/index.html 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/index.html 2020-10-18 13:12:10.000000000 +0000 @@ -0,0 +1,40 @@ + +
+
+ + + + + + + | + ##bible## + | + + + | + translate ("editor") + + | + translate ("preview") + +
+
+
+
+
+
+ + + + + + + + + +##navigationCode## diff -Nru bibledit-5.0.912/editone2/index.js bibledit-5.0.922/editone2/index.js --- bibledit-5.0.912/editone2/index.js 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/index.js 2020-11-26 16:20:42.000000000 +0000 @@ -0,0 +1,1203 @@ +/* +Copyright (©) 2003-2020 Teus Benschop. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +var quill = undefined; +var Delta = Quill.import ("delta"); +var verseEditorUniqueID = Math.floor (Math.random() * 100000000); + + +$ (document).ready (function () +{ + // Make the editor's menu to never scroll out of view. + var bar = $ ("#editorheader").remove (); + $ ("#workspacemenu").append (bar); + + visualVerseEditorInitializeOnce (); + visualVerseEditorInitializeLoad (); + + navigationNewPassage (); + + $ (window).on ("unload", oneverseEditorForceSaveVerse); + + oneverseBindUnselectable (); + + $ ("#stylebutton").on ("click", oneverseStylesButtonHandler); + + $ (window).on ("keydown", oneverseWindowKeyHandler); + + if (swipe_operations) { + $ ("body").swipe ( { + swipeLeft:function (event, direction, distance, duration, fingerCount, fingerData) { + oneverseSwipeLeft (event); + }, + swipeRight:function (event, direction, distance, duration, fingerCount, fingerData) { + oneverseSwipeRight (event); + } + }); + } + + $ ("#oneeditor").on ("click", oneEditorNoteCitationClicked); + + setTimeout (oneverseCoordinatingTimeout, 500); + +}); + + +function visualVerseEditorInitializeOnce () +{ + var Parchment = Quill.import ('parchment'); + + // Register block formatting class. + var ParagraphClass = new Parchment.Attributor.Class ('paragraph', 'b', { scope: Parchment.Scope.BLOCK }); + Quill.register (ParagraphClass, true); + + // Register inline formatting class. + var CharacterClass = new Parchment.Attributor.Class ('character', 'i', { scope: Parchment.Scope.INLINE }); + Quill.register (CharacterClass, true); +} + + +function visualVerseEditorInitializeLoad () +{ + // Work around https://github.com/quilljs/quill/issues/1116 + // It sets the margins to 0 by adding an overriding class. + // The Quill editor will remove that class again. + $ ("#oneeditor > p").each (function (index) { + var element = $(this); + element.addClass ("nomargins"); + }); + + // Instantiate editor. + quill = new Quill ('#oneeditor', { }); + + // Cause it to paste plain text only. + quill.clipboard.addMatcher (Node.ELEMENT_NODE, function (node, delta) { + var plaintext = $ (node).text (); + return new Delta().insert (plaintext); + }); + + if (oneverseEditorWriteAccess) if (!quill.hasFocus ()) quill.focus (); + + // Event handlers. + quill.on ("text-change", visualVerseEditorTextChangeHandler); + quill.on ("selection-change", visualVerseEditorSelectionChangeHandler); +} + + +var oneverseBible; +var oneverseBook; +var oneverseNavigationBook; +var oneverseChapter; +var oneverseNavigationChapter; +var oneverseVerse; +var oneverseNavigationVerse; +var oneverseVerseLoading; +var oneverseVerseLoaded; +var oneverseEditorChangedTimeout; +var oneverseLoadedText; +var oneverseChapterId = 0; +var oneverseReloadCozChanged = false; +var oneverseReloadCozError = false; +var oneverseReloadPosition = undefined; +var oneverseLoadAjaxRequest; +var oneverseEditorWriteAccess = true; + + +// +// +// Section for the new Passage event from the Navigator. +// +// + + +function navigationNewPassage () +{ + if (typeof navigationBook != 'undefined') { + oneverseNavigationBook = navigationBook; + oneverseNavigationChapter = navigationChapter; + oneverseNavigationVerse = navigationVerse; + } else if (parent.window.navigationBook != 'undefined') { + oneverseNavigationBook = parent.window.navigationBook; + oneverseNavigationChapter = parent.window.navigationChapter; + oneverseNavigationVerse = parent.window.navigationVerse; + } else { + return; + } + + oneverseEditorForceSaveVerse (); + oneverseReloadCozChanged = false; + oneverseReloadCozError = false; + oneverseEditorLoadVerse (); +} + + +// +// +// Section for editor load and save. +// +// + + +function oneverseEditorLoadVerse () +{ + if ((oneverseNavigationBook != oneverseBook) || (oneverseNavigationChapter != oneverseChapter) || (oneverseNavigationVerse != oneverseVerse) || oneverseReloadCozChanged || oneverseReloadCozError ) { + oneverseBible = navigationBible; + oneverseBook = oneverseNavigationBook; + oneverseChapter = oneverseNavigationChapter; + oneverseVerse = oneverseNavigationVerse; + oneverseVerseLoading = oneverseNavigationVerse; + oneverseChapterId = 0; + if (oneverseReloadCozChanged) { + oneverseReloadPosition = oneverseCaretPosition (); + } else { + oneverseReloadPosition = undefined; + } + if (oneverseLoadAjaxRequest && oneverseLoadAjaxRequest.readystate != 4) { + oneverseLoadAjaxRequest.abort(); + } + oneverseLoadAjaxRequest = $.ajax ({ + url: "load", + type: "GET", + data: { bible: oneverseBible, book: oneverseBook, chapter: oneverseChapter, verse: oneverseVerseLoading, id: verseEditorUniqueID }, + success: function (response) { + // Flag for editor read-write or read-only. + oneverseEditorWriteAccess = checksum_readwrite (response); + // If this is the second or third or higher editor in the workspace, + // make the editor read-only. + if (window.frameElement) { + iframe = $(window.frameElement); + var data_editor_number = iframe.attr("data-editor-no"); + if (data_editor_number > 1) { + oneverseEditorWriteAccess = false; + } + } + // Checksumming. + response = checksum_receive (response); + // Splitting. + var bits; + if (response !== false) { + bits = response.split ("#_be_#"); + if (bits.length != 3) response == false; + } + if (response !== false) { + $ ("#oneprefix").empty (); + $ ("#oneprefix").append (bits [0]); + $ ("#oneprefix").off ("click"); + $ ("#oneprefix").on ("click", oneVerseHtmlClicked); + } + if (response !== false) { + // Destroy existing editor. + if (quill) delete quill; + // Load the html in the DOM. + $ ("#oneeditor").empty (); + $ ("#oneeditor").append (bits [1]); + oneverseVerseLoaded = oneverseVerseLoading; + oneverseEditorStatus (oneverseEditorVerseLoaded); + // Create the editor based on the DOM's content. + visualVerseEditorInitializeLoad (); + quill.enable (oneverseEditorWriteAccess); + // The browser may reformat the loaded html, so take the possible reformatted data for reference. + oneverseLoadedText = $ ("#oneeditor > .ql-editor").html (); + oneverseCaretMovedTimeoutStart (); + // Create CSS for embedded styles. + css4embeddedstyles (); + } + if (response !== false) { + oneverseEditorChangeOffsets = [] + oneverseEditorChangeInserts = [] + oneverseEditorChangeDeletes = [] + } + if (response !== false) { + $ ("#onesuffix").empty (); + $ ("#onesuffix").append (bits [2]); + $ ("#onesuffix").off ("click"); + $ ("#onesuffix").on ("click", oneVerseHtmlClicked); + } + if (response !== false) { + oneverseScrollVerseIntoView (); + oneversePositionCaret (); + // In case of network error, don't keep showing the notification. + if (!oneverseReloadCozError) { + if (oneverseReloadCozChanged) { + if (oneverseEditorWriteAccess) oneverseReloadAlert (oneverseEditorVerseUpdatedLoaded); + } + } + oneverseReloadCozChanged = false; + oneverseReloadCozError = false; + } + if (response === false) { + // Checksum or other error: Reload. + oneverseReloadCozError = true; + oneverseEditorLoadVerse (); + } + }, + }); + } +} + + +function oneverseEditorForceSaveVerse () +{ + // If some conditions are not met, do not save. + if (!oneverseEditorWriteAccess) return; + if (!oneverseBible) return; + if (!oneverseBook) return; + if (!oneverseVerseLoaded) return; + var html = $ ("#oneeditor > .ql-editor").html (); + if (html == oneverseLoadedText) return; + // Set the status as feedback to the user. + oneverseEditorStatus (oneverseEditorVerseSaving); + // This force-save cancels a normal save/update that might have been triggered. + clearTimeout (oneverseEditorChangedTimeout); + + oneverseLoadedText = html; + var encodedHtml = filter_url_plus_to_tag (html); + var checksum = checksum_get (encodedHtml); + $.ajax ({ + url: "save", + type: "POST", + async: false, + data: { bible: oneverseBible, book: oneverseBook, chapter: oneverseChapter, verse: oneverseVerseLoaded, html: encodedHtml, checksum: checksum, id: verseEditorUniqueID }, + error: function (jqXHR, textStatus, errorThrown) { + oneverseEditorStatus (oneverseEditorVerseRetrying); + oneverseLoadedText = ""; + oneverseEditorForceSaveVerse (); + }, + success: function (response) { + oneverseEditorStatus (response); + }, + complete: function (xhr, status) { + } + }); +} + + +// +// +// Portion dealing with triggers for editor's content change. +// +// + + +// Three combined lists store information about edits made in the editor, +// during the time span between +// 1. the moment the changes are sent to the server/device, +// when there is a delay in the network, and +// 2. the moment the updates for the editor come back from the server/device. +// Storage as follows: +// 1. Offsets at which... +// 2. The given number of characters were inserted, and... +// 3. The given number of characters were deleted. +// With 2-byte UTF-16 characters, one character is given as a "1" in the lists. +// With 4-byte UTF-16 characters, one characters is represented by a "2" in the lists. +var oneverseEditorChangeOffsets = []; +var oneverseEditorChangeInserts = []; +var oneverseEditorChangeDeletes = []; + + +// Arguments: delta: Delta, oldContents: Delta, source: String +function visualVerseEditorTextChangeHandler (delta, oldContents, source) +{ + // Record the change. + // It gives 4-byte UTF-16 characters as length value 2 instead of 1. + var retain = 0; + var insert = 0; + var del = 0; + for (let i = 0; i < delta.ops.length; i++) { + let obj = delta.ops[i]; + if (obj.retain) retain = obj.retain; + // For Unicode handling, see: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length + if (obj.insert) insert = obj.insert.length; + if (obj.delete) del = obj.delete; + } + oneverseEditorChangeOffsets.push(retain); + oneverseEditorChangeInserts.push(insert); + oneverseEditorChangeDeletes.push(del); + // Ensure that it does not delete a chapter number or verse number. + if (!delta.ops [0].retain) { + quill.history.undo (); + } + // Start save delay timer. + oneverseEditorChanged (); +} + + +function oneverseEditorChanged () +{ + if (!oneverseEditorWriteAccess) return; + oneverseEditorStatus (oneverseEditorWillSave); + if (oneverseEditorChangedTimeout) { + clearTimeout (oneverseEditorChangedTimeout); + } + oneverseEditorChangedTimeout = setTimeout (oneverseEditorTriggerSave, 1000); +} + + +function oneverseEditorTriggerSave () +{ + if (!oneverseUpdateTrigger) { + oneverseUpdateTrigger = true; + } else { + if (oneverseEditorChangedTimeout) { + clearTimeout (oneverseEditorChangedTimeout); + } + oneverseEditorChangedTimeout = setTimeout (oneverseEditorTriggerSave, 400); + } +} + + +// +// +// Section for user interface updates and feedback. +// +// + + +function oneverseEditorStatus (text) +{ + $ ("#onestatus").empty (); + $ ("#onestatus").append (text); + oneverseEditorSelectiveNotification (text); +} + + +function oneverseActiveStylesFeedback () +{ + var format = quill.getFormat (); + var paragraph = "..."; + if (format.paragraph) paragraph = format.paragraph; + var character = ""; + if (format.character) character = format.character; + if (character.search ("note") >= 0) character = ""; + character = character.split ("0").join (" "); + var styles = paragraph + " " + character; + var element = $ ("#oneverseactivestyles"); + element.text (styles); +} + + +function oneverseEditorSelectiveNotification (message) +{ + if (message == oneverseEditorVerseLoaded) return; + if (message == oneverseEditorWillSave) return; + if (message == oneverseEditorVerseSaving) return; + if (message == oneverseEditorVerseSaved) return; + if (message == oneverseEditorVerseUpdating) return; + if (message == oneverseEditorVerseUpdated) return; + notifyItError (message); +} + + +// +// +// Section for polling the server for updates on the loaded chapter. +// +// + + +var oneverseIdAjaxRequest; + + +function oneverseEditorPollId () +{ + oneverseAjaxActive = true; + oneverseIdAjaxRequest = $.ajax ({ + url: "../editor/id", + type: "GET", + data: { bible: oneverseBible, book: oneverseBook, chapter: oneverseChapter }, + cache: false, + success: function (response) { + if (oneverseChapterId != 0) { + if (response != oneverseChapterId) { + // The chapter identifier changed. + // That means that likely there's updated text on the server. + // Start the routine to load any possible updates into the editor. + oneverseUpdateTrigger = true; + } + } + oneverseChapterId = response; + }, + error: function (jqXHR, textStatus, errorThrown) { + }, + complete: function (xhr, status) { + oneverseAjaxActive = false; + } + }); +} + + +// +// +// Section for getting and setting the caret position. +// +// + + +function oneverseCaretPosition () +{ + var position = undefined; + var range = quill.getSelection(); + if (range) position = range.index; + return position; +} + + +function oneversePositionCaret () +{ + setTimeout (oneversePositionCaretTimeout, 100); +} + + +function oneversePositionCaretTimeout () +{ + var position; + if (oneverseReloadPosition != undefined) { + position = oneverseReloadPosition; + oneverseReloadPosition = undefined; + } else { + position = 1 + oneverseVerse.length; + } + quill.setSelection (position, 0, "silent"); +} + + +// +// +// Section for scrolling the editable portion into the center. +// +// + + +function oneverseScrollVerseIntoView () +{ + $("#workspacewrapper").stop(); + var verseTop = $("#oneeditor").offset().top; + var workspaceHeight = $("#workspacewrapper").height(); + var currentScrollTop = $("#workspacewrapper").scrollTop(); + var scrollTo = verseTop - (workspaceHeight * verticalCaretPosition / 100) + currentScrollTop; + var lowerBoundary = currentScrollTop - (workspaceHeight / 10); + var upperBoundary = currentScrollTop + (workspaceHeight / 10); + if ((scrollTo < lowerBoundary) || (scrollTo > upperBoundary)) { + $("#workspacewrapper").animate({ scrollTop: scrollTo }, 500); + } +} + + +// +// +// Section for the styles handling. +// +// + + +function oneverseStylesButtonHandler () +{ + if (!oneverseEditorWriteAccess) return; + $.ajax ({ + url: "../editor/style", + type: "GET", + cache: false, + success: function (response) { + oneverseShowResponse (response); + oneverseBindUnselectable (); + oneverseDynamicClickHandlers (); + }, + }); + return false; +} + + +function oneverseBindUnselectable () +{ + var elements = $ (".unselectable"); + elements.off ("mousedown"); + elements.on ("mousedown", function (event) { + event.preventDefault(); + }); +} + + +function oneverseShowResponse (response) +{ + if (!oneverseEditorWriteAccess) return; + $ ("#stylebutton").hide (); + $ ("#nostyles").hide (); + var area = $ ("#stylesarea"); + area.empty (); + area.append (response); +} + + +function oneverseClearStyles () +{ + var area = $ ("#stylesarea"); + area.empty (); + $ ("#stylebutton").show (); + $ ("#nostyles").show (); +} + + +function oneverseDynamicClickHandlers () +{ + var elements = $ ("#stylesarea > a"); + elements.on ("click", function (event) { + event.preventDefault(); + oneverseClearStyles (); + var href = event.currentTarget.href; + href = href.substring (href.lastIndexOf ('/') + 1); + if (href == "cancel") return; + if (href == "all") { + oneverseDisplayAllStyles (); + } else { + oneverseRequestStyle (href); + } + }); + + $ ("#styleslist").on ("change", function (event) { + var selection = $ ("#styleslist option:selected").text (); + var style = selection.substring (0, selection.indexOf (" ")); + event.preventDefault(); + oneverseClearStyles (); + oneverseRequestStyle (style); + }); +} + + +function oneverseRequestStyle (style) +{ + $.ajax ({ + url: "../editor/style", + type: "GET", + data: { style: style }, + cache: false, + success: function (response) { + response = response.split ("\n"); + var style = response [0]; + var action = response [1]; + if (action == "p") { + oneverseApplyParagraphStyle (style); + } else if (action == 'c') { + oneverseApplyCharacterStyle (style); + } else if (action == 'n') { + oneverseApplyNotesStyle (style); + } else if (action == "m") { + oneverseApplyMonoStyle (style); + } + }, + }); +} + + +function oneverseDisplayAllStyles () +{ + $.ajax ({ + url: "../editor/style", + type: "GET", + data: { all: "" }, + cache: false, + success: function (response) { + oneverseShowResponse (response); + oneverseBindUnselectable (); + oneverseDynamicClickHandlers (); + }, + }); +} + + +function oneverseApplyParagraphStyle (style) +{ + if (!oneverseEditorWriteAccess) return; + if (!quill.hasFocus ()) quill.focus (); + quill.format ("paragraph", style, "user"); + oneverseActiveStylesFeedback (); +} + + +function oneverseApplyCharacterStyle (style) +{ + if (!oneverseEditorWriteAccess) return; + if (!quill.hasFocus ()) quill.focus (); + // No formatting of a verse. + var range = quill.getSelection(); + if (range) { + for (i = range.index; i < range.index + range.length; i++) { + var format = quill.getFormat (i); + if (format.character && format.character == "v") { + return; + } + } + } + // Apply style. + var format = quill.getFormat (); + style = editor_determine_character_style (format.character, style) + quill.format ("character", style, "user"); + // Deal with embedded character styles. + post_embedded_style_application (style); + // Feedback. + oneverseActiveStylesFeedback (); +} + + +function oneverseApplyMonoStyle (style) +{ + if (!oneverseEditorWriteAccess) return; + + quill.focus (); + + var range = quill.getSelection(); + var caret = range.index; + + var start = caret; + var text = quill.getText (start, 1); + if (text == "\n") caret--; + for (i = caret; i >= 0; i--) { + var text = quill.getText (i, 1); + if (text == "\n") break; + start = i; + } + + var end = caret; + for (i = caret; true; i++) { + end = i; + var text = quill.getText (i, 1); + if (text == "\n") break; + } + + text = quill.getText (start, end - start); + var char = text.substring (0, 1); + if (char == "\\") { + text = text.substring (1); + var pos = text.indexOf (' '); + text = text.substring (pos + 1); + } + text = "\\" + style + " " + text; + + quill.deleteText (start, end - start); + quill.insertText (start, text, "paragraph", "mono"); + + oneverseActiveStylesFeedback (); +} + + +// +// +// Section with window events and their basic handlers. +// +// + + +function oneverseWindowKeyHandler (event) +{ + if (!oneverseEditorWriteAccess) return; + // Ctrl-S: Style. + if ((event.ctrlKey == true) && (event.keyCode == 83)) { + oneverseStylesButtonHandler (); + return false; + } + // Escape. + if (event.keyCode == 27) { + oneverseClearStyles (); + } +} + + +// +// +// Section responding to a moved caret. +// +// + + +// Responds to a changed selection or caret. +// range: { index: Number, length: Number } +// oldRange: { index: Number, length: Number } +// source: String +function visualVerseEditorSelectionChangeHandler (range, oldRange, source) +{ + // Bail out if editor not focused. + if (!range) return; + + // Bail out if text was selected. + if (range.length != 0) return; + + oneverseCaretMovedTimeoutStart (); +} + + +var oneverseCaretMovedTimeoutId; + + +function oneverseCaretMovedTimeoutStart () +{ + if (oneverseCaretMovedTimeoutId) clearTimeout (oneverseCaretMovedTimeoutId); + oneverseCaretMovedTimeoutId = setTimeout (oneverseActiveStylesFeedback, 200); +} + + +// +// +// Section for the notes. +// +// + + +var oneverseInsertedNotesCount = 0; + + +function oneverseApplyNotesStyle (style) +{ + if (!oneverseEditorWriteAccess) return; + + quill.focus (); + + // Check for and optionally append the gap between text body and notes. + var notes = $ (".b-notes"); + if (notes.length == 0) { + var length = quill.getLength (); + quill.insertText (length, "\n", "paragraph", "notes", "user") + } + + // Get a new node identifier based on the local time. + var date = new Date(); + var noteId = String (date.getTime()); + + var caller = String ((oneverseInsertedNotesCount % 9) + 1); + + // Insert note caller at caret. + var range = quill.getSelection(); + var caret = range.index; + quill.setSelection (caret, 0); + quill.insertText (caret, caller, "character", "notecall" + noteId, "user"); + + // Append note text to notes section. + assetsEditorAddNote (quill, style, caller, noteId, oneverseNavigationChapter, verseSeparator, oneverseNavigationVerse); + + oneverseInsertedNotesCount++; + + oneverseActiveStylesFeedback (); +} + + +function oneEditorNoteCitationClicked (event) +{ + var target = $(event.target); + var cls = target.attr ("class"); + if (cls.substr (0, 6) != "i-note") return; + cls = cls.substr (2); + var length = quill.getLength (); + if (cls.search ("call") > 0) { + cls = cls.replace ("call", "body"); + // Start searching for note bodies at the end. + for (i = length; i >= 0; i--) { + var format = quill.getFormat (i, 1); + if (format.character && format.character == cls) { + quill.setSelection (i + 4, 0); + oneverseActiveStylesFeedback (); + return; + } + } + } + if (cls.search ("body") > 0) { + cls = cls.replace ("body", "call"); + // Start searching for note callers at the start. + for (i = 0; i < length; i++) { + var format = quill.getFormat (i, 1); + if (format.character && format.character == cls) { + quill.setSelection (i + 1, 0); + oneverseActiveStylesFeedback (); + return; + } + } + } +} + + +// +// +// Section for navigating to another passage. +// +// + + +function oneVerseHtmlClicked (event) +{ + // If the user selects text, do nothing. + var text = ""; + if (window.getSelection) { + text = window.getSelection().toString(); + } else if (document.selection && document.selection.type != "Control") { + text = document.selection.createRange().text; + } + if (text.length) return; + + var verse = ""; + + var iterations = 0; + var target = $(event.target); + var tagName = target.prop("tagName"); + if (tagName == "P") target = $ (target.children ().last ()); + while ((iterations < 10) && (!target.hasClass ("i-v"))) { + var previous = $(target.prev ()); + if (previous.length == 0) { + target = $ (target.parent ().prev ()); + target = $ (target.children ().last ()); + } else { + target = previous; + } + iterations++; + } + + // Too many iterations: Undefined location. + if (iterations >= 10) return + + if (target.length == 0) verse = "0"; + + if (target.hasClass ("i-v")) { + verse = target[0].innerText; + } + + $.ajax ({ + url: "verse", + type: "GET", + data: { verse: verse }, + cache: false + }); +} + + +// +// +// Section for swipe navigation. +// +// + + +function oneverseSwipeLeft (event) +{ + if (typeof navigateNextVerse != 'undefined') { + navigateNextVerse (event); + } else if (parent.window.navigateNextVerse != 'undefined') { + parent.window.navigateNextVerse (event); + } +} + + +function oneverseSwipeRight (event) +{ + if (typeof navigatePreviousVerse != 'undefined') { + navigatePreviousVerse (event); + } else if (parent.window.navigatePreviousVerse != 'undefined') { + parent.window.navigatePreviousVerse (event); + } +} + + +/* + +Section for reload notifications. + +*/ + + +function oneverseReloadAlert (message) +{ + // Take action only if the editor has focus and the user can type in it. + if (!quill.hasFocus ()) return; + // Do the notification stuff. + notifyItSuccess (message) + quill.enable (false); + setTimeout (oneverseReloadAlertTimeout, 3000); +} + + +function oneverseReloadAlertTimeout () +{ + quill.enable (oneverseEditorWriteAccess); + quill.focus (); +} + + +/* + +Section for the coordinating timer. +This deals with the various events. +It monitors the ongoing AJAX actions for loading and updating and saving. +It decides which action to take. +It ensures that no two actions overlap or interfere with one another. +It also handles network latency, +by ensuring that the next call to the server +only occurs after the first call has been completed. +https://github.com/bibledit/cloud/issues/424 + +*/ + + +var oneverseAjaxActive = false; +var oneversePollSelector = 0; +var oneversePollDate = new Date(); +var oneverseUpdateTrigger = false; + + +function oneverseCoordinatingTimeout () +{ + // Handle situation that an AJAX call is ongoing. + if (oneverseAjaxActive) { + + } + else if (oneverseUpdateTrigger) { + oneverseUpdateTrigger = false; + oneverseUpdateExecute (); + } + // Handle situation that no process is ongoing. + // Now the regular pollers can run again. + else { + // There are two regular pollers. + // Wait 500 ms, then start one of the pollers. + // So each poller runs once a second. + var difference = new Date () - oneversePollDate; + if (difference > 500) { + oneversePollSelector++; + if (oneversePollSelector > 1) oneversePollSelector = 0; + if (oneversePollSelector == 0) { + oneverseEditorPollId (); + } + if (oneversePollSelector == 1) { + + } + oneversePollDate = new Date(); + } + } + setTimeout (oneverseCoordinatingTimeout, 100); +} + + +/* + +Section for the smart editor updating logic. + +*/ + + +var editorHtmlAtStartOfUpdate = null; +var useShadowQuill = false; + + +function oneverseUpdateExecute () +{ + // Determine whether the conditions for an editor update are all met. + var goodToGo = true; + if (!oneverseBible) goodToGo = false; + if (!oneverseBook) goodToGo = false; + if (!oneverseVerseLoaded) goodToGo = false; + if (!goodToGo) { + return; + } + + // Clear the editor's edits. + // The user can continue making changes in the editor. + // These changes get recorded. + oneverseEditorChangeOffsets = []; + oneverseEditorChangeInserts = []; + oneverseEditorChangeDeletes = []; + + // A snapshot of the text originally loaded in the editor via AJAX. + var encodedLoadedHtml = filter_url_plus_to_tag (oneverseLoadedText); + + // A snapshot of the current editor text at this point of time. + editorHtmlAtStartOfUpdate = $ ("#oneeditor > .ql-editor").html (); + var encodedEditedHtml = filter_url_plus_to_tag (editorHtmlAtStartOfUpdate); + + // The editor "saves..." if there's changes, and "updates..." if there's no changes. + if (editorHtmlAtStartOfUpdate == oneverseLoadedText) { + oneverseEditorStatus (oneverseEditorVerseUpdating); + } else { + oneverseEditorStatus (oneverseEditorVerseSaving); + } + + var checksum1 = checksum_get (encodedLoadedHtml); + var checksum2 = checksum_get (encodedEditedHtml); + + oneverseAjaxActive = true; + + oneverseIdAjaxRequest = $.ajax ({ + url: "update", + type: "POST", + async: true, + data: { bible: oneverseBible, book: oneverseBook, chapter: oneverseChapter, verse: oneverseVerseLoaded, loaded: encodedLoadedHtml, edited: encodedEditedHtml, checksum1: checksum1, checksum2: checksum2, id: verseEditorUniqueID }, + error: function (jqXHR, textStatus, errorThrown) { + oneverseEditorStatus (oneverseEditorVerseRetrying); + oneverseEditorChanged (); + }, + success: function (response) { + + // Flag for editor read-write or read-only. + // Do not set the read-only status of the editor here. + // This is already set at text-load. + // It is also dependent on the frame number the editor is in. + // To not make it more complex than needed, leave read-only out. + var readwrite = checksum_readwrite (response); + + // Checksumming. + response = checksum_receive (response); + if (response !== false) { + + // Use a shadow copy of the Quill editor in case the user made edits + // between the moment the update routine was initiated, + // and the moment the updates from the server/device are being applied. + // This shadow copy will be updated with the uncorrected changes from the server/device. + // The html from this editor will then server as the "loaded text". + useShadowQuill = (oneverseEditorChangeOffsets.length > 0); + if (useShadowQuill) startShadowQuill (editorHtmlAtStartOfUpdate); + + // Split the response into the separate bits. + var bits = []; + bits = response.split ("#_be_#"); + + // The first bit is the feedback message to the user. + oneverseEditorStatus (bits.shift()); + + // The next bit is the new chapter identifier. + oneverseChapterId = bits.shift(); + + // Apply the remaining data, the differences, to the editor. + while (bits.length > 0) { + var position = parseInt (bits.shift ()); + var operator = bits.shift(); + // Position 0 in the incoming changes always refers to the initial new line in the editor. + // Do not insert or delete that new line, but just apply any formatting there. + if (position == 0) { + if (operator == "p") { + var style = bits.shift (); + quill.formatLine (0, 0, {"paragraph": style}, "silent"); + if (useShadowQuill) quill2.formatLine (0, 0, {"paragraph": style}, "silent"); + } + } else { + // The initial new line is not counted in Quill. + position--; + // The position for the shadow copy of Quill, if it's there. + var position2 = position; + // Handle the insert operation. + if (operator == "i") { + // Get the information. + var text = bits.shift (); + var style = bits.shift (); + var size = parseInt (bits.shift()); + // Correct the position + // and the positions stored during the update procedure's network latency. + position = oneverseUpdateIntermediateEdits (position, size, true, false); + // Handle the insert operation. + if (text == "\n") { + // New line. + quill.insertText (position, text, {}, "silent"); + if (useShadowQuill) quill2.insertText (position2, text, {}, "silent"); + quill.formatLine (position + 1, 1, {"paragraph": style}, "silent"); + if (useShadowQuill) quill2.formatLine (position2 + 1, 1, {"paragraph": style}, "silent"); + } else { + // Ordinary character: Insert formatted text. + quill.insertText (position, text, {"character": style}, "silent"); + if (useShadowQuill) quill2.insertText (position2, text, {"character": style}, "silent"); + } + } + // Handle delete operator. + else if (operator == "d") { + // Get the bits of information. + var size = parseInt (bits.shift()); + // Correct the position and the positions + // stored during the update procedure's network latency. + position = oneverseUpdateIntermediateEdits (position, size, false, true); + // Do the delete operation. + quill.deleteText (position, size, "silent"); + if (useShadowQuill) quill2.deleteText (position2, size, "silent"); + } + // Handle format paragraph operator. + else if (operator == "p") { + var style = bits.shift (); + quill.formatLine (position + 1, 1, {"paragraph": style}, "silent"); + if (useShadowQuill) quill2.formatLine (position2 + 1, 1, {"paragraph": style}, "silent"); + } + // Handle format character operator. + else if (operator == "c") { + var style = bits.shift (); + } + } + } + + } else { + // If the checksum is not valid, the response will become false. + // Checksum error. + oneverseEditorStatus (oneverseEditorVerseRetrying); + } + + // The browser may reformat the loaded html, so take the possible reformatted data for reference. + oneverseLoadedText = $ ("#oneeditor > .ql-editor").html (); + if (useShadowQuill) oneverseLoadedText = $ ("#onetemp > .ql-editor").html (); + $ ("#onetemp").empty (); + + // Create CSS for embedded styles. + css4embeddedstyles (); + }, + complete: function (xhr, status) { + oneverseAjaxActive = false; + } + }); + +} + + +var quill2 = undefined; + + +function startShadowQuill (html) +{ + if (quill2) delete quill2; + $ ("#onetemp").empty (); + $ ("#onetemp").append (html); + quill2 = new Quill ('#onetemp', { }); +} + + +function oneverseUpdateIntermediateEdits (position, size, ins_op, del_op) +{ + // The offsets of the changes from the server/device are going to be corrected + // with the offsets of the edits made in the editor. + // This is to handle continued user-typing while the editor is being updated, + // Update, and get updated by, the edits made since the update operation began. + // UTF-16 characters 4 bytes long have a size of 2 in Javascript. + // So the routine takes care of that too. + var i; + for (i = 0; i < oneverseEditorChangeOffsets.length; i++) { + // Any delete or insert at a lower offset or the same offset + // modifies the position where to apply the incoming edit from the server/device. + if (oneverseEditorChangeOffsets[i] <= position) { + position += oneverseEditorChangeInserts[i]; + position -= oneverseEditorChangeDeletes[i] + } + // Any offset higher than the current position gets modified accordingly. + // If inserting at the current position, increase that offset. + // If deleting at the current position, decrease that offset. + if (oneverseEditorChangeOffsets[i] > position) { + if (ins_op) oneverseEditorChangeOffsets[i] += size; + if (del_op) oneverseEditorChangeOffsets[i] -= size; + } + } + + return position +} + diff -Nru bibledit-5.0.912/editone2/load.cpp bibledit-5.0.922/editone2/load.cpp --- bibledit-5.0.912/editone2/load.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/load.cpp 2020-11-06 16:10:40.000000000 +0000 @@ -0,0 +1,127 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +using namespace pugi; + + +string editone2_load_url () +{ + return "editone2/load"; +} + + +bool editone2_load_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return read; +} + + +string editone2_load (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + string bible = request->query ["bible"]; + int book = convert_to_int (request->query ["book"]); + int chapter = convert_to_int (request->query ["chapter"]); + int verse = convert_to_int (request->query ["verse"]); + string unique_id = request->query ["id"]; + + string stylesheet = Database_Config_Bible::getEditorStylesheet (bible); + + string chapter_usfm = request->database_bibles()->getChapter (bible, book, chapter); + + vector verses = usfm_get_verse_numbers (chapter_usfm); + int highest_verse = 0; + if (!verses.empty ()) highest_verse = verses.back (); + + // The Quill-based editor removes empty paragraphs at the end. + // Therefore it does not include them. + string editable_usfm = usfm_get_verse_text_quill (chapter_usfm, verse); + + string prefix_usfm = usfm_get_verse_range_text (chapter_usfm, 0, verse - 1, editable_usfm, true); + string suffix_usfm = usfm_get_verse_range_text (chapter_usfm, verse + 1, highest_verse, editable_usfm, true); + + // Store a copy of the USFM loaded in the editor for later reference. + // Note that this verse editor has been tested that it uses the correct sequence + // while storing this snapshot. + // When the user goes to another verse in the editor, the system follows this sequence: + // 1. It saves the edited text in the current verse. + // 2. It updates the chapter snapshot. + // 3. It loads the other verse. + // 4. It updates the chapter snapshot. + storeLoadedUsfm2 (webserver_request, bible, book, chapter, unique_id); + + string prefix_html; + string not_used; + editone2_logic_prefix_html (prefix_usfm, stylesheet, prefix_html, not_used); + + // The focused editable verse also has any footnotes contained in that verse. + // It is convenient to have the footnote as near as possible to the verse text. + // This is helpful for editing the verse and note. + string focused_verse_html; + editone2_logic_editable_html (editable_usfm, stylesheet, focused_verse_html); + + string suffix_html; + editone2_logic_suffix_html ("", suffix_usfm, stylesheet, suffix_html); + + // If the verse was empty, ensure that it has a non-breaking space as the last character, + // for easier text entry in the verse. + string plain_text = filter_string_html2text (focused_verse_html); + plain_text = filter_string_trim (plain_text); + string vs = convert_to_string (verse); + bool editable_verse_is_empty = plain_text == vs; + if (editable_verse_is_empty) { + string search = "

"; + string replace = "" + unicode_non_breaking_space_entity () + "

"; + focused_verse_html = filter_string_str_replace (search, replace, focused_verse_html); + } + + // Moves any notes from the prefix to the suffix. + editone2_logic_move_notes (prefix_html, suffix_html); + + string data; + data.append (prefix_html); + data.append ("#_be_#"); + data.append (focused_verse_html); + data.append ("#_be_#"); + data.append (suffix_html); + + string user = request->session_logic ()->currentUser (); + bool write = access_bible_book_write (webserver_request, user, bible, book); + data = Checksum_Logic::send (data, write); + + return data; +} diff -Nru bibledit-5.0.912/editone2/load.h bibledit-5.0.922/editone2/load.h --- bibledit-5.0.912/editone2/load.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/load.h 2020-09-27 10:11:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDITONE2_LOAD_H +#define INCLUDED_EDITONE2_LOAD_H + + +#include + + +string editone2_load_url (); +bool editone2_load_acl (void * webserver_request); +string editone2_load (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/editone2/logic.cpp bibledit-5.0.922/editone2/logic.cpp --- bibledit-5.0.912/editone2/logic.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/logic.cpp 2020-11-09 20:00:52.000000000 +0000 @@ -0,0 +1,192 @@ +/* +Copyright (©) 2003-2020 Teus Benschop. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +#include +#include +#include +#include +#include + + +void editone2_logic_prefix_html (string usfm, string stylesheet, string & html, string & last_p_style) +{ + if (!usfm.empty ()) { + Editor_Usfm2Html editor_usfm2html; + editor_usfm2html.load (usfm); + editor_usfm2html.stylesheet (stylesheet); + editor_usfm2html.run (); + html = editor_usfm2html.get (); + // No identical id's in the same DOM. + html = filter_string_str_replace (" id=\"notes\"", " id=\"prefixnotes\"", html); + // The last paragraph style in this USFM fragment, the prefix to the editable fragment. + // If the last paragraph has any content in it, + // for correct visual representation of the editable fragment, that follows this, + // clear that style. + last_p_style = editor_usfm2html.currentParagraphStyle; + if (!editor_usfm2html.currentParagraphContent.empty ()) last_p_style.clear (); + } +} + + +void editone2_logic_editable_html (string usfm, string stylesheet, string & html) +{ + if (!usfm.empty ()) { + Editor_Usfm2Html editor_usfm2html; + editor_usfm2html.load (usfm); + editor_usfm2html.stylesheet (stylesheet); + editor_usfm2html.run (); + html = editor_usfm2html.get (); + } +} + + +void editone2_logic_suffix_html (string editable_last_p_style, string usfm, string stylesheet, string & html) +{ + if (!usfm.empty ()) { + Editor_Usfm2Html editor_usfm2html; + editor_usfm2html.load (usfm); + editor_usfm2html.stylesheet (stylesheet); + editor_usfm2html.run (); + html = editor_usfm2html.get (); + // No identical id in the same DOM. + html = filter_string_str_replace (" id=\"notes\"", " id=\"suffixnotes\"", html); + } + + // If the first paragraph of the suffix does not have a paragraph style applied, + // apply the last paragraph style of the focused verse to the first paragraph of the suffix. + // For example, html like this: + //

7 For Yahweh knows the way of the righteous,

but the way of the wicked shall perish.

+ // ... will become like this: + //

7For Yahweh knows the way of the righteous,

but the way of the wicked shall perish.

+ if (!html.empty ()) { + if (!editable_last_p_style.empty ()) { + xml_document document; + html = html2xml (html); + document.load_string (html.c_str(), parse_ws_pcdata_single); + xml_node p_node = document.first_child (); + string p_style = p_node.attribute ("class").value (); + if (p_style.empty ()) { + p_node.append_attribute ("class") = editable_last_p_style.c_str (); + } + stringstream output; + document.print (output, "", format_raw); + html = output.str (); + } + } +} + + +string editone2_logic_html_to_usfm (string stylesheet, string html) +{ + // It used to convert XML entities to normal characters. + // For example, it used to convert "<" to "<". + // But doing this too early in the conversion chain led to the following problem: + // The XML parser was taking the "<" character as part of an XML element. + // It than didn't find the closing ">" marker, and then complained about parsing errors. + // And it dropped whatever followed the "<" marker. + // So it now no longer unescapes the XML special characters this early in the chain. + // It does it much later now, before saving the USFM that the converter produces. + + // Convert special spaces to normal ones. + html = any_space_to_standard_space (html); + + // Convert the html back to USFM in the special way for editing one verse. + string usfm = editor_export_verse_quill (stylesheet, html); + + // Done. + return usfm; +} + + +// Move the notes from the $prefix to the $suffix. +void editone2_logic_move_notes (string & prefix, string & suffix) +{ + // No input: Ready. + if (prefix.empty ()) return; + + // Do a html to xml conversion to avoid a mismatched tag error. + prefix = html2xml (prefix); + + // Load the prefix. + xml_document document; + document.load_string (prefix.c_str(), parse_ws_pcdata_single); + + // If there's any notes, it should be at the end. + xml_node div_node = document.last_child (); + string id = div_node.attribute ("id").value (); + + // No note(s): Ready. + if (id != "prefixnotes") return; + + // Get the note(s) leaving out the surrounding data. + string notes_text; + for (xml_node child : div_node.children ()) { + if (strcmp (child.name (), "p") != 0) continue; + stringstream ss; + child.print (ss, "", format_raw); + string note = ss.str (); + notes_text.append (note); + } + + // Remove the note(s) from the prefix. + document.remove_child (div_node); + { + stringstream ss; + document.print (ss, "", format_raw); + prefix = ss.str (); + } + + // Do a html to xml conversion to avoid a mismatched tag error. + suffix = html2xml (suffix); + + // Load the suffix. + document.load_string (suffix.c_str(), parse_ws_pcdata_single); + + // If there's any notes, it should be at the end. + div_node = document.last_child (); + id = div_node.attribute ("id").value (); + + // If there's no notes container, add it. + if (id.empty ()) { + div_node = document.append_child ("div"); + div_node.append_attribute ("id") = "suffixnotes"; + div_node.append_child ("hr"); + } + + // Contain the prefix's notes and add them to the suffix's notes container. + notes_text.insert (0, "
"); + notes_text.append ("
"); + div_node.append_buffer (notes_text.c_str (), notes_text.size ()); + + // Put the notes in the correct order, if needed. + if (!id.empty ()) { + xml_node hr_node = div_node.first_child (); + xml_node new_node = div_node.last_child (); + div_node.insert_move_after (new_node, hr_node); + } + + // Convert the DOM to suffix text. + { + stringstream ss; + document.print (ss, "", format_raw); + suffix = ss.str (); + } +} + + diff -Nru bibledit-5.0.912/editone2/logic.h bibledit-5.0.922/editone2/logic.h --- bibledit-5.0.912/editone2/logic.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/logic.h 2020-09-27 10:11:46.000000000 +0000 @@ -0,0 +1,34 @@ +/* +Copyright (©) 2003-2020 Teus Benschop. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +#ifndef INCLUDED_EDITONE2_LOGIC_H +#define INCLUDED_EDITONE2_LOGIC_H + + +#include + + +void editone2_logic_prefix_html (string usfm, string stylesheet, string & html, string & last_p_style); +void editone2_logic_editable_html (string usfm, string stylesheet, string & html); +void editone2_logic_suffix_html (string editable_last_p_style, string usfm, string stylesheet, string & html); +string editone2_logic_html_to_usfm (string stylesheet, string html); +void editone2_logic_move_notes (string & prefix, string & suffix); + + +#endif diff -Nru bibledit-5.0.912/editone2/save.cpp bibledit-5.0.922/editone2/save.cpp --- bibledit-5.0.912/editone2/save.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/save.cpp 2020-09-27 10:14:30.000000000 +0000 @@ -0,0 +1,176 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +string editone2_save_url () +{ + return "editone2/save"; +} + + +bool editone2_save_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return read; +} + + +string editone2_save (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + + // Check on information about where to save the verse. + bool save = (request->post.count ("bible") && request->post.count ("book") && request->post.count ("chapter") && request->post.count ("verse") && request->post.count ("html")); + if (!save) { + return translate("Don't know where to save"); + } + + + string bible = request->post["bible"]; + int book = convert_to_int (request->post["book"]); + int chapter = convert_to_int (request->post["chapter"]); + int verse = convert_to_int (request->post["verse"]); + string html = request->post["html"]; + string checksum = request->post["checksum"]; + string unique_id = request->post ["id"]; + + + // Checksum. + if (Checksum_Logic::get (html) != checksum) { + request->response_code = 409; + return translate ("Checksum error"); + } + + + // Decode html encoded in javascript. + html = filter_url_tag_to_plus (html); + + + // Check there's anything to save at all. + html = filter_string_trim (html); + if (html.empty ()) { + return translate ("Nothing to save"); + } + + + // Check on valid UTF-8. + if (!unicode_string_is_valid (html)) { + return translate ("Cannot save: Needs Unicode"); + } + + + if (!access_bible_book_write (request, "", bible, book)) { + return translate ("No write access"); + } + + + string stylesheet = Database_Config_Bible::getEditorStylesheet (bible); + + + string verse_usfm = editone2_logic_html_to_usfm (stylesheet, html); + + + // Collect some data about the changes for this user. + string username = request->session_logic()->currentUser (); +#ifdef HAVE_CLOUD + int oldID = request->database_bibles()->getChapterId (bible, book, chapter); +#endif + string old_chapter_usfm = request->database_bibles()->getChapter (bible, book, chapter); + + + // If the most recent save operation on this chapter + // caused the chapter to be different, email the user, + // suggesting to check if the user's edit came through. + // The rationale is that if Bible text was saved through Send/receive, + // or if another user saved Bible text, + // it's worth to check on this. + // Because the user's editor may not yet have loaded this updated Bible text. + // https://github.com/bibledit/cloud/issues/340 + string loaded_usfm = getLoadedUsfm2 (webserver_request, bible, book, chapter, unique_id); + if (loaded_usfm != old_chapter_usfm) { + bible_logic_recent_save_email (bible, book, chapter, verse, username, loaded_usfm, old_chapter_usfm); + } + + + // Safely store the verse. + string explanation; + string message = usfm_safely_store_verse (request, bible, book, chapter, verse, verse_usfm, explanation, true); + bible_logic_unsafe_save_mail (message, explanation, username, verse_usfm); + // If storing the verse worked out well, there's no message to display. + if (message.empty ()) { + // Get the chapter text now, that is, after the save operation completed. + string new_chapter_usfm = request->database_bibles()->getChapter (bible, book, chapter); + // Check whether the text on disk was changed while the user worked with the older copy. + if (!loaded_usfm.empty () && (loaded_usfm != old_chapter_usfm)) { + // Do a merge for better editing reliability. + vector conflicts; + // Prioritize the USFM already in the chapter. + new_chapter_usfm = filter_merge_run (loaded_usfm, new_chapter_usfm, old_chapter_usfm, true, conflicts); + request->database_bibles()->storeChapter (bible, book, chapter, new_chapter_usfm); + Database_Logs::log (translate ("Merging chapter.")); + } +#ifdef HAVE_CLOUD + // The Cloud stores details of the user's changes. + int newID = request->database_bibles()->getChapterId (bible, book, chapter); + Database_Modifications database_modifications; + database_modifications.recordUserSave (username, bible, book, chapter, oldID, old_chapter_usfm, newID, new_chapter_usfm); + if (sendreceive_git_repository_linked (bible)) { + Database_Git::store_chapter (username, bible, book, chapter, old_chapter_usfm, new_chapter_usfm); + } + rss_logic_schedule_update (username, bible, book, chapter, old_chapter_usfm, new_chapter_usfm); +#endif + + + // Store a copy of the USFM now saved as identical to what's loaded in the editor for later reference. + storeLoadedUsfm2 (webserver_request, bible, book, chapter, unique_id); + + return locale_logic_text_saved (); + } + + + // The message contains information about save failure. + // Send it to the browser for display to the user. + return message; +} diff -Nru bibledit-5.0.912/editone2/save.h bibledit-5.0.922/editone2/save.h --- bibledit-5.0.912/editone2/save.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/save.h 2020-09-27 10:11:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDITONE2_SAVE_H +#define INCLUDED_EDITONE2_SAVE_H + + +#include + + +string editone2_save_url (); +bool editone2_save_acl (void * webserver_request); +string editone2_save (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/editone2/update.cpp bibledit-5.0.922/editone2/update.cpp --- bibledit-5.0.912/editone2/update.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/update.cpp 2020-11-25 07:24:14.000000000 +0000 @@ -0,0 +1,343 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +string editone2_update_url () +{ + return "editone2/update"; +} + + +bool editone2_update_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return read; +} + + +string editone2_update (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + + // Whether the update is good to go. + bool good2go = true; + + + // The messages to return. + vector messages; + + + // Check the relevant bits of information. + if (good2go) { + bool parameters_ok = true; + if (!request->post.count ("bible")) parameters_ok = false; + if (!request->post.count ("book")) parameters_ok = false; + if (!request->post.count ("chapter")) parameters_ok = false; + if (!request->post.count ("verse")) parameters_ok = false; + if (!request->post.count ("loaded")) parameters_ok = false; + if (!request->post.count ("edited")) parameters_ok = false; + if (!parameters_ok) { + messages.push_back (translate("Don't know what to update")); + good2go = false; + } + } + + + // Get the relevant bits of information. + string bible; + int book = 0; + int chapter = 0; + int verse = 0; + string loaded_html; + string edited_html; + string checksum1; + string checksum2; + string unique_id; + if (good2go) { + bible = request->post["bible"]; + book = convert_to_int (request->post["book"]); + chapter = convert_to_int (request->post["chapter"]); + verse = convert_to_int (request->post["verse"]); + loaded_html = request->post["loaded"]; + edited_html = request->post["edited"]; + checksum1 = request->post["checksum1"]; + checksum2 = request->post["checksum2"]; + unique_id = request->post ["id"]; + } + + + // Checksums of the loaded and edited html. + if (good2go) { + if (Checksum_Logic::get (loaded_html) != checksum1) { + request->response_code = 409; + messages.push_back (translate ("Checksum error")); + good2go = false; + } + } + if (good2go) { + if (Checksum_Logic::get (edited_html) != checksum2) { + request->response_code = 409; + messages.push_back (translate ("Checksum error")); + good2go = false; + } + } + + + // Decode html encoded in javascript, and clean it. + loaded_html = filter_url_tag_to_plus (loaded_html); + edited_html = filter_url_tag_to_plus (edited_html); + loaded_html = filter_string_trim (loaded_html); + edited_html = filter_string_trim (edited_html); + + + // Check on valid UTF-8. + if (good2go) { + if (!unicode_string_is_valid (loaded_html) || !unicode_string_is_valid (edited_html)) { + messages.push_back (translate ("Cannot update: Needs Unicode")); + good2go = false; + } + } + + + bool bible_write_access = false; + if (good2go) { + bible_write_access = access_bible_book_write (request, "", bible, book); + } + + + string stylesheet; + if (good2go) stylesheet = Database_Config_Bible::getEditorStylesheet (bible); + + + // Collect some data about the changes for this user. + string username = request->session_logic()->currentUser (); +#ifdef HAVE_CLOUD + int oldID = 0; + if (good2go) oldID = request->database_bibles()->getChapterId (bible, book, chapter); +#endif + string old_chapter_usfm; + if (good2go) old_chapter_usfm = request->database_bibles()->getChapter (bible, book, chapter); + + + // Determine what (composed) version of USFM to save to the chapter. + // Do a three-way merge to obtain that USFM. + // This needs the loaded USFM as the ancestor, + // the edited USFM as a change-set, + // and the existing USFM as a prioritized change-set. + string loaded_verse_usfm = editone2_logic_html_to_usfm (stylesheet, loaded_html); + string edited_verse_usfm = editone2_logic_html_to_usfm (stylesheet, edited_html); + string existing_verse_usfm = usfm_get_verse_text_quill (old_chapter_usfm, verse); + existing_verse_usfm = filter_string_trim (existing_verse_usfm); + + + // Set a flag if there is a reason to save the editor text, since it was edited. + // This is important because the same routine is used for saving editor text + // as well as updating the editor text. + // So if the text in the editor was not changed, it should not save it, + // as saving the editor text would overwrite saves made by other(s). + bool text_was_edited = (loaded_verse_usfm != edited_verse_usfm); + + + // Do a three-way merge if needed. + // There's a need for this if there were user-edits, + // and if the USFM on the server differs from the USFM loaded in the editor. + // The three-way merge reconciles those differences. + if (good2go && bible_write_access && text_was_edited) { + if (loaded_verse_usfm != existing_verse_usfm) { + vector conflicts; + // Do a merge while giving priority to the USFM already in the chapter. + string merged_verse_usfm = filter_merge_run (loaded_verse_usfm, edited_verse_usfm, existing_verse_usfm, true, conflicts); + // Mail the user if there is a merge anomaly. + bible_logic_optional_merge_irregularity_email (bible, book, chapter, username, loaded_verse_usfm, edited_verse_usfm, merged_verse_usfm); + // Let the merged data now become the edited data (so it gets saved properly). + edited_verse_usfm = merged_verse_usfm; + } + } + + + // Safely store the verse. + string explanation; + string message; + if (good2go && bible_write_access && text_was_edited) { + message = usfm_safely_store_verse (request, bible, book, chapter, verse, edited_verse_usfm, explanation, true); + bible_logic_unsafe_save_mail (message, explanation, username, edited_verse_usfm); + } + + + // The new chapter identifier and new chapter USFM. + int newID = request->database_bibles()->getChapterId (bible, book, chapter); + string new_chapter_usfm; + if (good2go) { + new_chapter_usfm = request->database_bibles()->getChapter (bible, book, chapter); + } + + + if (good2go && bible_write_access && text_was_edited) { + // If storing the verse worked out well, there's no message to display. + if (message.empty ()) { +#ifdef HAVE_CLOUD + // The Cloud stores details of the user's changes. + Database_Modifications database_modifications; + database_modifications.recordUserSave (username, bible, book, chapter, oldID, old_chapter_usfm, newID, new_chapter_usfm); + if (sendreceive_git_repository_linked (bible)) { + Database_Git::store_chapter (username, bible, book, chapter, old_chapter_usfm, new_chapter_usfm); + } + rss_logic_schedule_update (username, bible, book, chapter, old_chapter_usfm, new_chapter_usfm); +#endif + // Feedback to user. + messages.push_back (locale_logic_text_saved ()); + } else { + // Feedback about anomaly to user. + messages.push_back (message); + } + } + + + // If there's no message at all, return at least something to the editor. + if (messages.empty ()) messages.push_back (locale_logic_text_updated()); + + + // The response to send to back to the editor. + string response; + string separator = "#_be_#"; + // The response starts with the save message(s) if any. + // The message(s) contain information about save success or failure. + // Send it to the browser for display to the user. + response.append (filter_string_implode (messages, " | ")); + + + // Add separator and the new chapter identifier to the response. + response.append (separator); + response.append (convert_to_string (newID)); + + + // The main purpose of the following block of code is this: + // To send the differences between what the editor has now and what the server has now. + // The purpose of sending the differences to the editor is this: + // The editor can update its contents, so the editor will have what the server has. + // This is the format to send the changes in: + // insert - position - text - format + // delete - position + if (good2go) { + // Determine the server's current verse content, and the editor's current verse content. + string editor_html (edited_html); + string server_html; + { + string verse_usfm = usfm_get_verse_text_quill (new_chapter_usfm, verse); + editone2_logic_editable_html (verse_usfm, stylesheet, server_html); + } + vector positions; + vector sizes; + vector operators; + vector content; + bible_logic_html_to_editor_updates (editor_html, server_html, positions, sizes, operators, content); + // Encode the condensed differences for the response to the Javascript editor. + for (size_t i = 0; i < positions.size(); i++) { + response.append ("#_be_#"); + response.append (convert_to_string (positions[i])); + response.append ("#_be_#"); + string operation = operators[i]; + response.append (operation); + if (operation == bible_logic_insert_operator ()) { + string text = content[i]; + string character = unicode_string_substr (text, 0, 1); + response.append ("#_be_#"); + response.append (character); + size_t length = unicode_string_length (text); + string format = unicode_string_substr (text, 1, length - 1); + response.append ("#_be_#"); + response.append (format); + // Also add the size of the character in UTF-16 format, 2-bytes or 4 bytes, as size 1 or 2. + response.append ("#_be_#"); + response.append (convert_to_string (sizes[i])); + } + else if (operation == bible_logic_delete_operator ()) { + // When deleting a UTF-16 character encoded in 4 bytes, + // then the size in Quilljs is 2 instead of 1. + // So always give the size when deleting a character. + response.append ("#_be_#"); + response.append (convert_to_string (sizes[i])); + } + else if (operation == bible_logic_format_paragraph_operator ()) { + response.append ("#_be_#"); + response.append (content[i]); + } + else if (operation == bible_logic_format_character_operator ()) { + response.append ("#_be_#"); + response.append (content[i]); + } + } + } + + // Things to try out in the C++ and Javacript update routines. + + // Test changing the format of the first paragraph. + + // Test changing the format of the second paragraph. + + // Test changing the format of the last paragraph. + + // Test deleting an entire paragraph. + + // Test adding a character to a formatted word, to see if the character format gets transferred properly. + + // Test that if this editor is the second or higher one in a workspace, + // it is read-only. And updating the editor's contents does not grab focus. + + // Test inserting and updating 4-byte UTF-16 characters like the 😀. + + // Test continued typing during serious network latency. + + // Test using the Cloud together with client devices with send and receive. + + bool write = access_bible_book_write (webserver_request, username, bible, book); + response = Checksum_Logic::send (response, write); + + // Ready. + //this_thread::sleep_for(chrono::seconds(60)); + return response; +} diff -Nru bibledit-5.0.912/editone2/update.h bibledit-5.0.922/editone2/update.h --- bibledit-5.0.912/editone2/update.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/update.h 2020-09-30 09:39:03.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDITONE2_UPDATE_H +#define INCLUDED_EDITONE2_UPDATE_H + + +#include + + +string editone2_update_url (); +bool editone2_update_acl (void * webserver_request); +string editone2_update (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/editone2/verse.cpp bibledit-5.0.922/editone2/verse.cpp --- bibledit-5.0.912/editone2/verse.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/verse.cpp 2020-09-27 10:11:46.000000000 +0000 @@ -0,0 +1,67 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include + + +string editone2_verse_url () +{ + return "editone2/verse"; +} + + +bool editone2_verse_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return read; +} + + +string editone2_verse (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + + // Only act if a verse was found + string sverse = request->query ["verse"]; + if (!sverse.empty ()) { + + + // Only update navigation in case the verse changed. + // This avoids unnecessary focus operations in the clients. + int iverse = convert_to_int (sverse); + if (iverse != Ipc_Focus::getVerse (request)) { + int book = Ipc_Focus::getBook (request); + int chapter = Ipc_Focus::getChapter (request); + Ipc_Focus::set (request, book, chapter, iverse); + } + + + } + + + return ""; +} diff -Nru bibledit-5.0.912/editone2/verse.h bibledit-5.0.922/editone2/verse.h --- bibledit-5.0.912/editone2/verse.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editone2/verse.h 2020-09-27 10:11:42.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDITONE2_VERSE_H +#define INCLUDED_EDITONE2_VERSE_H + + +#include + + +string editone2_verse_url (); +bool editone2_verse_acl (void * webserver_request); +string editone2_verse (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/editor/html2format.cpp bibledit-5.0.922/editor/html2format.cpp --- bibledit-5.0.912/editor/html2format.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editor/html2format.cpp 2020-11-13 16:26:41.000000000 +0000 @@ -0,0 +1,179 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +void Editor_Html2Format::load (string html) +{ + // The web editor may insert non-breaking spaces. Convert them to normal spaces. + html = filter_string_str_replace (unicode_non_breaking_space_entity (), " ", html); + + // The web editor produces
and other elements following the HTML specs, + // but the pugixml XML parser needs
and similar elements. + html = html2xml (html); + + // The user may add several spaces in sequence. Convert them to single spaces. + html = filter_string_str_replace (" ", " ", html); + html = filter_string_str_replace (" ", " ", html); + + string xml = "" + html + ""; + // Parse document such that all whitespace is put in the DOM tree. + // See http://pugixml.org/docs/manual.html for more information. + // It is not enough to only parse with parse_ws_pcdata_single, it really needs parse_ws_pcdata. + // This is significant for, for example, the space after verse numbers, among other cases. + xml_parse_result result = document.load_string (xml.c_str(), parse_ws_pcdata); + // Log parsing errors. + pugixml_utils_error_logger (&result, xml); +} + + +void Editor_Html2Format::run () +{ + preprocess (); + process (); + postprocess (); +} + + +void Editor_Html2Format::process () +{ + // Iterate over the children to retrieve the "p" elements, then process them. + xml_node body = document.first_child (); + for (xml_node node : body.children()) { + // Process the node. + processNode (node); + } +} + + +void Editor_Html2Format::processNode (xml_node node) +{ + switch (node.type ()) { + case node_element: + { + // Skip a note with class "ql-cursor" because that is an internal Quill node. + // The user didn't insert it. + string classs = node.attribute("class").value(); + if (classs == "ql-cursor") break; + // Process node normally. + openElementNode (node); + for (xml_node child : node.children()) { + processNode (child); + } + closeElementNode (node); + break; + } + case node_pcdata: + { + // Add the text with the current character format to the containers. + string text = node.text ().get (); + texts.push_back(text); + formats.push_back(current_character_format); + break; + } + default: + { + string nodename = node.name (); + Database_Logs::log ("Unknown XML node " + nodename + " while saving editor text"); + break; + } + } +} + + +void Editor_Html2Format::openElementNode (xml_node node) +{ + // The tag and class names of this element node. + string tagName = node.name (); + string className = update_quill_class (node.attribute ("class").value ()); + + if (tagName == "p") + { + // In the editor, it may occur that the p element does not have a class. + // Use the 'p' class in such a case. + if (className.empty ()) className = "p"; + texts.push_back("\n"); + formats.push_back(className); + // A new line starts: Clear the character formatting. + current_character_format.clear(); + } + + if (tagName == "span") + { + openInline (className); + } +} + + +void Editor_Html2Format::closeElementNode (xml_node node) +{ + // The tag and class names of this element node. + string tagName = node.name (); + string className = update_quill_class (node.attribute ("class").value ()); + + if (tagName == "p") + { + // While editing it happens that the p element does not have a class. + // Use the 'p' class in such cases. + if (className.empty()) className = "p"; + // Clear active character styles. + current_character_format.clear(); + } + + if (tagName == "span") + { + // End of span: Clear character formatting. + current_character_format.clear(); + } +} + + +void Editor_Html2Format::openInline (string className) +{ + current_character_format = className; +} + + +void Editor_Html2Format::preprocess () +{ + texts.clear(); + formats.clear(); +} + + +void Editor_Html2Format::postprocess () +{ +} + + +string Editor_Html2Format::update_quill_class (string classname) +{ + classname = filter_string_str_replace (quill_logic_class_prefix_block (), "", classname); + classname = filter_string_str_replace (quill_logic_class_prefix_inline (), "", classname); + return classname; +} diff -Nru bibledit-5.0.912/editor/html2format.h bibledit-5.0.922/editor/html2format.h --- bibledit-5.0.912/editor/html2format.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editor/html2format.h 2020-10-03 15:59:43.000000000 +0000 @@ -0,0 +1,53 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDITOR_HTML2FORMAT_H +#define INCLUDED_EDITOR_HTML2FORMAT_H + + +#include +#include +#include + + +using namespace pugi; + + +class Editor_Html2Format +{ +public: + void load (string html); + void run (); + vector texts; + vector formats; +private: + xml_document document; // DOMDocument holding the html. + void preprocess (); + void postprocess (); + void process (); + void processNode (xml_node node); + void openElementNode (xml_node node); + void closeElementNode (xml_node node); + void openInline (string className); + string update_quill_class (string classname); + string current_character_format; +}; + + +#endif diff -Nru bibledit-5.0.912/editor/html2usfm.cpp bibledit-5.0.922/editor/html2usfm.cpp --- bibledit-5.0.912/editor/html2usfm.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editor/html2usfm.cpp 2020-11-13 16:27:16.000000000 +0000 @@ -86,13 +86,6 @@ } -// Enable styles suitable for Quill-based editor. -void Editor_Html2Usfm::quill () -{ - quill_enabled = true; -} - - void Editor_Html2Usfm::run () { preprocess (); @@ -108,11 +101,9 @@ for (xml_node node : body.children()) { // Do not process the notes
or

and beyond // because it is at the end of the text body, - // and data has already been gleaned from it. - string id_or_class; - if (quill_enabled) id_or_class = update_quill_class (node.attribute ("class").value ()); - else id_or_class = node.attribute ("id").value (); - if (id_or_class == "notes") break; + // and note-related data has already been extracted from it. + string classs = update_quill_class (node.attribute ("class").value ()); + if (classs == "notes") break; // Process the node. processNode (node); } @@ -135,6 +126,11 @@ switch (node.type ()) { case node_element: { + // Skip a note with class "ql-cursor" because that is an internal Quill node. + // The user didn't insert it. + string classs = node.attribute("class").value(); + if (classs == "ql-cursor") break; + // Process this node. openElementNode (node); for (xml_node child : node.children()) { processNode (child); @@ -239,9 +235,7 @@ // Do nothing if no endmarkers are supposed to be produced. if (suppressEndMarkers.find (className) != suppressEndMarkers.end()) return; // Add closing USFM, optionally closing embedded tags in reverse order. - char separator; - if (quill_enabled) separator = '0'; - else separator = ' '; + char separator = '0'; vector classes = filter_string_explode (className, separator); characterStyles = filter_string_array_diff (characterStyles, classes); reverse (classes.begin(), classes.end()); @@ -266,9 +260,7 @@ // The // Lord God // is calling you. - char separator; - if (quill_enabled) separator = '0'; - else separator = ' '; + char separator = '0'; vector classes = filter_string_explode (className, separator); for (unsigned int offset = 0; offset < classes.size(); offset++) { bool embedded = (characterStyles.size () + offset) > 0; @@ -298,63 +290,51 @@ void Editor_Html2Usfm::processNoteCitation (xml_node node) { - // Remove the note citation from the text. + // Remove the note citation from the main text body. // It means that this: - // 1 - // becomes this: - // - // Or in case of a Quill-enabled editor, it means that this: // 1 // becomes this: // xml_node child = node.first_child (); node.remove_child (child); - // Get more information about the footnote to retrieve. - string id; - if (quill_enabled) { - // - id = node.attribute ("class").value (); - id = filter_string_str_replace ("call", "body", id); - } else { - // - string href = node.attribute ("href").value (); - id = href.substr (1); - } + // Get more information about the note to retrieve. + // + string id = node.attribute ("class").value (); + id = filter_string_str_replace ("call", "body", id); // Sample footnote body. - //

x + 2 Joh. 1.1

+ //

1 + notetext

// Retrieve the element from it. - // At first this was done through an XPath expression: + // This was initially done through an XPath expression: // http://www.grinninglizard.com/tinyxml2docs/index.html - // But XPath crashes on Android with libxml2. - // Therefore now it iterates over all the nodes to find the required element. + // But XPath crashed on Android with libxml2. + // Therefore now it iterates over all the nodes to find the required element. // After moving to pugixml, the XPath expression could have been used again, but this was not done. - xml_node a_span_element = get_note_pointer (document.first_child (), id); - if (a_span_element) { + xml_node note_p_element = get_note_pointer (document.first_child (), id); + if (note_p_element) { - // It now has the or . - // Get its

parent, and then remove that or element. + // It now has the

. + // Remove the first element. // So we remain with: //

+ 2 Joh. 1.1

- xml_node pElement = a_span_element.parent (); - pElement.remove_child (a_span_element); - + note_p_element.remove_child (note_p_element.first_child()); + // Preserve active character styles in the main text, and reset them for the note. vector preservedCharacterStyles = characterStyles; characterStyles.clear(); // Process this 'p' element. processingNote = true; - processNode (pElement); + processNode (note_p_element); processingNote = false; // Restore the active character styles for the main text. characterStyles = preservedCharacterStyles; // Remove this element so it can't be processed again. - xml_node parent = pElement.parent (); - parent.remove_child (pElement); + xml_node parent = note_p_element.parent (); + parent.remove_child (note_p_element); } else { Database_Logs::log ("Discarding note with id " + id); @@ -405,43 +385,68 @@ // Retrieves a pointer to a relevant footnote element in the XML. -xml_node Editor_Html2Usfm::get_note_pointer (xml_node node, string id) +xml_node Editor_Html2Usfm::get_note_pointer (xml_node body, string id) { - if (node) { + // The note wrapper node to look for. + xml_node p_note_wrapper; - string name = node.name (); - string note_id; - if (quill_enabled) { - // - if (name == "span") { - note_id = node.attribute ("class").value (); - } - } else { - // - if (name == "a") { - note_id = node.attribute ("id").value (); + // Check that there's a node to start with. + if (!body) return p_note_wrapper; + + // Assert that the node is given. + if (string(body.name ()) != "body") return p_note_wrapper; + + // Some of the children of the node will be the note wrappers. + // Consider this XML: + // + //

text

+ //

+ //

1 + foot

+ //

note

+ // + // There is node

. + // Any children of following the above node are all note wrappers. + // Here the code is going to get the correct note wrapper node. + // In addition to finding the correct p node, it also looks for subsequent p nodes + // that belong to the main p node. + // See issue https://github.com/bibledit/cloud/issues/444. + // It handles a situation that the user presses while in a note. + // The solution is to include the next p node too if it belongs to the correct note wrapper p node. + bool within_matching_p_node = false; + for (xml_node p_body_child : body.children ()) { + xml_node span_notebody = p_body_child.first_child(); + string name = span_notebody.name (); + if (name == "span") { + string classs = span_notebody.attribute ("class").value (); + if (classs.substr (0, 10) == id.substr(0, 10)) { + if (classs == id) { + within_matching_p_node = true; + } else { + within_matching_p_node = false; + } } } - if (id == note_id) return node; - - for (xml_node child : node.children ()) { - xml_node note = get_note_pointer (child, id); - if (note) return note; + if (within_matching_p_node) { + if (!p_note_wrapper) { + p_note_wrapper = p_body_child; + } else { + for (xml_node child = p_body_child.first_child(); child; child = child.next_sibling()) { + p_note_wrapper.append_copy(child); + } + } } - } - - xml_node null_node; - return null_node; + + // If a note wrapper was found, return that. + // If nothing was found, the note wrapper is null. + return p_note_wrapper; } string Editor_Html2Usfm::update_quill_class (string classname) { - if (quill_enabled) { - classname = filter_string_str_replace (quill_logic_class_prefix_block (), "", classname); - classname = filter_string_str_replace (quill_logic_class_prefix_inline (), "", classname); - } + classname = filter_string_str_replace (quill_logic_class_prefix_block (), "", classname); + classname = filter_string_str_replace (quill_logic_class_prefix_inline (), "", classname); return classname; } @@ -491,7 +496,6 @@ Editor_Html2Usfm editor_export; editor_export.load (html); editor_export.stylesheet (stylesheet); - editor_export.quill (); editor_export.run (); string usfm = editor_export.get (); diff -Nru bibledit-5.0.912/editor/html2usfm.h bibledit-5.0.922/editor/html2usfm.h --- bibledit-5.0.912/editor/html2usfm.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editor/html2usfm.h 2020-11-12 20:17:10.000000000 +0000 @@ -34,7 +34,6 @@ public: void load (string html); void stylesheet (string stylesheet); - void quill (); void run (); string get (); private: @@ -58,8 +57,7 @@ void openInline (string className); void processNoteCitation (xml_node node); string cleanUSFM (string usfm); - xml_node get_note_pointer (xml_node node, string id); - bool quill_enabled = false; + xml_node get_note_pointer (xml_node body, string id); string update_quill_class (string classname); }; diff -Nru bibledit-5.0.912/editor/id.cpp bibledit-5.0.922/editor/id.cpp --- bibledit-5.0.912/editor/id.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editor/id.cpp 2020-11-21 18:52:13.000000000 +0000 @@ -0,0 +1,60 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +string editor_id_url () +{ + return "editor/id"; +} + + +bool editor_id_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return read; +} + + +string editor_id (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + + // Update the timestamp indicating that the Bible editor is alive. + request->database_config_user()->setLiveBibleEditor (filter_date_seconds_since_epoch ()); + + + string bible = request->query ["bible"]; + int book = convert_to_int (request->query ["book"]); + int chapter = convert_to_int (request->query ["chapter"]); + int id = request->database_bibles()->getChapterId (bible, book, chapter); + return convert_to_string (id); +} diff -Nru bibledit-5.0.912/editor/id.h bibledit-5.0.922/editor/id.h --- bibledit-5.0.912/editor/id.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editor/id.h 2020-11-21 18:52:20.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDITOR_ID_H +#define INCLUDED_EDITOR_ID_H + + +#include + + +string editor_id_url (); +bool editor_id_acl (void * webserver_request); +string editor_id (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/editor/select.cpp bibledit-5.0.922/editor/select.cpp --- bibledit-5.0.912/editor/select.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editor/select.cpp 2020-11-21 21:02:54.000000000 +0000 @@ -28,7 +28,7 @@ #include #include

#include -#include +#include #include @@ -67,10 +67,10 @@ } } - if (editone_index_acl (webserver_request)) { + if (editone2_index_acl (webserver_request)) { if (menu_logic_editor_enabled (webserver_request, true, false)) { string label = menu_logic_editor_menu_text (true, false); - string url = editone_index_url (); + string url = editone2_index_url (); view.add_iteration ("editor", { make_pair ("url", url), make_pair ("label", label) } ); urls.push_back (url); } diff -Nru bibledit-5.0.912/editor/style.cpp bibledit-5.0.922/editor/style.cpp --- bibledit-5.0.912/editor/style.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editor/style.cpp 2020-11-21 19:49:23.000000000 +0000 @@ -0,0 +1,64 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include + + +string editor_style_url () +{ + return "editor/style"; +} + + +bool editor_style_acl (void * webserver_request) +{ + if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; + bool read, write; + access_a_bible (webserver_request, read, write); + return read; +} + + +string editor_style (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + + + if (request->query.count ("style")) { + string style = request->query["style"]; + Editor_Styles::recordUsage (request, style); + string action = Editor_Styles::getAction (request, style); + return style + "\n" + action; + } + + + if (request->query.count ("all")) { + return Editor_Styles::getAll (request); + } + + + return Editor_Styles::getRecentlyUsed (request); +} + diff -Nru bibledit-5.0.912/editor/style.h bibledit-5.0.922/editor/style.h --- bibledit-5.0.912/editor/style.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/editor/style.h 2020-11-21 19:13:37.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDITOR_STYLE_H +#define INCLUDED_EDITOR_STYLE_H + + +#include + + +string editor_style_url (); +bool editor_style_acl (void * webserver_request); +string editor_style (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/editor/usfm2html.cpp bibledit-5.0.922/editor/usfm2html.cpp --- bibledit-5.0.912/editor/usfm2html.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editor/usfm2html.cpp 2020-11-13 17:17:13.000000000 +0000 @@ -62,13 +62,6 @@ } -// Enable styles suitable for Quill-based editor. -void Editor_Usfm2Html::quill () -{ - quill_enabled = true; -} - - void Editor_Usfm2Html::run () { preprocess (); @@ -79,6 +72,8 @@ string Editor_Usfm2Html::get () { + closeParagraph (); + // If there are notes, move the notes
or

after everything else. // (It has the


or
as a child). size_t count = distance (notes_node.begin (), notes_node.end ()); @@ -87,11 +82,9 @@ } // A Quill-based editor does not work with embedded

elements. - // Move the notes out of their parent and append them to the end main body. - if (quill_enabled) { - while (xml_node note = notes_node.first_child ().next_sibling ()) { - body_node.append_move (note); - } + // Move the notes out of their parent and append them to the end of the main body. + while (xml_node note = notes_node.first_child ().next_sibling ()) { + body_node.append_move (note); } // Get the html code, including body, without head. @@ -108,20 +101,6 @@ html.erase (pos); } } - - // Deal with a blank line. - // The \b in USFM, a blank line, gets converted to: - //

- // But this does not display a blank in the web browser. - // Therefore convert it to the following: - //


- // This is how the webkit browser naturally represents a new empty line. - // Also do the other markers similar to the blank line. - vector blank_lines = { "b", "sd", "sd1", "sd2", "sd3", "sd4" }; - for (auto clas : blank_lines) { - if (quill_enabled) clas.insert (0, quill_logic_class_prefix_block ()); - html = filter_string_str_replace ("

", "


", html); - } // Currently the XML library produces hexadecimal character entities. // This is unwanted behaviour: Convert them to normal characters. @@ -153,23 +132,17 @@ // It comes at the start of the document. // (Later, it will either be deleted, or moved to the end). string notes_value = "notes"; - if (quill_enabled) { - notes_node = document.append_child ("p"); - notes_value.insert (0, quill_logic_class_prefix_block ()); - notes_node.append_attribute ("class") = notes_value.c_str (); - notes_node.append_child ("br"); - } else { - notes_node = document.append_child ("div"); - notes_node.append_attribute ("id") = notes_value.c_str (); - notes_node.append_child ("hr"); - } + notes_node = document.append_child ("p"); + notes_value.insert (0, quill_logic_class_prefix_block ()); + notes_node.append_attribute ("class") = notes_value.c_str (); + notes_node.text().set(non_breaking_space_u00A0().c_str()); } - + void Editor_Usfm2Html::process () { markersAndTextPointer = 0; - unsigned int markersAndTextCount = markersAndText.size(); + size_t markersAndTextCount = markersAndText.size(); for (markersAndTextPointer = 0; markersAndTextPointer < markersAndTextCount; markersAndTextPointer++) { string currentItem = markersAndText[markersAndTextPointer]; if (usfm_is_usfm_marker (currentItem)) @@ -210,6 +183,7 @@ case StyleTypeStartsParagraph: { closeTextStyle (false); + closeParagraph (); newParagraph (marker); break; } @@ -230,6 +204,7 @@ case StyleTypeChapterNumber: { closeTextStyle (false); + closeParagraph (); newParagraph (marker); break; } @@ -418,6 +393,7 @@ // Output the marker in monospace font. if (isOpeningMarker) { // Add opening marker as it is. + closeParagraph (); newParagraph ("mono"); addText (usfm_get_opening_usfm (marker)); } else { @@ -429,24 +405,38 @@ void Editor_Usfm2Html::newParagraph (string style) { - currentPnode = body_node.append_child ("p"); + // Handle new paragraph. + current_p_node = body_node.append_child ("p"); current_p_open = true; if (!style.empty()) { string style2 (style); - if (quill_enabled) style2.insert (0, quill_logic_class_prefix_block ()); - currentPnode.append_attribute ("class") = style2.c_str(); + style2.insert (0, quill_logic_class_prefix_block ()); + current_p_node.append_attribute ("class") = style2.c_str(); } currentParagraphStyle = style; currentParagraphContent.clear(); // A Quill-based editor assigns a length of one to a new line. - if (quill_enabled) { - // Skip the first line. - if (first_line_done) textLength++; - } + // Skip the first line. + if (first_line_done) textLength++; first_line_done = true; } +void Editor_Usfm2Html::closeParagraph () +{ + // Deal with a blank line. + // If the paragraph is empty, add a
to it. + // This is how the Quill editor naturally represents a new empty line. + // This causes that empty paragraph to be displayed properly in the Quill editor. + // This
is also needed for live editor updates. + if (current_p_open) { + if (currentParagraphContent.empty()) { + current_p_node.append_child("br"); + } + } +} + + // This opens a text style. // $style: the array containing the style variables. // $embed: boolean: Whether to open embedded / nested style. @@ -485,7 +475,7 @@ if (!current_p_open) { newParagraph (); } - xml_node spanDomElement = currentPnode.append_child ("span"); + xml_node spanDomElement = current_p_node.append_child ("span"); spanDomElement.text ().set (text.c_str()); if (!currentTextStyles.empty ()) { // Take character style(s) as specified in this object. @@ -498,12 +488,11 @@ // That causes the whole class to be removed. // Right now the way to deal with a class with two styles is like this "i-add0nd". // It has one hyphen. And a "0" to separate the two styles. - if (quill_enabled) textstyle.append ("0"); - else textstyle.append (" "); + textstyle.append ("0"); } textstyle.append (style); } - if (quill_enabled) textstyle.insert (0, quill_logic_class_prefix_inline ()); + textstyle.insert (0, quill_logic_class_prefix_inline ()); spanDomElement.append_attribute ("class") = textstyle.c_str(); } currentParagraphContent.append (text); @@ -536,31 +525,19 @@ noteOpened = true; // Add the link with all relevant data for the note citation. - if (quill_enabled) { - addNoteQuillLink (currentPnode, noteCount, "call", citation); - } else { - string reference = "#note" + convert_to_string (noteCount); - string identifier = "citation" + convert_to_string (noteCount); - addNoteDomLink (currentPnode, reference, identifier, "superscript", citation); - } + addNotelLink (current_p_node, noteCount, "call", citation); // Open a paragraph element for the note body. notePnode = notes_node.append_child ("p"); note_p_open = true; string cls (style); - if (quill_enabled) cls.insert (0, quill_logic_class_prefix_block ()); + cls.insert (0, quill_logic_class_prefix_block ()); notePnode.append_attribute ("class") = cls.c_str(); closeTextStyle (false); // Add the link with all relevant data for the note body. - if (quill_enabled) { - addNoteQuillLink (notePnode, noteCount, "body", citation); - } else { - string reference = "#citation" + convert_to_string (noteCount); - string identifier = "note" + convert_to_string (noteCount); - addNoteDomLink (notePnode, reference, identifier, "", citation); - } + addNotelLink (notePnode, noteCount, "body", citation); // Add a space. addNoteText (" "); @@ -583,14 +560,8 @@ if (!currentNoteTextStyles.empty()) { // Take character style(s) as specified in this object. string classs; - if (quill_enabled) { - classs = filter_string_implode (currentNoteTextStyles, "0"); - } else { - classs = filter_string_implode (currentNoteTextStyles, " "); - } - if (quill_enabled) { - classs.insert (0, quill_logic_class_prefix_inline ()); - } + classs = filter_string_implode (currentNoteTextStyles, "0"); + classs.insert (0, quill_logic_class_prefix_inline ()); spanDomElement.append_attribute ("class") = classs.c_str(); } } @@ -608,36 +579,11 @@ // This adds a link as a mechanism to connect body text with a note body. // $domNode: The DOM node where to add the link to. -// $reference: The link's href, e.g. where it links to. -// $identifier: The link's identifier. Others can link to it. -// $style: The link text's style. -// $text: The link's text. -// It also deals with a Quill-based editor, in a slightly different way. -void Editor_Usfm2Html::addNoteDomLink (xml_node domNode, string reference, string identifier, string style, string text) -{ - xml_node aDomElement = domNode.append_child ("a"); - aDomElement.append_attribute ("href") = reference.c_str(); - aDomElement.append_attribute ("id") = identifier.c_str(); - // The link itself, for the notes, is not editable, so it can be clicked. - // It was disabled again due to Chrome removing content on backspace. - // $aDomElement->setAttribute ("contenteditable", "false"); - // Remove the blue color from the link, and the underline. - // The reason for this is that, if the blue and underline are there, people expect one can click on it. - // Clicking it does nothing. Therefore it's better to remove the typical link style. - aDomElement.append_attribute ("style") = "text-decoration:none; color: inherit;"; - // Style = class. - if (style != "") aDomElement.append_attribute ("class") = style.c_str(); - aDomElement.text ().set (text.c_str()); -} - - -// This adds a link as a mechanism to connect body text with a note body. -// $domNode: The DOM node where to add the link to. // $identifier: The link's identifier. // $style: A style for the note citation, and one for the note body. // $text: The link's text. // It also deals with a Quill-based editor, in a slightly different way. -void Editor_Usfm2Html::addNoteQuillLink (xml_node domNode, int identifier, string style, string text) +void Editor_Usfm2Html::addNotelLink (xml_node domNode, int identifier, string style, string text) { xml_node aDomElement = domNode.append_child ("span"); string cls = "i-note" + style + convert_to_string (identifier); diff -Nru bibledit-5.0.912/editor/usfm2html.h bibledit-5.0.922/editor/usfm2html.h --- bibledit-5.0.912/editor/usfm2html.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editor/usfm2html.h 2020-11-09 20:01:09.000000000 +0000 @@ -34,7 +34,6 @@ public: void load (string usfm); void stylesheet (string stylesheet); - void quill (); void run (); string get (); size_t textLength; @@ -56,7 +55,7 @@ string standardContentMarkerFootEndNote; string standardContentMarkerCrossReference; - xml_node currentPnode; // The current p node. + xml_node current_p_node; // The current p node. bool current_p_open = false; vector currentTextStyles; @@ -69,7 +68,6 @@ bool noteOpened = false; // Lengths and offsets. - bool quill_enabled = false; bool first_line_done = false; void preprocess (); @@ -77,14 +75,14 @@ void postprocess (); void outputAsIs (string marker, bool isOpeningMarker); void newParagraph (string style = ""); + void closeParagraph (); void openTextStyle (Database_Styles_Item & style, bool embed); void closeTextStyle (bool embed); void addText (string text); void addNote (string citation, string style, bool endnote = false); void addNoteText (string text); void closeCurrentNote (); - void addNoteDomLink (xml_node domNode, string reference, string identifier, string style, string text); - void addNoteQuillLink (xml_node domNode, int identifier, string style, string text); + void addNotelLink (xml_node domNode, int identifier, string style, string text); bool roadIsClear (); }; diff -Nru bibledit-5.0.912/editusfm/index.js bibledit-5.0.922/editusfm/index.js --- bibledit-5.0.912/editusfm/index.js 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/editusfm/index.js 2020-11-13 18:51:37.000000000 +0000 @@ -149,6 +149,7 @@ // https://github.com/bibledit/cloud/issues/346 usfmLoadDate = new Date(); var seconds = (usfmLoadDate.getTime() - usfmSaveDate.getTime()) / 1000; + seconds = 2; // Disable timer. if ((seconds < 2) | usfmReload) { if (usfmEditorWriteAccess) usfmEditorReloadAlert (usfmEditorVerseUpdatedLoaded); } @@ -173,6 +174,9 @@ function usfmEditorSaveChapter (sync) { + // Fix for https://github.com/bibledit/cloud/issues/427 + usfmEditorStatus (""); + if (usfmSaving) { usfmEditorChanged (); return; @@ -211,6 +215,7 @@ usfmSaving = false; usfmSaveDate = new Date(); var seconds = (usfmSaveDate.getTime() - usfmLoadDate.getTime()) / 1000; + seconds = 2; // Disable timer. if (seconds < 2) { if (usfmEditorWriteAccess) usfmEditorReloadAlert (usfmEditorVerseUpdatedLoaded); } @@ -246,6 +251,7 @@ if (message == usfmEditorWillSave) return; if (message == usfmEditorChapterSaving) return; if (message == usfmEditorChapterSaved) return; + if (message == "") return; notifyItError (message); } diff -Nru bibledit-5.0.912/filter/diff.cpp bibledit-5.0.922/filter/diff.cpp --- bibledit-5.0.912/filter/diff.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/filter/diff.cpp 2020-11-08 15:10:21.000000000 +0000 @@ -36,11 +36,18 @@ using dtl::Diff; -// This filter returns the diff of two input strngs. +static mutex filter_diff_mutex; + + +// This filter returns the diff of two input strings. // $oldstring: The old string for input. // $newstring: The new string for input. // The function returns the differences marked. -string filter_diff_diff (string oldstring, string newstring) +// If the containers for $removals and $additions are given, +// they will be filled with the appropriate text fragments. +string filter_diff_diff (string oldstring, string newstring, + vector * removals, + vector * additions) { // Save the new lines. string newline = " newline_newline_newline "; @@ -56,8 +63,7 @@ // It is unclear at this time whether the code below // to find the differences between texts, is thread-safe. // So just to be sure, a mutex is placed around it. - static mutex mutex1; - lock_guard lock(mutex1); + filter_diff_mutex.lock(); // Run the diff engine. Diff diff (old_sequence, new_sequence); @@ -67,7 +73,7 @@ stringstream result; diff.printSES (result); - mutex1.unlock(); + filter_diff_mutex.unlock(); // Add html markup for bold and strikethrough. vector output = filter_string_explode (result.str (), '\n'); @@ -76,10 +82,12 @@ char indicator = line.front (); line.erase (0, 1); if (indicator == '+') { + if (additions) additions->push_back (line); line.insert (0, " "); line.append (" "); } if (indicator == '-') { + if (removals) removals->push_back(line); line.insert (0, " "); line.append (" "); } @@ -95,6 +103,117 @@ } +// This filter returns the diff of two input vector's. +// $old: The old vector for input. +// $new: The new vector for input. +// +// The function produces information, +// that if applied to the old input, will produce the new input. +// This information consists of positions +// for addition or deletion operators, +// and if an addition, which content to add. +// +// Most UTF-8 characters in common use fit within two bytes when encoded in UTF-16. +// Javascript works with UTF-16. +// Also the Quilljs editor works with UTF-16. +// The positions in the Quill editor are influenced by +// whether the character is represented by 2 bytes in UTF-16, or by 4 bytes. +// A 2-byte UTF-16 character when inserted increases the position by 1. +// A 4-byte UTF-16 character when inserted increases the position by 2. +// When deleting a 4-byte UTF-16 character, the Quill API deletes 2 positions. +// +// The C++ server works with UTF-8. +// So there is a need for some translation in positios between UTF-8 in C++ and UTF-16 in Javascript. +// This function gives the positions as related to UTF-16. +// That means that characters that fit in 2-byte UTF-16 give their positions as 1. +// Those that fit in 4-byte UTF-16 give their positions as 2. +// Each differing character is given a size of 1 or 2 accordingly. +void filter_diff_diff_utf16 (const vector & oldinput, const vector & newinput, + vector & positions, + vector & sizes, + vector & additions, + vector & content, + int & new_line_diff_count) +{ + // Clear anything from the output containers just to be sure. + positions.clear(); + sizes.clear(); + additions.clear(); + content.clear(); + + // Start with zero changes in a new line. + new_line_diff_count = 0; + + // The sequences to compare. + vector old_sequence = oldinput; + vector new_sequence = newinput; + + // Save the new lines. + string newline = "_newline_"; + for (auto & s : old_sequence) { + s = filter_string_str_replace ("\n", newline, s); + } + for (auto & s : new_sequence) { + s = filter_string_str_replace ("\n", newline, s); + } + + // Run the diff engine. + Diff diff (old_sequence, new_sequence); + diff.compose(); + + // Get the shortest edit distance. + stringstream result; + diff.printSES (result); + + // Convert the new line place holder back to the original new line. + vector differences = filter_string_explode (result.str (), '\n'); + for (auto & s : differences) { + s = filter_string_str_replace (newline, "\n", s); + } + + // Convert the additions and deletions to a change set. + int position = 0; + for (auto & line : differences) { + if (line.empty ()) continue; + char indicator = line.front (); + line.erase (0, 1); + // Get the size of the character in UTF-16, whether 1 or 2. + string utf8 = unicode_string_substr (line, 0, 1); + u16string utf16 = convert_to_u16string (utf8); + size_t size = utf16.length(); + if (indicator == '+') { + // Something to be inserted into the old sequence to get at the new sequence. + positions.push_back(position); + sizes.push_back((int)size); + additions.push_back(true); + content.push_back(line); + // Something was inserted. + // So increase the position to point to the next offset in the sequence from where to proceed. + position += size; + // Check on number of changes in paragraphs. + if (line.substr(0, 1) == "\n") new_line_diff_count++; + } + else if (indicator == '-') { + // Something to be deleted at the given position. + positions.push_back(position); + sizes.push_back((int)size); + additions.push_back(false); + content.push_back(line); + // Something was deleted. + // So the position will remain to point to the same offset in the sequence from where to proceed. + // Check on number of changes in paragraphs. + if (line.substr(0, 1) == "\n") new_line_diff_count++; + } + else { + // No difference. + // Increase the position of the subsequent edit + // with the amount of 16-bits code points of the current text bit in UTF-16. + position += size; + } + } +} + + // This calculates the similarity between the old and new strings. // It works at the character level. // It returns the similarity as a percentage. @@ -121,8 +240,7 @@ // It is unclear at this time whether the code below // to find the differences between texts, is thread-safe. // So just to be sure, a mutex is placed around it. - static mutex mutex1; - lock_guard lock(mutex1); + filter_diff_mutex.lock(); // Run the diff engine. Diff diff (old_sequence, new_sequence); @@ -132,7 +250,7 @@ stringstream result; diff.printSES (result); - mutex1.unlock(); + filter_diff_mutex.unlock(); // Calculate the total elements compared, and the total differences found. int element_count = 0; @@ -178,8 +296,7 @@ // It is unclear at this time whether the code below // to find the differences between texts, is thread-safe. // So just to be sure, a mutex is placed around it. - static mutex mutex1; - lock_guard lock(mutex1); + filter_diff_mutex.lock(); // Run the diff engine. Diff diff (old_sequence, new_sequence); @@ -189,7 +306,7 @@ stringstream result; diff.printSES (result); - mutex1.unlock(); + filter_diff_mutex.unlock(); // Calculate the total elements compared, and the total differences found. int element_count = 0; diff -Nru bibledit-5.0.912/filter/diff.h bibledit-5.0.922/filter/diff.h --- bibledit-5.0.912/filter/diff.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/filter/diff.h 2020-11-04 14:05:20.000000000 +0000 @@ -24,7 +24,15 @@ #include -string filter_diff_diff (string oldstring, string newstring); +string filter_diff_diff (string oldstring, string newstring, + vector * removals = nullptr, + vector * additions = nullptr); +void filter_diff_diff_utf16 (const vector & oldinput, const vector & newinput, + vector & positions, + vector & sizes, + vector & additions, + vector & content, + int & new_line_diff_count); int filter_diff_character_similarity (string oldstring, string newstring); int filter_diff_word_similarity (string oldstring, string newstring); void filter_diff_produce_verse_level (string bible, string directory); diff -Nru bibledit-5.0.912/filter/merge.cpp bibledit-5.0.922/filter/merge.cpp --- bibledit-5.0.912/filter/merge.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/filter/merge.cpp 2020-11-08 14:38:58.000000000 +0000 @@ -29,6 +29,9 @@ using namespace pugi; +static mutex filter_merge_mutex; + + // This uses the dtl:: library for merge in C++. // At times the library failed to merge. // It was tried whether the Linux "merge" command was able to successfully merge such cases. @@ -46,8 +49,7 @@ // It is unclear at this time whether the code below // to find the differences between texts, is thread-safe. // So just to be sure, a mutex is placed around it. - static mutex mutex1; - lock_guard lock(mutex1); + filter_merge_mutex.lock(); vector user_sequence (user); vector base_sequence (base); @@ -55,7 +57,9 @@ Diff3 > diff3 (user_sequence, base_sequence, server_sequence); diff3.compose (); - if (!diff3.merge ()) { + bool merged = diff3.merge (); + filter_merge_mutex.unlock(); + if (!merged) { return {}; } return diff3.getMergedSequence (); diff -Nru bibledit-5.0.912/filter/string.cpp bibledit-5.0.922/filter/string.cpp --- bibledit-5.0.912/filter/string.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/filter/string.cpp 2020-11-15 19:26:16.000000000 +0000 @@ -229,6 +229,15 @@ } +u16string convert_to_u16string (string s) +{ + wstring_convert , char16_t> utf16conv; + u16string utf16 = utf16conv.from_bytes (s); + // utf16.length() + return utf16; +} + + // A C++ equivalent for PHP's array_unique function. vector array_unique (vector values) { diff -Nru bibledit-5.0.912/filter/string.h bibledit-5.0.922/filter/string.h --- bibledit-5.0.912/filter/string.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/filter/string.h 2020-10-31 15:30:08.000000000 +0000 @@ -44,6 +44,7 @@ float convert_to_float (string s); bool convert_to_bool (string s); string convert_to_true_false (bool b); +u16string convert_to_u16string (string s); vector array_unique (vector values); vector array_unique (vector values); vector filter_string_array_diff (vector from, vector against); @@ -120,4 +121,5 @@ string crlf2lf (string str); string filter_text_html_get_element (string html, string element); + #endif diff -Nru bibledit-5.0.912/help/changelog.html bibledit-5.0.922/help/changelog.html --- bibledit-5.0.912/help/changelog.html 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/help/changelog.html 2020-11-22 14:21:20.000000000 +0000 @@ -1,5 +1,17 @@

ChangeLog

+

5.0.921: Verse editor no longer reloads text, but updates existing text instead.

+

5.0.920: Fix: Tapping a non-focused verse focuses that verse in the verse editor.

+

5.0.919: Bibledit Windows can receive the focused passage from Paratext.

+

5.0.918: Insert footnote template without the | separator(s).

+

5.0.918: Better sorting of consultation notes order.

+

5.0.918: Slightly larger arrows for going a verse back and a verse forward.

+

5.0.917: Fixed: Pasting text into the chapter editor causes loss of focus.

+

5.0.917: The "Text reloaded" message was disabled in the chapter editor.

+

5.0.917: Fixed: Note text after a new line in a footnote disappears.

+

5.0.916: A working beta version of live updatable verse editor.

+

5.0.914: The timed "Text reloaded" messages no longer pop up in the Bible editors.

+

5.0.913: The Quill editing library was updated to version 1.3.6.

5.0.912: Fixed: Bad network connection causes "Text reloaded" messages in Bible editors.

5.0.909: Fixed: Sends email "Check whether Bible text was saved" even if the changes consist of whitespace only.

5.0.908: A setting for using a dot or a colon as the verse separator for Bible notes entry.

diff -Nru bibledit-5.0.912/help/installcloudsourcedebian.html bibledit-5.0.922/help/installcloudsourcedebian.html --- bibledit-5.0.912/help/installcloudsourcedebian.html 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/help/installcloudsourcedebian.html 2020-11-06 18:54:14.000000000 +0000 @@ -7,11 +7,11 @@
  • translate("Open a terminal.")
  • translate("Update the software sources:")

    -

    sudo apt-get update

    +

    sudo apt update

  • translate("Install the software Bibledit relies on:")

    -

    sudo apt-get install build-essential autotools-dev autoconf autoconf-archive git zip pkgconf libcurl4-openssl-dev libssl-dev poppler-utils libsword-utils diatheke ldap-utils libmimetic-dev certbot

    +

    sudo apt install build-essential autotools-dev autoconf autoconf-archive git zip pkgconf libcurl4-openssl-dev libssl-dev poppler-utils libsword-utils diatheke ldap-utils libmimetic-dev certbot

  • diff -Nru bibledit-5.0.912/locale/logic.cpp bibledit-5.0.922/locale/logic.cpp --- bibledit-5.0.912/locale/logic.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/locale/logic.cpp 2020-10-07 12:21:37.000000000 +0000 @@ -176,6 +176,18 @@ } +string locale_logic_text_updating () +{ + return translate ("Updating..."); +} + + +string locale_logic_text_updated () +{ + return translate ("Updated"); +} + + string locale_logic_text_saving () { return translate ("Saving..."); diff -Nru bibledit-5.0.912/locale/logic.h bibledit-5.0.922/locale/logic.h --- bibledit-5.0.912/locale/logic.h 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/locale/logic.h 2020-10-08 18:35:08.000000000 +0000 @@ -33,6 +33,8 @@ string locale_logic_text_loaded (); string locale_logic_text_will_save (); +string locale_logic_text_updating (); +string locale_logic_text_updated (); string locale_logic_text_saving (); string locale_logic_text_saved (); string locale_logic_text_retrying (); diff -Nru bibledit-5.0.912/Makefile.am bibledit-5.0.922/Makefile.am --- bibledit-5.0.912/Makefile.am 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/Makefile.am 2020-12-04 20:31:56.000000000 +0000 @@ -182,14 +182,17 @@ compare/index.cpp \ compare/compare.cpp \ jobs/index.cpp \ - editone/index.cpp \ - editone/load.cpp \ - editone/save.cpp \ - editone/verse.cpp \ - editone/logic.cpp \ + redirect/index.cpp \ + editone2/index.cpp \ + editone2/load.cpp \ + editone2/save.cpp \ + editone2/verse.cpp \ + editone2/logic.cpp \ + editone2/update.cpp \ navigation/passage.cpp \ navigation/update.cpp \ navigation/poll.cpp \ + navigation/paratext.cpp \ ipc/focus.cpp \ ipc/notes.cpp \ checksum/logic.cpp \ @@ -202,6 +205,9 @@ editor/html2usfm.cpp \ editor/usfm2html.cpp \ editor/select.cpp \ + editor/html2format.cpp \ + editor/id.cpp \ + editor/style.cpp \ edit/edit.cpp \ edit/id.cpp \ edit/index.cpp \ @@ -212,6 +218,15 @@ edit/preview.cpp \ edit/position.cpp \ edit/navigate.cpp \ + edit2/edit.cpp \ + edit2/index.cpp \ + edit2/load.cpp \ + edit2/save.cpp \ + edit2/logic.cpp \ + edit2/preview.cpp \ + edit2/position.cpp \ + edit2/navigate.cpp \ + edit2/update.cpp \ search/all.cpp \ search/index.cpp \ search/replace.cpp \ diff -Nru bibledit-5.0.912/Makefile.in bibledit-5.0.922/Makefile.in --- bibledit-5.0.912/Makefile.in 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/Makefile.in 2020-12-04 20:31:59.000000000 +0000 @@ -206,32 +206,40 @@ versification/index.$(OBJEXT) versification/system.$(OBJEXT) \ versification/logic.$(OBJEXT) book/create.$(OBJEXT) \ compare/index.$(OBJEXT) compare/compare.$(OBJEXT) \ - jobs/index.$(OBJEXT) editone/index.$(OBJEXT) \ - editone/load.$(OBJEXT) editone/save.$(OBJEXT) \ - editone/verse.$(OBJEXT) editone/logic.$(OBJEXT) \ + jobs/index.$(OBJEXT) redirect/index.$(OBJEXT) \ + editone2/index.$(OBJEXT) editone2/load.$(OBJEXT) \ + editone2/save.$(OBJEXT) editone2/verse.$(OBJEXT) \ + editone2/logic.$(OBJEXT) editone2/update.$(OBJEXT) \ navigation/passage.$(OBJEXT) navigation/update.$(OBJEXT) \ - navigation/poll.$(OBJEXT) ipc/focus.$(OBJEXT) \ - ipc/notes.$(OBJEXT) checksum/logic.$(OBJEXT) \ - editusfm/focus.$(OBJEXT) editusfm/index.$(OBJEXT) \ - editusfm/load.$(OBJEXT) editusfm/offset.$(OBJEXT) \ - editusfm/save.$(OBJEXT) editor/styles.$(OBJEXT) \ - editor/html2usfm.$(OBJEXT) editor/usfm2html.$(OBJEXT) \ - editor/select.$(OBJEXT) edit/edit.$(OBJEXT) edit/id.$(OBJEXT) \ + navigation/poll.$(OBJEXT) navigation/paratext.$(OBJEXT) \ + ipc/focus.$(OBJEXT) ipc/notes.$(OBJEXT) \ + checksum/logic.$(OBJEXT) editusfm/focus.$(OBJEXT) \ + editusfm/index.$(OBJEXT) editusfm/load.$(OBJEXT) \ + editusfm/offset.$(OBJEXT) editusfm/save.$(OBJEXT) \ + editor/styles.$(OBJEXT) editor/html2usfm.$(OBJEXT) \ + editor/usfm2html.$(OBJEXT) editor/select.$(OBJEXT) \ + editor/html2format.$(OBJEXT) editor/id.$(OBJEXT) \ + editor/style.$(OBJEXT) edit/edit.$(OBJEXT) edit/id.$(OBJEXT) \ edit/index.$(OBJEXT) edit/load.$(OBJEXT) edit/save.$(OBJEXT) \ edit/styles.$(OBJEXT) edit/logic.$(OBJEXT) \ edit/preview.$(OBJEXT) edit/position.$(OBJEXT) \ - edit/navigate.$(OBJEXT) search/all.$(OBJEXT) \ - search/index.$(OBJEXT) search/replace.$(OBJEXT) \ - search/getids.$(OBJEXT) search/replacepre.$(OBJEXT) \ - search/replacego.$(OBJEXT) search/search2.$(OBJEXT) \ - search/replace2.$(OBJEXT) search/replacepre2.$(OBJEXT) \ - search/getids2.$(OBJEXT) search/replacego2.$(OBJEXT) \ - search/similar.$(OBJEXT) search/strongs.$(OBJEXT) \ - search/strong.$(OBJEXT) search/originals.$(OBJEXT) \ - tmp/tmp.$(OBJEXT) workspace/index.$(OBJEXT) \ - workspace/logic.$(OBJEXT) workspace/settings.$(OBJEXT) \ - workspace/organize.$(OBJEXT) sendreceive/logic.$(OBJEXT) \ - sendreceive/index.$(OBJEXT) sendreceive/sendreceive.$(OBJEXT) \ + edit/navigate.$(OBJEXT) edit2/edit.$(OBJEXT) \ + edit2/index.$(OBJEXT) edit2/load.$(OBJEXT) \ + edit2/save.$(OBJEXT) edit2/logic.$(OBJEXT) \ + edit2/preview.$(OBJEXT) edit2/position.$(OBJEXT) \ + edit2/navigate.$(OBJEXT) edit2/update.$(OBJEXT) \ + search/all.$(OBJEXT) search/index.$(OBJEXT) \ + search/replace.$(OBJEXT) search/getids.$(OBJEXT) \ + search/replacepre.$(OBJEXT) search/replacego.$(OBJEXT) \ + search/search2.$(OBJEXT) search/replace2.$(OBJEXT) \ + search/replacepre2.$(OBJEXT) search/getids2.$(OBJEXT) \ + search/replacego2.$(OBJEXT) search/similar.$(OBJEXT) \ + search/strongs.$(OBJEXT) search/strong.$(OBJEXT) \ + search/originals.$(OBJEXT) tmp/tmp.$(OBJEXT) \ + workspace/index.$(OBJEXT) workspace/logic.$(OBJEXT) \ + workspace/settings.$(OBJEXT) workspace/organize.$(OBJEXT) \ + sendreceive/logic.$(OBJEXT) sendreceive/index.$(OBJEXT) \ + sendreceive/sendreceive.$(OBJEXT) \ sendreceive/settings.$(OBJEXT) sendreceive/bibles.$(OBJEXT) \ sendreceive/notes.$(OBJEXT) sendreceive/changes.$(OBJEXT) \ sendreceive/files.$(OBJEXT) sendreceive/resources.$(OBJEXT) \ @@ -384,16 +392,22 @@ edit/$(DEPDIR)/logic.Po edit/$(DEPDIR)/navigate.Po \ edit/$(DEPDIR)/position.Po edit/$(DEPDIR)/preview.Po \ edit/$(DEPDIR)/save.Po edit/$(DEPDIR)/styles.Po \ - editone/$(DEPDIR)/index.Po editone/$(DEPDIR)/load.Po \ - editone/$(DEPDIR)/logic.Po editone/$(DEPDIR)/save.Po \ - editone/$(DEPDIR)/verse.Po editor/$(DEPDIR)/html2usfm.Po \ - editor/$(DEPDIR)/select.Po editor/$(DEPDIR)/styles.Po \ - editor/$(DEPDIR)/usfm2html.Po editusfm/$(DEPDIR)/focus.Po \ - editusfm/$(DEPDIR)/index.Po editusfm/$(DEPDIR)/load.Po \ - editusfm/$(DEPDIR)/offset.Po editusfm/$(DEPDIR)/save.Po \ - email/$(DEPDIR)/index.Po email/$(DEPDIR)/receive.Po \ - email/$(DEPDIR)/send.Po esword/$(DEPDIR)/text.Po \ - executable/$(DEPDIR)/bibledit.Po \ + edit2/$(DEPDIR)/edit.Po edit2/$(DEPDIR)/index.Po \ + edit2/$(DEPDIR)/load.Po edit2/$(DEPDIR)/logic.Po \ + edit2/$(DEPDIR)/navigate.Po edit2/$(DEPDIR)/position.Po \ + edit2/$(DEPDIR)/preview.Po edit2/$(DEPDIR)/save.Po \ + edit2/$(DEPDIR)/update.Po editone2/$(DEPDIR)/index.Po \ + editone2/$(DEPDIR)/load.Po editone2/$(DEPDIR)/logic.Po \ + editone2/$(DEPDIR)/save.Po editone2/$(DEPDIR)/update.Po \ + editone2/$(DEPDIR)/verse.Po editor/$(DEPDIR)/html2format.Po \ + editor/$(DEPDIR)/html2usfm.Po editor/$(DEPDIR)/id.Po \ + editor/$(DEPDIR)/select.Po editor/$(DEPDIR)/style.Po \ + editor/$(DEPDIR)/styles.Po editor/$(DEPDIR)/usfm2html.Po \ + editusfm/$(DEPDIR)/focus.Po editusfm/$(DEPDIR)/index.Po \ + editusfm/$(DEPDIR)/load.Po editusfm/$(DEPDIR)/offset.Po \ + editusfm/$(DEPDIR)/save.Po email/$(DEPDIR)/index.Po \ + email/$(DEPDIR)/receive.Po email/$(DEPDIR)/send.Po \ + esword/$(DEPDIR)/text.Po executable/$(DEPDIR)/bibledit.Po \ export/$(DEPDIR)/bibledropbox.Po export/$(DEPDIR)/esword.Po \ export/$(DEPDIR)/html.Po export/$(DEPDIR)/index.Po \ export/$(DEPDIR)/info.Po export/$(DEPDIR)/logic.Po \ @@ -425,6 +439,7 @@ mapping/$(DEPDIR)/index.Po mapping/$(DEPDIR)/map.Po \ menu/$(DEPDIR)/index.Po menu/$(DEPDIR)/logic.Po \ microtar/$(DEPDIR)/microtar.Po miniz/$(DEPDIR)/miniz.Po \ + navigation/$(DEPDIR)/paratext.Po \ navigation/$(DEPDIR)/passage.Po navigation/$(DEPDIR)/poll.Po \ navigation/$(DEPDIR)/update.Po nmt/$(DEPDIR)/index.Po \ nmt/$(DEPDIR)/logic.Po notes/$(DEPDIR)/actions.Po \ @@ -449,8 +464,8 @@ public/$(DEPDIR)/login.Po public/$(DEPDIR)/new.Po \ public/$(DEPDIR)/note.Po public/$(DEPDIR)/notes.Po \ pugixml/$(DEPDIR)/pugixml.Po pugixml/$(DEPDIR)/utils.Po \ - quill/$(DEPDIR)/logic.Po related/$(DEPDIR)/logic.Po \ - resource/$(DEPDIR)/bb2resource.Po \ + quill/$(DEPDIR)/logic.Po redirect/$(DEPDIR)/index.Po \ + related/$(DEPDIR)/logic.Po resource/$(DEPDIR)/bb2resource.Po \ resource/$(DEPDIR)/bbgateway.Po resource/$(DEPDIR)/cache.Po \ resource/$(DEPDIR)/convert2bible.Po \ resource/$(DEPDIR)/convert2resource.Po \ @@ -731,6 +746,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -922,14 +938,17 @@ compare/index.cpp \ compare/compare.cpp \ jobs/index.cpp \ - editone/index.cpp \ - editone/load.cpp \ - editone/save.cpp \ - editone/verse.cpp \ - editone/logic.cpp \ + redirect/index.cpp \ + editone2/index.cpp \ + editone2/load.cpp \ + editone2/save.cpp \ + editone2/verse.cpp \ + editone2/logic.cpp \ + editone2/update.cpp \ navigation/passage.cpp \ navigation/update.cpp \ navigation/poll.cpp \ + navigation/paratext.cpp \ ipc/focus.cpp \ ipc/notes.cpp \ checksum/logic.cpp \ @@ -942,6 +961,9 @@ editor/html2usfm.cpp \ editor/usfm2html.cpp \ editor/select.cpp \ + editor/html2format.cpp \ + editor/id.cpp \ + editor/style.cpp \ edit/edit.cpp \ edit/id.cpp \ edit/index.cpp \ @@ -952,6 +974,15 @@ edit/preview.cpp \ edit/position.cpp \ edit/navigate.cpp \ + edit2/edit.cpp \ + edit2/index.cpp \ + edit2/load.cpp \ + edit2/save.cpp \ + edit2/logic.cpp \ + edit2/preview.cpp \ + edit2/position.cpp \ + edit2/navigate.cpp \ + edit2/update.cpp \ search/all.cpp \ search/index.cpp \ search/replace.cpp \ @@ -1820,22 +1851,32 @@ @: > jobs/$(DEPDIR)/$(am__dirstamp) jobs/index.$(OBJEXT): jobs/$(am__dirstamp) \ jobs/$(DEPDIR)/$(am__dirstamp) -editone/$(am__dirstamp): - @$(MKDIR_P) editone - @: > editone/$(am__dirstamp) -editone/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) editone/$(DEPDIR) - @: > editone/$(DEPDIR)/$(am__dirstamp) -editone/index.$(OBJEXT): editone/$(am__dirstamp) \ - editone/$(DEPDIR)/$(am__dirstamp) -editone/load.$(OBJEXT): editone/$(am__dirstamp) \ - editone/$(DEPDIR)/$(am__dirstamp) -editone/save.$(OBJEXT): editone/$(am__dirstamp) \ - editone/$(DEPDIR)/$(am__dirstamp) -editone/verse.$(OBJEXT): editone/$(am__dirstamp) \ - editone/$(DEPDIR)/$(am__dirstamp) -editone/logic.$(OBJEXT): editone/$(am__dirstamp) \ - editone/$(DEPDIR)/$(am__dirstamp) +redirect/$(am__dirstamp): + @$(MKDIR_P) redirect + @: > redirect/$(am__dirstamp) +redirect/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) redirect/$(DEPDIR) + @: > redirect/$(DEPDIR)/$(am__dirstamp) +redirect/index.$(OBJEXT): redirect/$(am__dirstamp) \ + redirect/$(DEPDIR)/$(am__dirstamp) +editone2/$(am__dirstamp): + @$(MKDIR_P) editone2 + @: > editone2/$(am__dirstamp) +editone2/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) editone2/$(DEPDIR) + @: > editone2/$(DEPDIR)/$(am__dirstamp) +editone2/index.$(OBJEXT): editone2/$(am__dirstamp) \ + editone2/$(DEPDIR)/$(am__dirstamp) +editone2/load.$(OBJEXT): editone2/$(am__dirstamp) \ + editone2/$(DEPDIR)/$(am__dirstamp) +editone2/save.$(OBJEXT): editone2/$(am__dirstamp) \ + editone2/$(DEPDIR)/$(am__dirstamp) +editone2/verse.$(OBJEXT): editone2/$(am__dirstamp) \ + editone2/$(DEPDIR)/$(am__dirstamp) +editone2/logic.$(OBJEXT): editone2/$(am__dirstamp) \ + editone2/$(DEPDIR)/$(am__dirstamp) +editone2/update.$(OBJEXT): editone2/$(am__dirstamp) \ + editone2/$(DEPDIR)/$(am__dirstamp) navigation/$(am__dirstamp): @$(MKDIR_P) navigation @: > navigation/$(am__dirstamp) @@ -1848,6 +1889,8 @@ navigation/$(DEPDIR)/$(am__dirstamp) navigation/poll.$(OBJEXT): navigation/$(am__dirstamp) \ navigation/$(DEPDIR)/$(am__dirstamp) +navigation/paratext.$(OBJEXT): navigation/$(am__dirstamp) \ + navigation/$(DEPDIR)/$(am__dirstamp) ipc/$(am__dirstamp): @$(MKDIR_P) ipc @: > ipc/$(am__dirstamp) @@ -1894,6 +1937,12 @@ editor/$(DEPDIR)/$(am__dirstamp) editor/select.$(OBJEXT): editor/$(am__dirstamp) \ editor/$(DEPDIR)/$(am__dirstamp) +editor/html2format.$(OBJEXT): editor/$(am__dirstamp) \ + editor/$(DEPDIR)/$(am__dirstamp) +editor/id.$(OBJEXT): editor/$(am__dirstamp) \ + editor/$(DEPDIR)/$(am__dirstamp) +editor/style.$(OBJEXT): editor/$(am__dirstamp) \ + editor/$(DEPDIR)/$(am__dirstamp) edit/$(am__dirstamp): @$(MKDIR_P) edit @: > edit/$(am__dirstamp) @@ -1919,6 +1968,30 @@ edit/$(DEPDIR)/$(am__dirstamp) edit/navigate.$(OBJEXT): edit/$(am__dirstamp) \ edit/$(DEPDIR)/$(am__dirstamp) +edit2/$(am__dirstamp): + @$(MKDIR_P) edit2 + @: > edit2/$(am__dirstamp) +edit2/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) edit2/$(DEPDIR) + @: > edit2/$(DEPDIR)/$(am__dirstamp) +edit2/edit.$(OBJEXT): edit2/$(am__dirstamp) \ + edit2/$(DEPDIR)/$(am__dirstamp) +edit2/index.$(OBJEXT): edit2/$(am__dirstamp) \ + edit2/$(DEPDIR)/$(am__dirstamp) +edit2/load.$(OBJEXT): edit2/$(am__dirstamp) \ + edit2/$(DEPDIR)/$(am__dirstamp) +edit2/save.$(OBJEXT): edit2/$(am__dirstamp) \ + edit2/$(DEPDIR)/$(am__dirstamp) +edit2/logic.$(OBJEXT): edit2/$(am__dirstamp) \ + edit2/$(DEPDIR)/$(am__dirstamp) +edit2/preview.$(OBJEXT): edit2/$(am__dirstamp) \ + edit2/$(DEPDIR)/$(am__dirstamp) +edit2/position.$(OBJEXT): edit2/$(am__dirstamp) \ + edit2/$(DEPDIR)/$(am__dirstamp) +edit2/navigate.$(OBJEXT): edit2/$(am__dirstamp) \ + edit2/$(DEPDIR)/$(am__dirstamp) +edit2/update.$(OBJEXT): edit2/$(am__dirstamp) \ + edit2/$(DEPDIR)/$(am__dirstamp) search/all.$(OBJEXT): search/$(am__dirstamp) \ search/$(DEPDIR)/$(am__dirstamp) search/index.$(OBJEXT): search/$(am__dirstamp) \ @@ -2448,7 +2521,8 @@ -rm -f developer/*.$(OBJEXT) -rm -f dialog/*.$(OBJEXT) -rm -f edit/*.$(OBJEXT) - -rm -f editone/*.$(OBJEXT) + -rm -f edit2/*.$(OBJEXT) + -rm -f editone2/*.$(OBJEXT) -rm -f editor/*.$(OBJEXT) -rm -f editusfm/*.$(OBJEXT) -rm -f email/*.$(OBJEXT) @@ -2485,6 +2559,7 @@ -rm -f public/*.$(OBJEXT) -rm -f pugixml/*.$(OBJEXT) -rm -f quill/*.$(OBJEXT) + -rm -f redirect/*.$(OBJEXT) -rm -f related/*.$(OBJEXT) -rm -f resource/*.$(OBJEXT) -rm -f rss/*.$(OBJEXT) @@ -2633,13 +2708,26 @@ @AMDEP_TRUE@@am__include@ @am__quote@edit/$(DEPDIR)/preview.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@edit/$(DEPDIR)/save.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@edit/$(DEPDIR)/styles.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@editone/$(DEPDIR)/index.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@editone/$(DEPDIR)/load.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@editone/$(DEPDIR)/logic.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@editone/$(DEPDIR)/save.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@editone/$(DEPDIR)/verse.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@edit2/$(DEPDIR)/edit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@edit2/$(DEPDIR)/index.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@edit2/$(DEPDIR)/load.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@edit2/$(DEPDIR)/logic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@edit2/$(DEPDIR)/navigate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@edit2/$(DEPDIR)/position.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@edit2/$(DEPDIR)/preview.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@edit2/$(DEPDIR)/save.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@edit2/$(DEPDIR)/update.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@editone2/$(DEPDIR)/index.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@editone2/$(DEPDIR)/load.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@editone2/$(DEPDIR)/logic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@editone2/$(DEPDIR)/save.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@editone2/$(DEPDIR)/update.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@editone2/$(DEPDIR)/verse.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@editor/$(DEPDIR)/html2format.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@editor/$(DEPDIR)/html2usfm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@editor/$(DEPDIR)/id.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@editor/$(DEPDIR)/select.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@editor/$(DEPDIR)/style.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@editor/$(DEPDIR)/styles.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@editor/$(DEPDIR)/usfm2html.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@editusfm/$(DEPDIR)/focus.Po@am__quote@ # am--include-marker @@ -2714,6 +2802,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@menu/$(DEPDIR)/logic.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@microtar/$(DEPDIR)/microtar.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@miniz/$(DEPDIR)/miniz.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@navigation/$(DEPDIR)/paratext.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@navigation/$(DEPDIR)/passage.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@navigation/$(DEPDIR)/poll.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@navigation/$(DEPDIR)/update.Po@am__quote@ # am--include-marker @@ -2761,6 +2850,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@pugixml/$(DEPDIR)/pugixml.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@pugixml/$(DEPDIR)/utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@quill/$(DEPDIR)/logic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@redirect/$(DEPDIR)/index.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@related/$(DEPDIR)/logic.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@resource/$(DEPDIR)/bb2resource.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@resource/$(DEPDIR)/bbgateway.Po@am__quote@ # am--include-marker @@ -3350,8 +3440,10 @@ -rm -f dialog/$(am__dirstamp) -rm -f edit/$(DEPDIR)/$(am__dirstamp) -rm -f edit/$(am__dirstamp) - -rm -f editone/$(DEPDIR)/$(am__dirstamp) - -rm -f editone/$(am__dirstamp) + -rm -f edit2/$(DEPDIR)/$(am__dirstamp) + -rm -f edit2/$(am__dirstamp) + -rm -f editone2/$(DEPDIR)/$(am__dirstamp) + -rm -f editone2/$(am__dirstamp) -rm -f editor/$(DEPDIR)/$(am__dirstamp) -rm -f editor/$(am__dirstamp) -rm -f editusfm/$(DEPDIR)/$(am__dirstamp) @@ -3424,6 +3516,8 @@ -rm -f pugixml/$(am__dirstamp) -rm -f quill/$(DEPDIR)/$(am__dirstamp) -rm -f quill/$(am__dirstamp) + -rm -f redirect/$(DEPDIR)/$(am__dirstamp) + -rm -f redirect/$(am__dirstamp) -rm -f related/$(DEPDIR)/$(am__dirstamp) -rm -f related/$(am__dirstamp) -rm -f resource/$(DEPDIR)/$(am__dirstamp) @@ -3605,13 +3699,26 @@ -rm -f edit/$(DEPDIR)/preview.Po -rm -f edit/$(DEPDIR)/save.Po -rm -f edit/$(DEPDIR)/styles.Po - -rm -f editone/$(DEPDIR)/index.Po - -rm -f editone/$(DEPDIR)/load.Po - -rm -f editone/$(DEPDIR)/logic.Po - -rm -f editone/$(DEPDIR)/save.Po - -rm -f editone/$(DEPDIR)/verse.Po + -rm -f edit2/$(DEPDIR)/edit.Po + -rm -f edit2/$(DEPDIR)/index.Po + -rm -f edit2/$(DEPDIR)/load.Po + -rm -f edit2/$(DEPDIR)/logic.Po + -rm -f edit2/$(DEPDIR)/navigate.Po + -rm -f edit2/$(DEPDIR)/position.Po + -rm -f edit2/$(DEPDIR)/preview.Po + -rm -f edit2/$(DEPDIR)/save.Po + -rm -f edit2/$(DEPDIR)/update.Po + -rm -f editone2/$(DEPDIR)/index.Po + -rm -f editone2/$(DEPDIR)/load.Po + -rm -f editone2/$(DEPDIR)/logic.Po + -rm -f editone2/$(DEPDIR)/save.Po + -rm -f editone2/$(DEPDIR)/update.Po + -rm -f editone2/$(DEPDIR)/verse.Po + -rm -f editor/$(DEPDIR)/html2format.Po -rm -f editor/$(DEPDIR)/html2usfm.Po + -rm -f editor/$(DEPDIR)/id.Po -rm -f editor/$(DEPDIR)/select.Po + -rm -f editor/$(DEPDIR)/style.Po -rm -f editor/$(DEPDIR)/styles.Po -rm -f editor/$(DEPDIR)/usfm2html.Po -rm -f editusfm/$(DEPDIR)/focus.Po @@ -3686,6 +3793,7 @@ -rm -f menu/$(DEPDIR)/logic.Po -rm -f microtar/$(DEPDIR)/microtar.Po -rm -f miniz/$(DEPDIR)/miniz.Po + -rm -f navigation/$(DEPDIR)/paratext.Po -rm -f navigation/$(DEPDIR)/passage.Po -rm -f navigation/$(DEPDIR)/poll.Po -rm -f navigation/$(DEPDIR)/update.Po @@ -3733,6 +3841,7 @@ -rm -f pugixml/$(DEPDIR)/pugixml.Po -rm -f pugixml/$(DEPDIR)/utils.Po -rm -f quill/$(DEPDIR)/logic.Po + -rm -f redirect/$(DEPDIR)/index.Po -rm -f related/$(DEPDIR)/logic.Po -rm -f resource/$(DEPDIR)/bb2resource.Po -rm -f resource/$(DEPDIR)/bbgateway.Po @@ -4014,13 +4123,26 @@ -rm -f edit/$(DEPDIR)/preview.Po -rm -f edit/$(DEPDIR)/save.Po -rm -f edit/$(DEPDIR)/styles.Po - -rm -f editone/$(DEPDIR)/index.Po - -rm -f editone/$(DEPDIR)/load.Po - -rm -f editone/$(DEPDIR)/logic.Po - -rm -f editone/$(DEPDIR)/save.Po - -rm -f editone/$(DEPDIR)/verse.Po + -rm -f edit2/$(DEPDIR)/edit.Po + -rm -f edit2/$(DEPDIR)/index.Po + -rm -f edit2/$(DEPDIR)/load.Po + -rm -f edit2/$(DEPDIR)/logic.Po + -rm -f edit2/$(DEPDIR)/navigate.Po + -rm -f edit2/$(DEPDIR)/position.Po + -rm -f edit2/$(DEPDIR)/preview.Po + -rm -f edit2/$(DEPDIR)/save.Po + -rm -f edit2/$(DEPDIR)/update.Po + -rm -f editone2/$(DEPDIR)/index.Po + -rm -f editone2/$(DEPDIR)/load.Po + -rm -f editone2/$(DEPDIR)/logic.Po + -rm -f editone2/$(DEPDIR)/save.Po + -rm -f editone2/$(DEPDIR)/update.Po + -rm -f editone2/$(DEPDIR)/verse.Po + -rm -f editor/$(DEPDIR)/html2format.Po -rm -f editor/$(DEPDIR)/html2usfm.Po + -rm -f editor/$(DEPDIR)/id.Po -rm -f editor/$(DEPDIR)/select.Po + -rm -f editor/$(DEPDIR)/style.Po -rm -f editor/$(DEPDIR)/styles.Po -rm -f editor/$(DEPDIR)/usfm2html.Po -rm -f editusfm/$(DEPDIR)/focus.Po @@ -4095,6 +4217,7 @@ -rm -f menu/$(DEPDIR)/logic.Po -rm -f microtar/$(DEPDIR)/microtar.Po -rm -f miniz/$(DEPDIR)/miniz.Po + -rm -f navigation/$(DEPDIR)/paratext.Po -rm -f navigation/$(DEPDIR)/passage.Po -rm -f navigation/$(DEPDIR)/poll.Po -rm -f navigation/$(DEPDIR)/update.Po @@ -4142,6 +4265,7 @@ -rm -f pugixml/$(DEPDIR)/pugixml.Po -rm -f pugixml/$(DEPDIR)/utils.Po -rm -f quill/$(DEPDIR)/logic.Po + -rm -f redirect/$(DEPDIR)/index.Po -rm -f related/$(DEPDIR)/logic.Po -rm -f resource/$(DEPDIR)/bb2resource.Po -rm -f resource/$(DEPDIR)/bbgateway.Po diff -Nru bibledit-5.0.912/menu/logic.cpp bibledit-5.0.922/menu/logic.cpp --- bibledit-5.0.912/menu/logic.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/menu/logic.cpp 2020-11-22 13:55:01.000000000 +0000 @@ -34,7 +34,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -264,8 +265,8 @@ vector html; - if (editone_index_acl (webserver_request)) { - html.push_back (menu_logic_create_item (editone_index_url (), translate ("Translation"), true)); + if (editone2_index_acl (webserver_request)) { + html.push_back (menu_logic_create_item (editone2_index_url (), translate ("Translation"), true)); } if (changes_changes_acl (webserver_request)) { @@ -354,9 +355,9 @@ } // Visual verse editor. - if (editone_index_acl (webserver_request)) { + if (editone2_index_acl (webserver_request)) { string label = menu_logic_editor_menu_text (true, false); - html.push_back (menu_logic_create_item (editone_index_url (), label, true)); + html.push_back (menu_logic_create_item (editone2_index_url (), label, true)); labels.push_back (label); } @@ -1202,7 +1203,7 @@ jsonxx::Array json_array; // Adding tabs in the order an average translator uses them most of the time: // Add the Bible editor tab. - json_array << menu_logic_tabbed_mode_add_tab (editone_index_url (), menu_logic_translate_text ()); + json_array << menu_logic_tabbed_mode_add_tab (editone2_index_url (), menu_logic_translate_text ()); // Add the resources tab. json_array << menu_logic_tabbed_mode_add_tab (resource_index_url (), menu_logic_resources_text ()); // Add the consultation notes tab. diff -Nru bibledit-5.0.912/navigation/paratext.cpp bibledit-5.0.922/navigation/paratext.cpp --- bibledit-5.0.912/navigation/paratext.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/navigation/paratext.cpp 2020-11-18 16:48:52.000000000 +0000 @@ -0,0 +1,70 @@ +/* +Copyright (©) 2003-2020 Teus Benschop. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +#include +#include +#include +#include +#include +#include + + +string navigation_paratext_url () +{ + return "navigation/paratext"; +} + + +string navigation_paratext (void * webserver_request) +{ + // The request from the client. + Webserver_Request * request = (Webserver_Request *) webserver_request; + // Handle any reference received that was obtained from Paratext. + static string previous_from; + string from = request->query ["from"]; + // Reference should differ from the previous one. + if (!from.empty () && (from != previous_from)) { + previous_from = from; + Database_Logs::log("Paratext is at " + from); + // User should have set to receive references from Paratext. + if (request->database_config_user ()->getReceiveFocusedReferenceFromParatext ()) { + // Parse the reference from Paratext. + vector book_rest = filter_string_explode (from, ' '); + if (book_rest.size() == 2) { + int book = Database_Books::getIdFromUsfm (book_rest[0]); + vector chapter_verse = filter_string_explode(book_rest[1], ':'); + if (chapter_verse.size() == 2) { + int chapter = convert_to_int(chapter_verse[0]); + int verse = convert_to_int(chapter_verse[1]); + // Set the user name to the first one in the database. + // Or if the database has no users, make the user admin. + // That happens when disconnected from the Cloud. + string user = "admin"; + Database_Users database_users; + vector users = database_users.getUsers (); + if (!users.empty()) user = users [0]; + request->session_logic()->setUsername(user); + // Set the focused passage for Bibledit. + Ipc_Focus::set (request, book, chapter, verse); + } + } + } + } + return ""; +} diff -Nru bibledit-5.0.912/navigation/paratext.h bibledit-5.0.922/navigation/paratext.h --- bibledit-5.0.912/navigation/paratext.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/navigation/paratext.h 2020-11-18 13:16:19.000000000 +0000 @@ -0,0 +1,31 @@ +/* +Copyright (©) 2003-2020 Teus Benschop. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +#ifndef INCLUDED_NAVIGATION_PARATEXT_H +#define INCLUDED_NAVIGATION_PARATEXT_H + + +#include + + +string navigation_paratext_url (); +string navigation_paratext (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/navigation/passage.cpp bibledit-5.0.922/navigation/passage.cpp --- bibledit-5.0.912/navigation/passage.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/navigation/passage.cpp 2020-11-15 14:06:52.000000000 +0000 @@ -61,13 +61,13 @@ if (!basic_mode) { fragment.append (""); if (database_navigation.previousExists (user)) { - fragment.append (""); + fragment.append (R"()"); } fragment.append (""); fragment.append (""); fragment.append (" "); if (database_navigation.nextExists (user)) { - fragment.append (""); + fragment.append (R"()"); } fragment.append (""); fragment.append ("\n"); @@ -88,7 +88,7 @@ string bookName = Database_Books::getEnglishFromId (book); bookName = translate (bookName); - fragment.append ("" + bookName + ""); + fragment.append (R"()" + bookName + ""); int chapter = Ipc_Focus::getChapter (request); @@ -102,7 +102,7 @@ } } - fragment.append (" " + convert_to_string (chapter) + " "); + fragment.append (R"( " + convert_to_string (chapter) + " "); int verse = Ipc_Focus::getVerse (request); @@ -126,23 +126,23 @@ fragment.append (" « "); + fragment.append ("> ᐊ "); fragment.append (" " + convert_to_string (verse) + " "); + if (!basic_mode) fragment.append (R"( class="selectverse")"); + fragment.append (R"( id="selectverse" href="selectverse" title=")" + translate ("Select verse") + R"("> )" + convert_to_string (verse) + " "); if (next_verse_is_available) { fragment.append (" » "); + if (!basic_mode) fragment.append (R"( class="nextverse")"); + fragment.append (R"( id="nextverse" href="nextverse" title=")" + translate ("Go to next verse") + R"(")"); + fragment.append ("> ᐅ "); } // Store book / chapter / verse if they were clipped. diff -Nru bibledit-5.0.912/notes/notes.cpp bibledit-5.0.922/notes/notes.cpp --- bibledit-5.0.912/notes/notes.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/notes/notes.cpp 2020-11-15 15:11:10.000000000 +0000 @@ -87,18 +87,18 @@ vector passage_sort_keys; for (auto & identifier : identifiers) { int passage_sort_key = 0; - vector numeric_passages; + vector numeric_passages; vector passages = database_notes.get_passages (identifier); for (auto & passage : passages) { numeric_passages.push_back (filter_passage_to_integer (passage)); } if (!numeric_passages.empty ()) { - float average = accumulate (numeric_passages.begin (), numeric_passages.end (), 0) / numeric_passages.size (); - passage_sort_key = round (average); + double average = accumulate (numeric_passages.begin (), numeric_passages.end (), 0) / numeric_passages.size (); + passage_sort_key = round(average); } passage_sort_keys.push_back (passage_sort_key); } - quick_sort (passage_sort_keys, identifiers, 0, identifiers.size ()); + quick_sort (passage_sort_keys, identifiers, 0, (int)identifiers.size ()); } diff -Nru bibledit-5.0.912/personalize/index.cpp bibledit-5.0.922/personalize/index.cpp --- bibledit-5.0.912/personalize/index.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/personalize/index.cpp 2020-11-18 16:50:25.000000000 +0000 @@ -471,6 +471,15 @@ menu_logic_verse_separator (Database_Config_General::getNotesVerseSeparator ())); + // Setting for whether to receive the focused reference from Paratext on Windows. + if (request->query.count ("referencefromparatext")) { + bool state = request->database_config_user ()->getReceiveFocusedReferenceFromParatext (); + request->database_config_user ()->setReceiveFocusedReferenceFromParatext (!state); + } + on_off = styles_logic_off_on_inherit_toggle_text (request->database_config_user ()->getReceiveFocusedReferenceFromParatext ()); + view.set_variable ("referencefromparatext", on_off); + + // Enable the sections with settings relevant to the user and device. bool resources = access_logic_privilege_view_resources (webserver_request); if (resources) view.enable_zone ("resources"); @@ -506,6 +515,11 @@ #endif +#ifdef HAVE_WINDOWS + view.enable_zone ("windows"); +#endif + + view.set_variable ("success", success); view.set_variable ("error", error); page += view.render ("personalize", "index"); diff -Nru bibledit-5.0.912/personalize/index.html bibledit-5.0.922/personalize/index.html --- bibledit-5.0.912/personalize/index.html 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/personalize/index.html 2020-11-18 13:55:21.000000000 +0000 @@ -246,11 +246,20 @@

    -translate("Verse separator for Bible notes entry:") +translate("Verse separator for Bible notes entry"): ##verseseparator##.

    + +
    +

    +translate("Receive focused reference from Paratext"): +##referencefromparatext##. +

    + + +
    diff -Nru bibledit-5.0.912/pkgdata/files.txt bibledit-5.0.922/pkgdata/files.txt --- bibledit-5.0.912/pkgdata/files.txt 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/pkgdata/files.txt 2020-12-04 20:32:03.000000000 +0000 @@ -224,13 +224,20 @@ /dyncss /dyncss/create_css.txt /edit +/edit2 +/edit2/embed.js +/edit2/index.html +/edit2/index.js +/edit2/keys.js +/edit2/preview.html +/edit2/preview.js /edit/embed.js /edit/index.html /edit/index.js /edit/keys.js -/editone -/editone/index.html -/editone/index.js +/editone2 +/editone2/index.html +/editone2/index.js /editor /editor/select.html /editor/select.js @@ -455,6 +462,22 @@ /pugixml /pugixml/readme.txt /quill +/quill/1.1.5 +/quill/1.1.5/quill.bubble.css +/quill/1.1.5/quill.core.css +/quill/1.1.5/quill.core.js +/quill/1.1.5/quill.js +/quill/1.1.5/quill.min.js +/quill/1.1.5/quill.min.js.map +/quill/1.1.5/quill.snow.css +/quill/1.3.6 +/quill/1.3.6/quill.bubble.css +/quill/1.3.6/quill.core.css +/quill/1.3.6/quill.core.js +/quill/1.3.6/quill.js +/quill/1.3.6/quill.min.js +/quill/1.3.6/quill.min.js.map +/quill/1.3.6/quill.snow.css /quill/examples /quill/examples/bubble.html /quill/examples/full.html @@ -480,6 +503,7 @@ /rangy13/rangy-serializer.min.js /rangy13/rangy-textrange.js /rangy13/rangy-textrange.min.js +/redirect /related /related/ot-quotations-in-nt.xml /related/parallel-passages-nt.xml @@ -749,6 +773,7 @@ /sync /system /system/index.html +/tarball-linux.sh /tarball.sh /tasks /tasks/holder diff -Nru bibledit-5.0.912/quill/1.1.5/quill.bubble.css bibledit-5.0.922/quill/1.1.5/quill.bubble.css --- bibledit-5.0.912/quill/1.1.5/quill.bubble.css 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.1.5/quill.bubble.css 2017-02-16 08:33:04.000000000 +0000 @@ -0,0 +1,871 @@ +/*! + * Quill Editor v1.1.5 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + */ +.ql-container { + box-sizing: border-box; + font-family: Helvetica, Arial, sans-serif; + font-size: 13px; + height: 100%; + margin: 0px; + position: relative; +} +.ql-container.ql-disabled .ql-tooltip { + visibility: hidden; +} +.ql-clipboard { + left: -100000px; + height: 1px; + overflow-y: hidden; + position: absolute; + top: 50%; +} +.ql-clipboard p { + margin: 0; + padding: 0; +} +.ql-editor { + box-sizing: border-box; + cursor: text; + line-height: 1.42; + height: 100%; + outline: none; + overflow-y: auto; + padding: 12px 15px; + tab-size: 4; + -moz-tab-size: 4; + text-align: left; + white-space: pre-wrap; + word-wrap: break-word; +} +.ql-editor p, +.ql-editor ol, +.ql-editor ul, +.ql-editor pre, +.ql-editor blockquote, +.ql-editor h1, +.ql-editor h2, +.ql-editor h3, +.ql-editor h4, +.ql-editor h5, +.ql-editor h6 { + margin: 0; + padding: 0; + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol, +.ql-editor ul { + padding-left: 1.5em; +} +.ql-editor ol > li, +.ql-editor ul > li { + list-style-type: none; +} +.ql-editor ul > li::before { + content: '\25CF'; +} +.ql-editor li::before { + display: inline-block; + margin-right: 0.3em; + text-align: right; + white-space: nowrap; + width: 1.2em; +} +.ql-editor li:not(.ql-direction-rtl)::before { + margin-left: -1.5em; +} +.ql-editor ol li, +.ql-editor ul li { + padding-left: 1.5em; +} +.ql-editor ol li { + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; + counter-increment: list-num; +} +.ql-editor ol li:before { + content: counter(list-num, decimal) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-increment: list-1; +} +.ql-editor ol li.ql-indent-1:before { + content: counter(list-1, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-2 { + counter-increment: list-2; +} +.ql-editor ol li.ql-indent-2:before { + content: counter(list-2, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-2 { + counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-3 { + counter-increment: list-3; +} +.ql-editor ol li.ql-indent-3:before { + content: counter(list-3, decimal) '. '; +} +.ql-editor ol li.ql-indent-3 { + counter-reset: list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-4 { + counter-increment: list-4; +} +.ql-editor ol li.ql-indent-4:before { + content: counter(list-4, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-4 { + counter-reset: list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-5 { + counter-increment: list-5; +} +.ql-editor ol li.ql-indent-5:before { + content: counter(list-5, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-5 { + counter-reset: list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-6 { + counter-increment: list-6; +} +.ql-editor ol li.ql-indent-6:before { + content: counter(list-6, decimal) '. '; +} +.ql-editor ol li.ql-indent-6 { + counter-reset: list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-7 { + counter-increment: list-7; +} +.ql-editor ol li.ql-indent-7:before { + content: counter(list-7, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-7 { + counter-reset: list-8 list-9; +} +.ql-editor ol li.ql-indent-8 { + counter-increment: list-8; +} +.ql-editor ol li.ql-indent-8:before { + content: counter(list-8, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-8 { + counter-reset: list-9; +} +.ql-editor ol li.ql-indent-9 { + counter-increment: list-9; +} +.ql-editor ol li.ql-indent-9:before { + content: counter(list-9, decimal) '. '; +} +.ql-editor .ql-indent-1:not(.ql-direction-rtl) { + padding-left: 3em; +} +.ql-editor li.ql-indent-1:not(.ql-direction-rtl) { + padding-left: 4.5em; +} +.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 3em; +} +.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 4.5em; +} +.ql-editor .ql-indent-2:not(.ql-direction-rtl) { + padding-left: 6em; +} +.ql-editor li.ql-indent-2:not(.ql-direction-rtl) { + padding-left: 7.5em; +} +.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 6em; +} +.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 7.5em; +} +.ql-editor .ql-indent-3:not(.ql-direction-rtl) { + padding-left: 9em; +} +.ql-editor li.ql-indent-3:not(.ql-direction-rtl) { + padding-left: 10.5em; +} +.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 9em; +} +.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 10.5em; +} +.ql-editor .ql-indent-4:not(.ql-direction-rtl) { + padding-left: 12em; +} +.ql-editor li.ql-indent-4:not(.ql-direction-rtl) { + padding-left: 13.5em; +} +.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 12em; +} +.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 13.5em; +} +.ql-editor .ql-indent-5:not(.ql-direction-rtl) { + padding-left: 15em; +} +.ql-editor li.ql-indent-5:not(.ql-direction-rtl) { + padding-left: 16.5em; +} +.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 15em; +} +.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 16.5em; +} +.ql-editor .ql-indent-6:not(.ql-direction-rtl) { + padding-left: 18em; +} +.ql-editor li.ql-indent-6:not(.ql-direction-rtl) { + padding-left: 19.5em; +} +.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 18em; +} +.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 19.5em; +} +.ql-editor .ql-indent-7:not(.ql-direction-rtl) { + padding-left: 21em; +} +.ql-editor li.ql-indent-7:not(.ql-direction-rtl) { + padding-left: 22.5em; +} +.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 21em; +} +.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 22.5em; +} +.ql-editor .ql-indent-8:not(.ql-direction-rtl) { + padding-left: 24em; +} +.ql-editor li.ql-indent-8:not(.ql-direction-rtl) { + padding-left: 25.5em; +} +.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 24em; +} +.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 25.5em; +} +.ql-editor .ql-indent-9:not(.ql-direction-rtl) { + padding-left: 27em; +} +.ql-editor li.ql-indent-9:not(.ql-direction-rtl) { + padding-left: 28.5em; +} +.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 27em; +} +.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 28.5em; +} +.ql-editor .ql-video { + display: block; + max-width: 100%; +} +.ql-editor .ql-video.ql-align-center { + margin: 0 auto; +} +.ql-editor .ql-video.ql-align-right { + margin: 0 0 0 auto; +} +.ql-editor .ql-bg-black { + background-color: #000; +} +.ql-editor .ql-bg-red { + background-color: #e60000; +} +.ql-editor .ql-bg-orange { + background-color: #f90; +} +.ql-editor .ql-bg-yellow { + background-color: #ff0; +} +.ql-editor .ql-bg-green { + background-color: #008a00; +} +.ql-editor .ql-bg-blue { + background-color: #06c; +} +.ql-editor .ql-bg-purple { + background-color: #93f; +} +.ql-editor .ql-color-white { + color: #fff; +} +.ql-editor .ql-color-red { + color: #e60000; +} +.ql-editor .ql-color-orange { + color: #f90; +} +.ql-editor .ql-color-yellow { + color: #ff0; +} +.ql-editor .ql-color-green { + color: #008a00; +} +.ql-editor .ql-color-blue { + color: #06c; +} +.ql-editor .ql-color-purple { + color: #93f; +} +.ql-editor .ql-font-serif { + font-family: Georgia, Times New Roman, serif; +} +.ql-editor .ql-font-monospace { + font-family: Monaco, Courier New, monospace; +} +.ql-editor .ql-size-small { + font-size: 0.75em; +} +.ql-editor .ql-size-large { + font-size: 1.5em; +} +.ql-editor .ql-size-huge { + font-size: 2.5em; +} +.ql-editor .ql-direction-rtl { + direction: rtl; + text-align: inherit; +} +.ql-editor .ql-align-center { + text-align: center; +} +.ql-editor .ql-align-justify { + text-align: justify; +} +.ql-editor .ql-align-right { + text-align: right; +} +.ql-editor.ql-blank::before { + color: rgba(0,0,0,0.6); + content: attr(data-placeholder); + font-style: italic; + pointer-events: none; + position: absolute; +} +.ql-bubble.ql-toolbar:after, +.ql-bubble .ql-toolbar:after { + clear: both; + content: ''; + display: table; +} +.ql-bubble.ql-toolbar button, +.ql-bubble .ql-toolbar button { + background: none; + border: none; + cursor: pointer; + display: inline-block; + float: left; + height: 24px; + padding: 3px 5px; + width: 28px; +} +.ql-bubble.ql-toolbar button svg, +.ql-bubble .ql-toolbar button svg { + float: left; + height: 100%; +} +.ql-bubble.ql-toolbar input.ql-image[type=file], +.ql-bubble .ql-toolbar input.ql-image[type=file] { + display: none; +} +.ql-bubble.ql-toolbar button:hover, +.ql-bubble .ql-toolbar button:hover, +.ql-bubble.ql-toolbar button.ql-active, +.ql-bubble .ql-toolbar button.ql-active, +.ql-bubble.ql-toolbar .ql-picker-label:hover, +.ql-bubble .ql-toolbar .ql-picker-label:hover, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active, +.ql-bubble.ql-toolbar .ql-picker-item:hover, +.ql-bubble .ql-toolbar .ql-picker-item:hover, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected { + color: #fff; +} +.ql-bubble.ql-toolbar button:hover .ql-fill, +.ql-bubble .ql-toolbar button:hover .ql-fill, +.ql-bubble.ql-toolbar button.ql-active .ql-fill, +.ql-bubble .ql-toolbar button.ql-active .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-bubble.ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill { + fill: #fff; +} +.ql-bubble.ql-toolbar button:hover .ql-stroke, +.ql-bubble .ql-toolbar button:hover .ql-stroke, +.ql-bubble.ql-toolbar button.ql-active .ql-stroke, +.ql-bubble .ql-toolbar button.ql-active .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-bubble.ql-toolbar button:hover .ql-stroke-miter, +.ql-bubble .ql-toolbar button:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar button.ql-active .ql-stroke-miter, +.ql-bubble .ql-toolbar button.ql-active .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter { + stroke: #fff; +} +.ql-bubble { + box-sizing: border-box; +} +.ql-bubble * { + box-sizing: border-box; +} +.ql-bubble .ql-hidden { + display: none; +} +.ql-bubble .ql-out-bottom, +.ql-bubble .ql-out-top { + visibility: hidden; +} +.ql-bubble .ql-tooltip { + position: absolute; +} +.ql-bubble .ql-tooltip a { + cursor: pointer; + text-decoration: none; +} +.ql-bubble .ql-formats { + display: inline-block; + vertical-align: middle; +} +.ql-bubble .ql-formats:after { + clear: both; + content: ''; + display: table; +} +.ql-bubble .ql-stroke { + fill: none; + stroke: #ccc; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 2; +} +.ql-bubble .ql-stroke-miter { + fill: none; + stroke: #ccc; + stroke-miterlimit: 10; + stroke-width: 2; +} +.ql-bubble .ql-fill, +.ql-bubble .ql-stroke.ql-fill { + fill: #ccc; +} +.ql-bubble .ql-empty { + fill: none; +} +.ql-bubble .ql-even { + fill-rule: evenodd; +} +.ql-bubble .ql-thin, +.ql-bubble .ql-stroke.ql-thin { + stroke-width: 1; +} +.ql-bubble .ql-transparent { + opacity: 0.4; +} +.ql-bubble .ql-direction svg:last-child { + display: none; +} +.ql-bubble .ql-direction.ql-active svg:last-child { + display: inline; +} +.ql-bubble .ql-direction.ql-active svg:first-child { + display: none; +} +.ql-bubble .ql-editor h1 { + font-size: 2em; +} +.ql-bubble .ql-editor h2 { + font-size: 1.5em; +} +.ql-bubble .ql-editor h3 { + font-size: 1.17em; +} +.ql-bubble .ql-editor h4 { + font-size: 1em; +} +.ql-bubble .ql-editor h5 { + font-size: 0.83em; +} +.ql-bubble .ql-editor h6 { + font-size: 0.67em; +} +.ql-bubble .ql-editor a { + text-decoration: underline; +} +.ql-bubble .ql-editor blockquote { + border-left: 4px solid #ccc; + margin-bottom: 5px; + margin-top: 5px; + padding-left: 16px; +} +.ql-bubble .ql-editor code, +.ql-bubble .ql-editor pre { + background-color: #f0f0f0; + border-radius: 3px; +} +.ql-bubble .ql-editor pre { + white-space: pre-wrap; + margin-bottom: 5px; + margin-top: 5px; + padding: 5px 10px; +} +.ql-bubble .ql-editor code { + font-size: 85%; + padding-bottom: 2px; + padding-top: 2px; +} +.ql-bubble .ql-editor code:before, +.ql-bubble .ql-editor code:after { + content: "\A0"; + letter-spacing: -2px; +} +.ql-bubble .ql-editor pre.ql-syntax { + background-color: #23241f; + color: #f8f8f2; + overflow: visible; +} +.ql-bubble .ql-editor img { + max-width: 100%; +} +.ql-bubble .ql-picker { + color: #ccc; + display: inline-block; + float: left; + font-size: 14px; + font-weight: 500; + height: 24px; + position: relative; + vertical-align: middle; +} +.ql-bubble .ql-picker-label { + cursor: pointer; + display: inline-block; + height: 100%; + padding-left: 8px; + padding-right: 2px; + position: relative; + width: 100%; +} +.ql-bubble .ql-picker-label::before { + display: inline-block; + line-height: 22px; +} +.ql-bubble .ql-picker-options { + background-color: #444; + display: none; + min-width: 100%; + padding: 4px 8px; + position: absolute; + white-space: nowrap; +} +.ql-bubble .ql-picker-options .ql-picker-item { + cursor: pointer; + display: block; + padding-bottom: 5px; + padding-top: 5px; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-label { + color: #777; + z-index: 2; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-fill { + fill: #777; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-stroke { + stroke: #777; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-options { + display: block; + margin-top: -1px; + top: 100%; + z-index: 1; +} +.ql-bubble .ql-color-picker, +.ql-bubble .ql-icon-picker { + width: 28px; +} +.ql-bubble .ql-color-picker .ql-picker-label, +.ql-bubble .ql-icon-picker .ql-picker-label { + padding: 2px 4px; +} +.ql-bubble .ql-color-picker .ql-picker-label svg, +.ql-bubble .ql-icon-picker .ql-picker-label svg { + right: 4px; +} +.ql-bubble .ql-icon-picker .ql-picker-options { + padding: 4px 0px; +} +.ql-bubble .ql-icon-picker .ql-picker-item { + height: 24px; + width: 24px; + padding: 2px 4px; +} +.ql-bubble .ql-color-picker .ql-picker-options { + padding: 3px 5px; + width: 152px; +} +.ql-bubble .ql-color-picker .ql-picker-item { + border: 1px solid transparent; + float: left; + height: 16px; + margin: 2px; + padding: 0px; + width: 16px; +} +.ql-bubble .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg { + position: absolute; + margin-top: -9px; + right: 0; + top: 50%; + width: 18px; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before { + content: attr(data-label); +} +.ql-bubble .ql-picker.ql-header { + width: 98px; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item::before { + content: 'Normal'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="1"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + content: 'Heading 1'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + content: 'Heading 2'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + content: 'Heading 3'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + content: 'Heading 4'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="5"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + content: 'Heading 5'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="6"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + content: 'Heading 6'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + font-size: 2em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + font-size: 1.5em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + font-size: 1.17em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + font-size: 1em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + font-size: 0.83em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + font-size: 0.67em; +} +.ql-bubble .ql-picker.ql-font { + width: 108px; +} +.ql-bubble .ql-picker.ql-font .ql-picker-label::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item::before { + content: 'Sans Serif'; +} +.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=serif]::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + content: 'Serif'; +} +.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + content: 'Monospace'; +} +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + font-family: Georgia, Times New Roman, serif; +} +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + font-family: Monaco, Courier New, monospace; +} +.ql-bubble .ql-picker.ql-size { + width: 98px; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item::before { + content: 'Normal'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=small]::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + content: 'Small'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=large]::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + content: 'Large'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=huge]::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + content: 'Huge'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + font-size: 10px; +} +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + font-size: 18px; +} +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + font-size: 32px; +} +.ql-bubble .ql-color-picker.ql-background .ql-picker-item { + background-color: #fff; +} +.ql-bubble .ql-color-picker.ql-color .ql-picker-item { + background-color: #000; +} +.ql-bubble .ql-toolbar .ql-formats { + margin: 8px 12px 8px 0px; +} +.ql-bubble .ql-toolbar .ql-formats:first-child { + margin-left: 12px; +} +.ql-bubble .ql-color-picker svg { + margin: 1px; +} +.ql-bubble .ql-color-picker .ql-picker-item.ql-selected, +.ql-bubble .ql-color-picker .ql-picker-item:hover { + border-color: #fff; +} +.ql-bubble .ql-tooltip { + background-color: #444; + border-radius: 25px; + color: #fff; + margin-top: 10px; +} +.ql-bubble .ql-tooltip-arrow { + border-bottom: 6px solid #444; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + content: " "; + display: block; + left: 50%; + margin-left: -6px; + position: absolute; + top: -6px; +} +.ql-bubble .ql-tooltip.ql-editing .ql-tooltip-editor { + display: block; +} +.ql-bubble .ql-tooltip.ql-editing .ql-formats { + visibility: hidden; +} +.ql-bubble .ql-tooltip-editor { + display: none; +} +.ql-bubble .ql-tooltip-editor input[type=text] { + background: transparent; + border: none; + color: #fff; + font-size: 13px; + height: 100%; + outline: none; + padding: 10px 20px; + position: absolute; + width: 100%; +} +.ql-bubble .ql-tooltip-editor a { + top: 10px; + position: absolute; + right: 20px; +} +.ql-bubble .ql-tooltip-editor a:before { + color: #ccc; + content: "\D7"; + font-size: 16px; + font-weight: bold; +} diff -Nru bibledit-5.0.912/quill/1.1.5/quill.core.css bibledit-5.0.922/quill/1.1.5/quill.core.css --- bibledit-5.0.912/quill/1.1.5/quill.core.css 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.1.5/quill.core.css 2017-02-16 08:33:29.000000000 +0000 @@ -0,0 +1,390 @@ +/*! + * Quill Editor v1.1.5 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + */ +.ql-container { + box-sizing: border-box; + font-family: Helvetica, Arial, sans-serif; + font-size: 13px; + height: 100%; + margin: 0px; + position: relative; +} +.ql-container.ql-disabled .ql-tooltip { + visibility: hidden; +} +.ql-clipboard { + left: -100000px; + height: 1px; + overflow-y: hidden; + position: absolute; + top: 50%; +} +.ql-clipboard p { + margin: 0; + padding: 0; +} +.ql-editor { + box-sizing: border-box; + cursor: text; + line-height: 1.42; + height: 100%; + outline: none; + overflow-y: auto; + padding: 12px 15px; + tab-size: 4; + -moz-tab-size: 4; + text-align: left; + white-space: pre-wrap; + word-wrap: break-word; +} +.ql-editor p, +.ql-editor ol, +.ql-editor ul, +.ql-editor pre, +.ql-editor blockquote, +.ql-editor h1, +.ql-editor h2, +.ql-editor h3, +.ql-editor h4, +.ql-editor h5, +.ql-editor h6 { + margin: 0; + padding: 0; + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol, +.ql-editor ul { + padding-left: 1.5em; +} +.ql-editor ol > li, +.ql-editor ul > li { + list-style-type: none; +} +.ql-editor ul > li::before { + content: '\25CF'; +} +.ql-editor li::before { + display: inline-block; + margin-right: 0.3em; + text-align: right; + white-space: nowrap; + width: 1.2em; +} +.ql-editor li:not(.ql-direction-rtl)::before { + margin-left: -1.5em; +} +.ql-editor ol li, +.ql-editor ul li { + padding-left: 1.5em; +} +.ql-editor ol li { + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; + counter-increment: list-num; +} +.ql-editor ol li:before { + content: counter(list-num, decimal) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-increment: list-1; +} +.ql-editor ol li.ql-indent-1:before { + content: counter(list-1, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-2 { + counter-increment: list-2; +} +.ql-editor ol li.ql-indent-2:before { + content: counter(list-2, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-2 { + counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-3 { + counter-increment: list-3; +} +.ql-editor ol li.ql-indent-3:before { + content: counter(list-3, decimal) '. '; +} +.ql-editor ol li.ql-indent-3 { + counter-reset: list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-4 { + counter-increment: list-4; +} +.ql-editor ol li.ql-indent-4:before { + content: counter(list-4, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-4 { + counter-reset: list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-5 { + counter-increment: list-5; +} +.ql-editor ol li.ql-indent-5:before { + content: counter(list-5, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-5 { + counter-reset: list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-6 { + counter-increment: list-6; +} +.ql-editor ol li.ql-indent-6:before { + content: counter(list-6, decimal) '. '; +} +.ql-editor ol li.ql-indent-6 { + counter-reset: list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-7 { + counter-increment: list-7; +} +.ql-editor ol li.ql-indent-7:before { + content: counter(list-7, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-7 { + counter-reset: list-8 list-9; +} +.ql-editor ol li.ql-indent-8 { + counter-increment: list-8; +} +.ql-editor ol li.ql-indent-8:before { + content: counter(list-8, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-8 { + counter-reset: list-9; +} +.ql-editor ol li.ql-indent-9 { + counter-increment: list-9; +} +.ql-editor ol li.ql-indent-9:before { + content: counter(list-9, decimal) '. '; +} +.ql-editor .ql-indent-1:not(.ql-direction-rtl) { + padding-left: 3em; +} +.ql-editor li.ql-indent-1:not(.ql-direction-rtl) { + padding-left: 4.5em; +} +.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 3em; +} +.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 4.5em; +} +.ql-editor .ql-indent-2:not(.ql-direction-rtl) { + padding-left: 6em; +} +.ql-editor li.ql-indent-2:not(.ql-direction-rtl) { + padding-left: 7.5em; +} +.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 6em; +} +.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 7.5em; +} +.ql-editor .ql-indent-3:not(.ql-direction-rtl) { + padding-left: 9em; +} +.ql-editor li.ql-indent-3:not(.ql-direction-rtl) { + padding-left: 10.5em; +} +.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 9em; +} +.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 10.5em; +} +.ql-editor .ql-indent-4:not(.ql-direction-rtl) { + padding-left: 12em; +} +.ql-editor li.ql-indent-4:not(.ql-direction-rtl) { + padding-left: 13.5em; +} +.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 12em; +} +.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 13.5em; +} +.ql-editor .ql-indent-5:not(.ql-direction-rtl) { + padding-left: 15em; +} +.ql-editor li.ql-indent-5:not(.ql-direction-rtl) { + padding-left: 16.5em; +} +.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 15em; +} +.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 16.5em; +} +.ql-editor .ql-indent-6:not(.ql-direction-rtl) { + padding-left: 18em; +} +.ql-editor li.ql-indent-6:not(.ql-direction-rtl) { + padding-left: 19.5em; +} +.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 18em; +} +.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 19.5em; +} +.ql-editor .ql-indent-7:not(.ql-direction-rtl) { + padding-left: 21em; +} +.ql-editor li.ql-indent-7:not(.ql-direction-rtl) { + padding-left: 22.5em; +} +.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 21em; +} +.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 22.5em; +} +.ql-editor .ql-indent-8:not(.ql-direction-rtl) { + padding-left: 24em; +} +.ql-editor li.ql-indent-8:not(.ql-direction-rtl) { + padding-left: 25.5em; +} +.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 24em; +} +.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 25.5em; +} +.ql-editor .ql-indent-9:not(.ql-direction-rtl) { + padding-left: 27em; +} +.ql-editor li.ql-indent-9:not(.ql-direction-rtl) { + padding-left: 28.5em; +} +.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 27em; +} +.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 28.5em; +} +.ql-editor .ql-video { + display: block; + max-width: 100%; +} +.ql-editor .ql-video.ql-align-center { + margin: 0 auto; +} +.ql-editor .ql-video.ql-align-right { + margin: 0 0 0 auto; +} +.ql-editor .ql-bg-black { + background-color: #000; +} +.ql-editor .ql-bg-red { + background-color: #e60000; +} +.ql-editor .ql-bg-orange { + background-color: #f90; +} +.ql-editor .ql-bg-yellow { + background-color: #ff0; +} +.ql-editor .ql-bg-green { + background-color: #008a00; +} +.ql-editor .ql-bg-blue { + background-color: #06c; +} +.ql-editor .ql-bg-purple { + background-color: #93f; +} +.ql-editor .ql-color-white { + color: #fff; +} +.ql-editor .ql-color-red { + color: #e60000; +} +.ql-editor .ql-color-orange { + color: #f90; +} +.ql-editor .ql-color-yellow { + color: #ff0; +} +.ql-editor .ql-color-green { + color: #008a00; +} +.ql-editor .ql-color-blue { + color: #06c; +} +.ql-editor .ql-color-purple { + color: #93f; +} +.ql-editor .ql-font-serif { + font-family: Georgia, Times New Roman, serif; +} +.ql-editor .ql-font-monospace { + font-family: Monaco, Courier New, monospace; +} +.ql-editor .ql-size-small { + font-size: 0.75em; +} +.ql-editor .ql-size-large { + font-size: 1.5em; +} +.ql-editor .ql-size-huge { + font-size: 2.5em; +} +.ql-editor .ql-direction-rtl { + direction: rtl; + text-align: inherit; +} +.ql-editor .ql-align-center { + text-align: center; +} +.ql-editor .ql-align-justify { + text-align: justify; +} +.ql-editor .ql-align-right { + text-align: right; +} +.ql-editor.ql-blank::before { + color: rgba(0,0,0,0.6); + content: attr(data-placeholder); + font-style: italic; + pointer-events: none; + position: absolute; +} diff -Nru bibledit-5.0.912/quill/1.1.5/quill.core.js bibledit-5.0.922/quill/1.1.5/quill.core.js --- bibledit-5.0.912/quill/1.1.5/quill.core.js 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.1.5/quill.core.js 2020-09-18 15:38:14.000000000 +0000 @@ -0,0 +1,7909 @@ +/*! + * Quill Editor v1.1.5 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["Quill"] = factory(); + else + root["Quill"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(1); + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _quill = __webpack_require__(18); + + var _quill2 = _interopRequireDefault(_quill); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + var _break = __webpack_require__(31); + + var _break2 = _interopRequireDefault(_break); + + var _container = __webpack_require__(46); + + var _container2 = _interopRequireDefault(_container); + + var _cursor = __webpack_require__(35); + + var _cursor2 = _interopRequireDefault(_cursor); + + var _embed = __webpack_require__(32); + + var _embed2 = _interopRequireDefault(_embed); + + var _inline = __webpack_require__(33); + + var _inline2 = _interopRequireDefault(_inline); + + var _scroll = __webpack_require__(47); + + var _scroll2 = _interopRequireDefault(_scroll); + + var _text = __webpack_require__(34); + + var _text2 = _interopRequireDefault(_text); + + var _clipboard = __webpack_require__(48); + + var _clipboard2 = _interopRequireDefault(_clipboard); + + var _history = __webpack_require__(55); + + var _history2 = _interopRequireDefault(_history); + + var _keyboard = __webpack_require__(56); + + var _keyboard2 = _interopRequireDefault(_keyboard); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + _quill2.default.register({ + 'blots/block': _block2.default, + 'blots/block/embed': _block.BlockEmbed, + 'blots/break': _break2.default, + 'blots/container': _container2.default, + 'blots/cursor': _cursor2.default, + 'blots/embed': _embed2.default, + 'blots/inline': _inline2.default, + 'blots/scroll': _scroll2.default, + 'blots/text': _text2.default, + + 'modules/clipboard': _clipboard2.default, + 'modules/history': _history2.default, + 'modules/keyboard': _keyboard2.default + }); + + _parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); + + module.exports = _quill2.default; + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var container_1 = __webpack_require__(3); + var format_1 = __webpack_require__(7); + var leaf_1 = __webpack_require__(12); + var scroll_1 = __webpack_require__(13); + var inline_1 = __webpack_require__(14); + var block_1 = __webpack_require__(15); + var embed_1 = __webpack_require__(16); + var text_1 = __webpack_require__(17); + var attributor_1 = __webpack_require__(8); + var class_1 = __webpack_require__(10); + var style_1 = __webpack_require__(11); + var store_1 = __webpack_require__(9); + var Registry = __webpack_require__(6); + var Parchment = { + Scope: Registry.Scope, + create: Registry.create, + find: Registry.find, + query: Registry.query, + register: Registry.register, + Container: container_1.default, + Format: format_1.default, + Leaf: leaf_1.default, + Embed: embed_1.default, + Scroll: scroll_1.default, + Block: block_1.default, + Inline: inline_1.default, + Text: text_1.default, + Attributor: { + Attribute: attributor_1.default, + Class: class_1.default, + Style: style_1.default, + Store: store_1.default + } + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Parchment; + + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var linked_list_1 = __webpack_require__(4); + var shadow_1 = __webpack_require__(5); + var Registry = __webpack_require__(6); + var ContainerBlot = (function (_super) { + __extends(ContainerBlot, _super); + function ContainerBlot() { + _super.apply(this, arguments); + } + ContainerBlot.prototype.appendChild = function (other) { + this.insertBefore(other); + }; + ContainerBlot.prototype.attach = function () { + var _this = this; + _super.prototype.attach.call(this); + this.children = new linked_list_1.default(); + // Need to be reversed for if DOM nodes already in order + [].slice.call(this.domNode.childNodes).reverse().forEach(function (node) { + try { + var child = makeBlot(node); + _this.insertBefore(child, _this.children.head); + } + catch (err) { + if (err instanceof Registry.ParchmentError) + return; + else + throw err; + } + }); + }; + ContainerBlot.prototype.deleteAt = function (index, length) { + if (index === 0 && length === this.length()) { + return this.remove(); + } + this.children.forEachAt(index, length, function (child, offset, length) { + child.deleteAt(offset, length); + }); + }; + ContainerBlot.prototype.descendant = function (criteria, index) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + return [child, offset]; + } + else if (child instanceof ContainerBlot) { + return child.descendant(criteria, offset); + } + else { + return [null, -1]; + } + }; + ContainerBlot.prototype.descendants = function (criteria, index, length) { + if (index === void 0) { index = 0; } + if (length === void 0) { length = Number.MAX_VALUE; } + var descendants = [], lengthLeft = length; + this.children.forEachAt(index, length, function (child, index, length) { + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + descendants.push(child); + } + if (child instanceof ContainerBlot) { + descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); + } + lengthLeft -= length; + }); + return descendants; + }; + ContainerBlot.prototype.detach = function () { + this.children.forEach(function (child) { + child.detach(); + }); + _super.prototype.detach.call(this); + }; + ContainerBlot.prototype.formatAt = function (index, length, name, value) { + this.children.forEachAt(index, length, function (child, offset, length) { + child.formatAt(offset, length, name, value); + }); + }; + ContainerBlot.prototype.insertAt = function (index, value, def) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if (child) { + child.insertAt(offset, value, def); + } + else { + var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def); + this.appendChild(blot); + } + }; + ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { + if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function (child) { + return childBlot instanceof child; + })) { + throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); + } + childBlot.insertInto(this, refBlot); + }; + ContainerBlot.prototype.length = function () { + return this.children.reduce(function (memo, child) { + return memo + child.length(); + }, 0); + }; + ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { + this.children.forEach(function (child) { + targetParent.insertBefore(child, refNode); + }); + }; + ContainerBlot.prototype.optimize = function () { + _super.prototype.optimize.call(this); + if (this.children.length === 0) { + if (this.statics.defaultChild != null) { + var child = Registry.create(this.statics.defaultChild); + this.appendChild(child); + child.optimize(); + } + else { + this.remove(); + } + } + }; + ContainerBlot.prototype.path = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; + var position = [[this, index]]; + if (child instanceof ContainerBlot) { + return position.concat(child.path(offset, inclusive)); + } + else if (child != null) { + position.push([child, offset]); + } + return position; + }; + ContainerBlot.prototype.removeChild = function (child) { + this.children.remove(child); + }; + ContainerBlot.prototype.replace = function (target) { + if (target instanceof ContainerBlot) { + target.moveChildren(this); + } + _super.prototype.replace.call(this, target); + }; + ContainerBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = this.clone(); + this.parent.insertBefore(after, this.next); + this.children.forEachAt(index, this.length(), function (child, offset, length) { + child = child.split(offset, force); + after.appendChild(child); + }); + return after; + }; + ContainerBlot.prototype.unwrap = function () { + this.moveChildren(this.parent, this.next); + this.remove(); + }; + ContainerBlot.prototype.update = function (mutations) { + var _this = this; + var addedNodes = [], removedNodes = []; + mutations.forEach(function (mutation) { + if (mutation.target === _this.domNode && mutation.type === 'childList') { + addedNodes.push.apply(addedNodes, mutation.addedNodes); + removedNodes.push.apply(removedNodes, mutation.removedNodes); + } + }); + removedNodes.forEach(function (node) { + if (node.parentNode != null && + (document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY)) { + // Node has not actually been removed + return; + } + var blot = Registry.find(node); + if (blot == null) + return; + if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { + blot.detach(); + } + }); + addedNodes.filter(function (node) { + return node.parentNode == _this.domNode; + }).sort(function (a, b) { + if (a === b) + return 0; + if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { + return 1; + } + return -1; + }).forEach(function (node) { + var refBlot = null; + if (node.nextSibling != null) { + refBlot = Registry.find(node.nextSibling); + } + var blot = makeBlot(node); + if (blot.next != refBlot || blot.next == null) { + if (blot.parent != null) { + blot.parent.removeChild(_this); + } + _this.insertBefore(blot, refBlot); + } + }); + }; + return ContainerBlot; + }(shadow_1.default)); + function makeBlot(node) { + var blot = Registry.find(node); + if (blot == null) { + try { + blot = Registry.create(node); + } + catch (e) { + blot = Registry.create(Registry.Scope.INLINE); + [].slice.call(node.childNodes).forEach(function (child) { + blot.domNode.appendChild(child); + }); + node.parentNode.replaceChild(blot.domNode, node); + blot.attach(); + } + } + return blot; + } + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = ContainerBlot; + + +/***/ }, +/* 4 */ +/***/ function(module, exports) { + + "use strict"; + var LinkedList = (function () { + function LinkedList() { + this.head = this.tail = undefined; + this.length = 0; + } + LinkedList.prototype.append = function () { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i - 0] = arguments[_i]; + } + this.insertBefore(nodes[0], undefined); + if (nodes.length > 1) { + this.append.apply(this, nodes.slice(1)); + } + }; + LinkedList.prototype.contains = function (node) { + var cur, next = this.iterator(); + while (cur = next()) { + if (cur === node) + return true; + } + return false; + }; + LinkedList.prototype.insertBefore = function (node, refNode) { + node.next = refNode; + if (refNode != null) { + node.prev = refNode.prev; + if (refNode.prev != null) { + refNode.prev.next = node; + } + refNode.prev = node; + if (refNode === this.head) { + this.head = node; + } + } + else if (this.tail != null) { + this.tail.next = node; + node.prev = this.tail; + this.tail = node; + } + else { + node.prev = undefined; + this.head = this.tail = node; + } + this.length += 1; + }; + LinkedList.prototype.offset = function (target) { + var index = 0, cur = this.head; + while (cur != null) { + if (cur === target) + return index; + index += cur.length(); + cur = cur.next; + } + return -1; + }; + LinkedList.prototype.remove = function (node) { + if (!this.contains(node)) + return; + if (node.prev != null) + node.prev.next = node.next; + if (node.next != null) + node.next.prev = node.prev; + if (node === this.head) + this.head = node.next; + if (node === this.tail) + this.tail = node.prev; + this.length -= 1; + }; + LinkedList.prototype.iterator = function (curNode) { + if (curNode === void 0) { curNode = this.head; } + // TODO use yield when we can + return function () { + var ret = curNode; + if (curNode != null) + curNode = curNode.next; + return ret; + }; + }; + LinkedList.prototype.find = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var cur, next = this.iterator(); + while (cur = next()) { + var length_1 = cur.length(); + if (index < length_1 || (inclusive && index === length_1 && (cur.next == null || cur.next.length() !== 0))) { + return [cur, index]; + } + index -= length_1; + } + return [null, 0]; + }; + LinkedList.prototype.forEach = function (callback) { + var cur, next = this.iterator(); + while (cur = next()) { + callback(cur); + } + }; + LinkedList.prototype.forEachAt = function (index, length, callback) { + if (length <= 0) + return; + var _a = this.find(index), startNode = _a[0], offset = _a[1]; + var cur, curIndex = index - offset, next = this.iterator(startNode); + while ((cur = next()) && curIndex < index + length) { + var curLength = cur.length(); + if (index > curIndex) { + callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); + } + else { + callback(cur, 0, Math.min(curLength, index + length - curIndex)); + } + curIndex += curLength; + } + }; + LinkedList.prototype.map = function (callback) { + return this.reduce(function (memo, cur) { + memo.push(callback(cur)); + return memo; + }, []); + }; + LinkedList.prototype.reduce = function (callback, memo) { + var cur, next = this.iterator(); + while (cur = next()) { + memo = callback(memo, cur); + } + return memo; + }; + return LinkedList; + }()); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = LinkedList; + + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var Registry = __webpack_require__(6); + var ShadowBlot = (function () { + function ShadowBlot(domNode) { + this.domNode = domNode; + this.attach(); + } + Object.defineProperty(ShadowBlot.prototype, "statics", { + // Hack for accessing inherited static methods + get: function () { + return this.constructor; + }, + enumerable: true, + configurable: true + }); + ShadowBlot.create = function (value) { + if (this.tagName == null) { + throw new Registry.ParchmentError('Blot definition missing tagName'); + } + var node; + if (Array.isArray(this.tagName)) { + if (typeof value === 'string') { + value = value.toUpperCase(); + if (parseInt(value).toString() === value) { + value = parseInt(value); + } + } + if (typeof value === 'number') { + node = document.createElement(this.tagName[value - 1]); + } + else if (this.tagName.indexOf(value) > -1) { + node = document.createElement(value); + } + else { + node = document.createElement(this.tagName[0]); + } + } + else { + node = document.createElement(this.tagName); + } + if (this.className) { + node.classList.add(this.className); + } + return node; + }; + ShadowBlot.prototype.attach = function () { + this.domNode[Registry.DATA_KEY] = { blot: this }; + }; + ShadowBlot.prototype.clone = function () { + var domNode = this.domNode.cloneNode(); + return Registry.create(domNode); + }; + ShadowBlot.prototype.detach = function () { + if (this.parent != null) + this.parent.removeChild(this); + delete this.domNode[Registry.DATA_KEY]; + }; + ShadowBlot.prototype.deleteAt = function (index, length) { + var blot = this.isolate(index, length); + blot.remove(); + }; + ShadowBlot.prototype.formatAt = function (index, length, name, value) { + var blot = this.isolate(index, length); + if (Registry.query(name, Registry.Scope.BLOT) != null && value) { + blot.wrap(name, value); + } + else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { + var parent_1 = Registry.create(this.statics.scope); + blot.wrap(parent_1); + parent_1.format(name, value); + } + }; + ShadowBlot.prototype.insertAt = function (index, value, def) { + var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def); + var ref = this.split(index); + this.parent.insertBefore(blot, ref); + }; + ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { + if (this.parent != null) { + this.parent.children.remove(this); + } + parentBlot.children.insertBefore(this, refBlot); + if (refBlot != null) { + var refDomNode = refBlot.domNode; + } + if (this.next == null || this.domNode.nextSibling != refDomNode) { + parentBlot.domNode.insertBefore(this.domNode, refDomNode); + } + this.parent = parentBlot; + }; + ShadowBlot.prototype.isolate = function (index, length) { + var target = this.split(index); + target.split(length); + return target; + }; + ShadowBlot.prototype.length = function () { + return 1; + }; + ; + ShadowBlot.prototype.offset = function (root) { + if (root === void 0) { root = this.parent; } + if (this.parent == null || this == root) + return 0; + return this.parent.children.offset(this) + this.parent.offset(root); + }; + ShadowBlot.prototype.optimize = function () { + // TODO clean up once we use WeakMap + if (this.domNode[Registry.DATA_KEY] != null) { + delete this.domNode[Registry.DATA_KEY].mutations; + } + }; + ShadowBlot.prototype.remove = function () { + if (this.domNode.parentNode != null) { + this.domNode.parentNode.removeChild(this.domNode); + } + this.detach(); + }; + ShadowBlot.prototype.replace = function (target) { + if (target.parent == null) + return; + target.parent.insertBefore(this, target.next); + target.remove(); + }; + ShadowBlot.prototype.replaceWith = function (name, value) { + var replacement = typeof name === 'string' ? Registry.create(name, value) : name; + replacement.replace(this); + return replacement; + }; + ShadowBlot.prototype.split = function (index, force) { + return index === 0 ? this : this.next; + }; + ShadowBlot.prototype.update = function (mutations) { + if (mutations === void 0) { mutations = []; } + // Nothing to do by default + }; + ShadowBlot.prototype.wrap = function (name, value) { + var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; + if (this.parent != null) { + this.parent.insertBefore(wrapper, this.next); + } + wrapper.appendChild(this); + return wrapper; + }; + ShadowBlot.blotName = 'abstract'; + return ShadowBlot; + }()); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = ShadowBlot; + + +/***/ }, +/* 6 */ +/***/ function(module, exports) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ParchmentError = (function (_super) { + __extends(ParchmentError, _super); + function ParchmentError(message) { + message = '[Parchment] ' + message; + _super.call(this, message); + this.message = message; + this.name = this.constructor.name; + } + return ParchmentError; + }(Error)); + exports.ParchmentError = ParchmentError; + var attributes = {}; + var classes = {}; + var tags = {}; + var types = {}; + exports.DATA_KEY = '__blot'; + (function (Scope) { + Scope[Scope["TYPE"] = 3] = "TYPE"; + Scope[Scope["LEVEL"] = 12] = "LEVEL"; + Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; + Scope[Scope["BLOT"] = 14] = "BLOT"; + Scope[Scope["INLINE"] = 7] = "INLINE"; + Scope[Scope["BLOCK"] = 11] = "BLOCK"; + Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; + Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; + Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; + Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; + Scope[Scope["ANY"] = 15] = "ANY"; + })(exports.Scope || (exports.Scope = {})); + var Scope = exports.Scope; + ; + function create(input, value) { + var match = query(input); + if (match == null) { + throw new ParchmentError("Unable to create " + input + " blot"); + } + var BlotClass = match; + var node = input instanceof Node ? input : BlotClass.create(value); + return new BlotClass(node, value); + } + exports.create = create; + function find(node, bubble) { + if (bubble === void 0) { bubble = false; } + if (node == null) + return null; + if (node[exports.DATA_KEY] != null) + return node[exports.DATA_KEY].blot; + if (bubble) + return find(node.parentNode, bubble); + return null; + } + exports.find = find; + function query(query, scope) { + if (scope === void 0) { scope = Scope.ANY; } + var match; + if (typeof query === 'string') { + match = types[query] || attributes[query]; + } + else if (query instanceof Text) { + match = types['text']; + } + else if (typeof query === 'number') { + if (query & Scope.LEVEL & Scope.BLOCK) { + match = types['block']; + } + else if (query & Scope.LEVEL & Scope.INLINE) { + match = types['inline']; + } + } + else if (query instanceof HTMLElement) { + var names = (query.getAttribute('class') || '').split(/\s+/); + for (var i in names) { + match = classes[names[i]]; + if (match) + break; + } + match = match || tags[query.tagName]; + } + if (match == null) { + if (query instanceof Node) { + console.log(query.nodeType); + } + } + if (match == null) + return null; + if ((scope & Scope.LEVEL & match.scope) && (scope & Scope.TYPE & match.scope)) + return match; + return null; + } + exports.query = query; + function register() { + var Definitions = []; + for (var _i = 0; _i < arguments.length; _i++) { + Definitions[_i - 0] = arguments[_i]; + } + if (Definitions.length > 1) { + return Definitions.map(function (d) { + return register(d); + }); + } + var Definition = Definitions[0]; + if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { + throw new ParchmentError('Invalid definition'); + } + else if (Definition.blotName === 'abstract') { + throw new ParchmentError('Cannot register abstract class'); + } + types[Definition.blotName || Definition.attrName] = Definition; + if (typeof Definition.keyName === 'string') { + attributes[Definition.keyName] = Definition; + } + else { + if (Definition.className != null) { + classes[Definition.className] = Definition; + } + if (Definition.tagName != null) { + if (Array.isArray(Definition.tagName)) { + Definition.tagName = Definition.tagName.map(function (tagName) { + return tagName.toUpperCase(); + }); + } + else { + Definition.tagName = Definition.tagName.toUpperCase(); + } + var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; + tagNames.forEach(function (tag) { + if (tags[tag] == null || Definition.className == null) { + tags[tag] = Definition; + } + }); + } + } + return Definition; + } + exports.register = register; + + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var attributor_1 = __webpack_require__(8); + var store_1 = __webpack_require__(9); + var container_1 = __webpack_require__(3); + var Registry = __webpack_require__(6); + var FormatBlot = (function (_super) { + __extends(FormatBlot, _super); + function FormatBlot() { + _super.apply(this, arguments); + } + FormatBlot.formats = function (domNode) { + if (typeof this.tagName === 'string') { + return true; + } + else if (Array.isArray(this.tagName)) { + return domNode.tagName.toLowerCase(); + } + return undefined; + }; + FormatBlot.prototype.attach = function () { + _super.prototype.attach.call(this); + this.attributes = new store_1.default(this.domNode); + }; + FormatBlot.prototype.format = function (name, value) { + var format = Registry.query(name); + if (format instanceof attributor_1.default) { + this.attributes.attribute(format, value); + } + else if (value) { + if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { + this.replaceWith(name, value); + } + } + }; + FormatBlot.prototype.formats = function () { + var formats = this.attributes.values(); + var format = this.statics.formats(this.domNode); + if (format != null) { + formats[this.statics.blotName] = format; + } + return formats; + }; + FormatBlot.prototype.replaceWith = function (name, value) { + var replacement = _super.prototype.replaceWith.call(this, name, value); + this.attributes.copy(replacement); + return replacement; + }; + FormatBlot.prototype.update = function (mutations) { + var _this = this; + _super.prototype.update.call(this, mutations); + if (mutations.some(function (mutation) { + return mutation.target === _this.domNode && mutation.type === 'attributes'; + })) { + this.attributes.build(); + } + }; + FormatBlot.prototype.wrap = function (name, value) { + var wrapper = _super.prototype.wrap.call(this, name, value); + if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { + this.attributes.move(wrapper); + } + return wrapper; + }; + return FormatBlot; + }(container_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = FormatBlot; + + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var Registry = __webpack_require__(6); + var Attributor = (function () { + function Attributor(attrName, keyName, options) { + if (options === void 0) { options = {}; } + this.attrName = attrName; + this.keyName = keyName; + var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; + if (options.scope != null) { + // Ignore type bits, force attribute bit + this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; + } + else { + this.scope = Registry.Scope.ATTRIBUTE; + } + if (options.whitelist != null) + this.whitelist = options.whitelist; + } + Attributor.keys = function (node) { + return [].map.call(node.attributes, function (item) { + return item.name; + }); + }; + Attributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + node.setAttribute(this.keyName, value); + return true; + }; + Attributor.prototype.canAdd = function (node, value) { + var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); + if (match != null && (this.whitelist == null || this.whitelist.indexOf(value) > -1)) { + return true; + } + return false; + }; + Attributor.prototype.remove = function (node) { + node.removeAttribute(this.keyName); + }; + Attributor.prototype.value = function (node) { + return node.getAttribute(this.keyName); + }; + return Attributor; + }()); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Attributor; + + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var attributor_1 = __webpack_require__(8); + var class_1 = __webpack_require__(10); + var style_1 = __webpack_require__(11); + var Registry = __webpack_require__(6); + var AttributorStore = (function () { + function AttributorStore(domNode) { + this.attributes = {}; + this.domNode = domNode; + this.build(); + } + AttributorStore.prototype.attribute = function (attribute, value) { + if (value) { + if (attribute.add(this.domNode, value)) { + if (attribute.value(this.domNode) != null) { + this.attributes[attribute.attrName] = attribute; + } + else { + delete this.attributes[attribute.attrName]; + } + } + } + else { + attribute.remove(this.domNode); + delete this.attributes[attribute.attrName]; + } + }; + AttributorStore.prototype.build = function () { + var _this = this; + this.attributes = {}; + var attributes = attributor_1.default.keys(this.domNode); + var classes = class_1.default.keys(this.domNode); + var styles = style_1.default.keys(this.domNode); + attributes.concat(classes).concat(styles).forEach(function (name) { + var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); + if (attr instanceof attributor_1.default) { + _this.attributes[attr.attrName] = attr; + } + }); + }; + AttributorStore.prototype.copy = function (target) { + var _this = this; + Object.keys(this.attributes).forEach(function (key) { + var value = _this.attributes[key].value(_this.domNode); + target.format(key, value); + }); + }; + AttributorStore.prototype.move = function (target) { + var _this = this; + this.copy(target); + Object.keys(this.attributes).forEach(function (key) { + _this.attributes[key].remove(_this.domNode); + }); + this.attributes = {}; + }; + AttributorStore.prototype.values = function () { + var _this = this; + return Object.keys(this.attributes).reduce(function (attributes, name) { + attributes[name] = _this.attributes[name].value(_this.domNode); + return attributes; + }, {}); + }; + return AttributorStore; + }()); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = AttributorStore; + + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var attributor_1 = __webpack_require__(8); + function match(node, prefix) { + var className = node.getAttribute('class') || ''; + return className.split(/\s+/).filter(function (name) { + return name.indexOf(prefix + "-") === 0; + }); + } + var ClassAttributor = (function (_super) { + __extends(ClassAttributor, _super); + function ClassAttributor() { + _super.apply(this, arguments); + } + ClassAttributor.keys = function (node) { + return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { + return name.split('-').slice(0, -1).join('-'); + }); + }; + ClassAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + this.remove(node); + node.classList.add(this.keyName + "-" + value); + return true; + }; + ClassAttributor.prototype.remove = function (node) { + var matches = match(node, this.keyName); + matches.forEach(function (name) { + node.classList.remove(name); + }); + if (node.classList.length === 0) { + node.removeAttribute('class'); + } + }; + ClassAttributor.prototype.value = function (node) { + var result = match(node, this.keyName)[0] || ''; + return result.slice(this.keyName.length + 1); // +1 for hyphen + }; + return ClassAttributor; + }(attributor_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = ClassAttributor; + + +/***/ }, +/* 11 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var attributor_1 = __webpack_require__(8); + function camelize(name) { + var parts = name.split('-'); + var rest = parts.slice(1).map(function (part) { + return part[0].toUpperCase() + part.slice(1); + }).join(''); + return parts[0] + rest; + } + var StyleAttributor = (function (_super) { + __extends(StyleAttributor, _super); + function StyleAttributor() { + _super.apply(this, arguments); + } + StyleAttributor.keys = function (node) { + return (node.getAttribute('style') || '').split(';').map(function (value) { + var arr = value.split(':'); + return arr[0].trim(); + }); + }; + StyleAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + node.style[camelize(this.keyName)] = value; + return true; + }; + StyleAttributor.prototype.remove = function (node) { + node.style[camelize(this.keyName)] = ''; + if (!node.getAttribute('style')) { + node.removeAttribute('style'); + } + }; + StyleAttributor.prototype.value = function (node) { + return node.style[camelize(this.keyName)]; + }; + return StyleAttributor; + }(attributor_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = StyleAttributor; + + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var shadow_1 = __webpack_require__(5); + var Registry = __webpack_require__(6); + var LeafBlot = (function (_super) { + __extends(LeafBlot, _super); + function LeafBlot() { + _super.apply(this, arguments); + } + LeafBlot.value = function (domNode) { + return true; + }; + LeafBlot.prototype.index = function (node, offset) { + if (node !== this.domNode) + return -1; + return Math.min(offset, 1); + }; + LeafBlot.prototype.position = function (index, inclusive) { + var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); + if (index > 0) + offset += 1; + return [this.parent.domNode, offset]; + }; + LeafBlot.prototype.value = function () { + return (_a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a); + var _a; + }; + LeafBlot.scope = Registry.Scope.INLINE_BLOT; + return LeafBlot; + }(shadow_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = LeafBlot; + + +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var container_1 = __webpack_require__(3); + var Registry = __webpack_require__(6); + var OBSERVER_CONFIG = { + attributes: true, + characterData: true, + characterDataOldValue: true, + childList: true, + subtree: true + }; + var MAX_OPTIMIZE_ITERATIONS = 100; + var ScrollBlot = (function (_super) { + __extends(ScrollBlot, _super); + function ScrollBlot(node) { + var _this = this; + _super.call(this, node); + this.parent = null; + this.observer = new MutationObserver(function (mutations) { + _this.update(mutations); + }); + this.observer.observe(this.domNode, OBSERVER_CONFIG); + } + ScrollBlot.prototype.detach = function () { + _super.prototype.detach.call(this); + this.observer.disconnect(); + }; + ScrollBlot.prototype.deleteAt = function (index, length) { + this.update(); + if (index === 0 && length === this.length()) { + this.children.forEach(function (child) { + child.remove(); + }); + } + else { + _super.prototype.deleteAt.call(this, index, length); + } + }; + ScrollBlot.prototype.formatAt = function (index, length, name, value) { + this.update(); + _super.prototype.formatAt.call(this, index, length, name, value); + }; + ScrollBlot.prototype.insertAt = function (index, value, def) { + this.update(); + _super.prototype.insertAt.call(this, index, value, def); + }; + ScrollBlot.prototype.optimize = function (mutations) { + var _this = this; + if (mutations === void 0) { mutations = []; } + _super.prototype.optimize.call(this); + mutations.push.apply(mutations, this.observer.takeRecords()); + // TODO use WeakMap + var mark = function (blot, markParent) { + if (markParent === void 0) { markParent = true; } + if (blot == null || blot === _this) + return; + if (blot.domNode.parentNode == null) + return; + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + blot.domNode[Registry.DATA_KEY].mutations = []; + } + if (markParent) + mark(blot.parent); + }; + var optimize = function (blot) { + if (blot.domNode[Registry.DATA_KEY] == null || blot.domNode[Registry.DATA_KEY].mutations == null) { + return; + } + if (blot instanceof container_1.default) { + blot.children.forEach(optimize); + } + blot.optimize(); + }; + var remaining = mutations; + for (var i = 0; remaining.length > 0; i += 1) { + if (i >= MAX_OPTIMIZE_ITERATIONS) { + throw new Error('[Parchment] Maximum optimize iterations reached'); + } + remaining.forEach(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return; + if (blot.domNode === mutation.target) { + if (mutation.type === 'childList') { + mark(Registry.find(mutation.previousSibling, false)); + [].forEach.call(mutation.addedNodes, function (node) { + var child = Registry.find(node, false); + mark(child, false); + if (child instanceof container_1.default) { + child.children.forEach(function (grandChild) { + mark(grandChild, false); + }); + } + }); + } + else if (mutation.type === 'attributes') { + mark(blot.prev); + } + } + mark(blot); + }); + this.children.forEach(optimize); + remaining = this.observer.takeRecords(); + mutations.push.apply(mutations, remaining); + } + }; + ScrollBlot.prototype.update = function (mutations) { + var _this = this; + mutations = mutations || this.observer.takeRecords(); + // TODO use WeakMap + mutations.map(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return; + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + blot.domNode[Registry.DATA_KEY].mutations = [mutation]; + return blot; + } + else { + blot.domNode[Registry.DATA_KEY].mutations.push(mutation); + return null; + } + }).forEach(function (blot) { + if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null) + return; + blot.update(blot.domNode[Registry.DATA_KEY].mutations || []); + }); + if (this.domNode[Registry.DATA_KEY].mutations != null) { + _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations); + } + this.optimize(mutations); + }; + ScrollBlot.blotName = 'scroll'; + ScrollBlot.defaultChild = 'block'; + ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; + ScrollBlot.tagName = 'DIV'; + return ScrollBlot; + }(container_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = ScrollBlot; + + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var format_1 = __webpack_require__(7); + var Registry = __webpack_require__(6); + // Shallow object comparison + function isEqual(obj1, obj2) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) + return false; + for (var prop in obj1) { + if (obj1[prop] !== obj2[prop]) + return false; + } + return true; + } + var InlineBlot = (function (_super) { + __extends(InlineBlot, _super); + function InlineBlot() { + _super.apply(this, arguments); + } + InlineBlot.formats = function (domNode) { + if (domNode.tagName === InlineBlot.tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + InlineBlot.prototype.format = function (name, value) { + var _this = this; + if (name === this.statics.blotName && !value) { + this.children.forEach(function (child) { + if (!(child instanceof format_1.default)) { + child = child.wrap(InlineBlot.blotName, true); + } + _this.attributes.copy(child); + }); + this.unwrap(); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + InlineBlot.prototype.formatAt = function (index, length, name, value) { + if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { + var blot = this.isolate(index, length); + blot.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + InlineBlot.prototype.optimize = function () { + _super.prototype.optimize.call(this); + var formats = this.formats(); + if (Object.keys(formats).length === 0) { + return this.unwrap(); // unformatted span + } + var next = this.next; + if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { + next.moveChildren(this); + next.remove(); + } + }; + InlineBlot.blotName = 'inline'; + InlineBlot.scope = Registry.Scope.INLINE_BLOT; + InlineBlot.tagName = 'SPAN'; + return InlineBlot; + }(format_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = InlineBlot; + + +/***/ }, +/* 15 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var format_1 = __webpack_require__(7); + var Registry = __webpack_require__(6); + var BlockBlot = (function (_super) { + __extends(BlockBlot, _super); + function BlockBlot() { + _super.apply(this, arguments); + } + BlockBlot.formats = function (domNode) { + var tagName = Registry.query(BlockBlot.blotName).tagName; + if (domNode.tagName === tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + BlockBlot.prototype.format = function (name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) == null) { + return; + } + else if (name === this.statics.blotName && !value) { + this.replaceWith(BlockBlot.blotName); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + BlockBlot.prototype.formatAt = function (index, length, name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) != null) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + BlockBlot.prototype.insertAt = function (index, value, def) { + if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { + // Insert text or inline + _super.prototype.insertAt.call(this, index, value, def); + } + else { + var after = this.split(index); + var blot = Registry.create(value, def); + after.parent.insertBefore(blot, after); + } + }; + BlockBlot.blotName = 'block'; + BlockBlot.scope = Registry.Scope.BLOCK_BLOT; + BlockBlot.tagName = 'P'; + return BlockBlot; + }(format_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = BlockBlot; + + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var leaf_1 = __webpack_require__(12); + var EmbedBlot = (function (_super) { + __extends(EmbedBlot, _super); + function EmbedBlot() { + _super.apply(this, arguments); + } + EmbedBlot.formats = function (domNode) { + return undefined; + }; + EmbedBlot.prototype.format = function (name, value) { + // super.formatAt wraps, which is what we want in general, + // but this allows subclasses to overwrite for formats + // that just apply to particular embeds + _super.prototype.formatAt.call(this, 0, this.length(), name, value); + }; + EmbedBlot.prototype.formatAt = function (index, length, name, value) { + if (index === 0 && length === this.length()) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + EmbedBlot.prototype.formats = function () { + return this.statics.formats(this.domNode); + }; + return EmbedBlot; + }(leaf_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = EmbedBlot; + + +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var leaf_1 = __webpack_require__(12); + var Registry = __webpack_require__(6); + var TextBlot = (function (_super) { + __extends(TextBlot, _super); + function TextBlot(node) { + _super.call(this, node); + this.text = this.statics.value(this.domNode); + } + TextBlot.create = function (value) { + return document.createTextNode(value); + }; + TextBlot.value = function (domNode) { + return domNode.data; + }; + TextBlot.prototype.deleteAt = function (index, length) { + this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); + }; + TextBlot.prototype.index = function (node, offset) { + if (this.domNode === node) { + return offset; + } + return -1; + }; + TextBlot.prototype.insertAt = function (index, value, def) { + if (def == null) { + this.text = this.text.slice(0, index) + value + this.text.slice(index); + this.domNode.data = this.text; + } + else { + _super.prototype.insertAt.call(this, index, value, def); + } + }; + TextBlot.prototype.length = function () { + return this.text.length; + }; + TextBlot.prototype.optimize = function () { + _super.prototype.optimize.call(this); + this.text = this.statics.value(this.domNode); + if (this.text.length === 0) { + this.remove(); + } + else if (this.next instanceof TextBlot && this.next.prev === this) { + this.insertAt(this.length(), this.next.value()); + this.next.remove(); + } + }; + TextBlot.prototype.position = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + return [this.domNode, index]; + }; + TextBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = Registry.create(this.domNode.splitText(index)); + this.parent.insertBefore(after, this.next); + this.text = this.statics.value(this.domNode); + return after; + }; + TextBlot.prototype.update = function (mutations) { + var _this = this; + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this.domNode; + })) { + this.text = this.statics.value(this.domNode); + } + }; + TextBlot.prototype.value = function () { + return this.text; + }; + TextBlot.blotName = 'text'; + TextBlot.scope = Registry.Scope.INLINE_BLOT; + return TextBlot; + }(leaf_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = TextBlot; + + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.overload = exports.expandConfig = undefined; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + __webpack_require__(19); + + var _quillDelta = __webpack_require__(20); + + var _quillDelta2 = _interopRequireDefault(_quillDelta); + + var _editor = __webpack_require__(27); + + var _editor2 = _interopRequireDefault(_editor); + + var _emitter3 = __webpack_require__(36); + + var _emitter4 = _interopRequireDefault(_emitter3); + + var _module = __webpack_require__(43); + + var _module2 = _interopRequireDefault(_module); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _selection = __webpack_require__(44); + + var _selection2 = _interopRequireDefault(_selection); + + var _extend = __webpack_require__(30); + + var _extend2 = _interopRequireDefault(_extend); + + var _logger = __webpack_require__(38); + + var _logger2 = _interopRequireDefault(_logger); + + var _theme = __webpack_require__(45); + + var _theme2 = _interopRequireDefault(_theme); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var debug = (0, _logger2.default)('quill'); + + var Quill = function () { + _createClass(Quill, null, [{ + key: 'debug', + value: function debug(limit) { + if (limit === true) { + limit = 'log'; + } + _logger2.default.level(limit); + } + }, { + key: 'import', + value: function _import(name) { + if (this.imports[name] == null) { + debug.error('Cannot import ' + name + '. Are you sure it was registered?'); + } + return this.imports[name]; + } + }, { + key: 'register', + value: function register(path, target) { + var _this = this; + + var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (typeof path !== 'string') { + var name = path.attrName || path.blotName; + if (typeof name === 'string') { + // register(Blot | Attributor, overwrite) + this.register('formats/' + name, path, target); + } else { + Object.keys(path).forEach(function (key) { + _this.register(key, path[key], target); + }); + } + } else { + if (this.imports[path] != null && !overwrite) { + debug.warn('Overwriting ' + path + ' with', target); + } + this.imports[path] = target; + if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { + _parchment2.default.register(target); + } + } + } + }]); + + function Quill(container) { + var _this2 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Quill); + + this.options = expandConfig(container, options); + this.container = this.options.container; + if (this.container == null) { + return debug.error('Invalid Quill container', container); + } + if (this.options.debug) { + Quill.debug(this.options.debug); + } + var html = this.container.innerHTML.trim(); + this.container.classList.add('ql-container'); + this.container.innerHTML = ''; + this.root = this.addContainer('ql-editor'); + this.root.classList.add('ql-blank'); + this.emitter = new _emitter4.default(); + this.scroll = _parchment2.default.create(this.root, { + emitter: this.emitter, + whitelist: this.options.formats + }); + this.editor = new _editor2.default(this.scroll); + this.selection = new _selection2.default(this.scroll, this.emitter); + this.theme = new this.options.theme(this, this.options); + this.keyboard = this.theme.addModule('keyboard'); + this.clipboard = this.theme.addModule('clipboard'); + this.history = this.theme.addModule('history'); + this.theme.init(); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { + if (type === _emitter4.default.events.TEXT_CHANGE) { + _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { + var range = _this2.selection.lastRange; + var index = range && range.length === 0 ? range.index : undefined; + modify.call(_this2, function () { + return _this2.editor.update(null, mutations, index); + }, source); + }); + var contents = this.clipboard.convert('
    ' + html + '


    '); + this.setContents(contents); + this.history.clear(); + if (this.options.placeholder) { + this.root.setAttribute('data-placeholder', this.options.placeholder); + } + if (this.options.readOnly) { + this.disable(); + } + } + + _createClass(Quill, [{ + key: 'addContainer', + value: function addContainer(container) { + var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (typeof container === 'string') { + var className = container; + container = document.createElement('div'); + container.classList.add(className); + } + this.container.insertBefore(container, refNode); + return container; + } + }, { + key: 'blur', + value: function blur() { + this.selection.setRange(null); + } + }, { + key: 'deleteText', + value: function deleteText(index, length, source) { + var _this3 = this; + + var _overload = overload(index, length, source); + + var _overload2 = _slicedToArray(_overload, 4); + + index = _overload2[0]; + length = _overload2[1]; + source = _overload2[3]; + + return modify.call(this, function () { + return _this3.editor.deleteText(index, length); + }, source, index, -1 * length); + } + }, { + key: 'disable', + value: function disable() { + this.enable(false); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.scroll.enable(enabled); + this.container.classList.toggle('ql-disabled', !enabled); + if (!enabled) { + this.blur(); + } + } + }, { + key: 'focus', + value: function focus() { + this.selection.focus(); + this.selection.scrollIntoView(); + } + }, { + key: 'format', + value: function format(name, value) { + var _this4 = this; + + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + return modify.call(this, function () { + var range = _this4.getSelection(true); + var change = new _quillDelta2.default(); + if (range == null) { + return change; + } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); + } else if (range.length === 0) { + _this4.selection.format(name, value); + return change; + } else { + change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); + } + _this4.setSelection(range, _emitter4.default.sources.SILENT); + return change; + }, source); + } + }, { + key: 'formatLine', + value: function formatLine(index, length, name, value, source) { + var _this5 = this; + + var formats = void 0; + + var _overload3 = overload(index, length, name, value, source); + + var _overload4 = _slicedToArray(_overload3, 4); + + index = _overload4[0]; + length = _overload4[1]; + formats = _overload4[2]; + source = _overload4[3]; + + return modify.call(this, function () { + return _this5.editor.formatLine(index, length, formats); + }, source, index, 0); + } + }, { + key: 'formatText', + value: function formatText(index, length, name, value, source) { + var _this6 = this; + + var formats = void 0; + + var _overload5 = overload(index, length, name, value, source); + + var _overload6 = _slicedToArray(_overload5, 4); + + index = _overload6[0]; + length = _overload6[1]; + formats = _overload6[2]; + source = _overload6[3]; + + return modify.call(this, function () { + return _this6.editor.formatText(index, length, formats); + }, source, index, 0); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (typeof index === 'number') { + return this.selection.getBounds(index, length); + } else { + return this.selection.getBounds(index.index, index.length); + } + } + }, { + key: 'getContents', + value: function getContents() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload7 = overload(index, length); + + var _overload8 = _slicedToArray(_overload7, 2); + + index = _overload8[0]; + length = _overload8[1]; + + return this.editor.getContents(index, length); + } + }, { + key: 'getFormat', + value: function getFormat() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(); + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (typeof index === 'number') { + return this.editor.getFormat(index, length); + } else { + return this.editor.getFormat(index.index, index.length); + } + } + }, { + key: 'getLength', + value: function getLength() { + return this.scroll.length(); + } + }, { + key: 'getModule', + value: function getModule(name) { + return this.theme.modules[name]; + } + }, { + key: 'getSelection', + value: function getSelection() { + var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (focus) this.focus(); + this.update(); // Make sure we access getRange with editor in consistent state + return this.selection.getRange()[0]; + } + }, { + key: 'getText', + value: function getText() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload9 = overload(index, length); + + var _overload10 = _slicedToArray(_overload9, 2); + + index = _overload10[0]; + length = _overload10[1]; + + return this.editor.getText(index, length); + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return this.selection.hasFocus(); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + var _this7 = this; + + var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; + + return modify.call(this, function () { + return _this7.editor.insertEmbed(index, embed, value); + }, source, index); + } + }, { + key: 'insertText', + value: function insertText(index, text, name, value, source) { + var _this8 = this; + + var formats = void 0; + + var _overload11 = overload(index, 0, name, value, source); + + var _overload12 = _slicedToArray(_overload11, 4); + + index = _overload12[0]; + formats = _overload12[2]; + source = _overload12[3]; + + return modify.call(this, function () { + return _this8.editor.insertText(index, text, formats); + }, source, index, text.length); + } + }, { + key: 'isEnabled', + value: function isEnabled() { + return !this.container.classList.contains('ql-disabled'); + } + }, { + key: 'off', + value: function off() { + return this.emitter.off.apply(this.emitter, arguments); + } + }, { + key: 'on', + value: function on() { + return this.emitter.on.apply(this.emitter, arguments); + } + }, { + key: 'once', + value: function once() { + return this.emitter.once.apply(this.emitter, arguments); + } + }, { + key: 'pasteHTML', + value: function pasteHTML(index, html, source) { + this.clipboard.dangerouslyPasteHTML(index, html, source); + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length, source) { + var _this9 = this; + + var _overload13 = overload(index, length, source); + + var _overload14 = _slicedToArray(_overload13, 4); + + index = _overload14[0]; + length = _overload14[1]; + source = _overload14[3]; + + return modify.call(this, function () { + return _this9.editor.removeFormat(index, length); + }, source, index); + } + }, { + key: 'setContents', + value: function setContents(delta) { + var _this10 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + var length = _this10.getLength(); + var deleted = _this10.editor.deleteText(0, length); + var applied = _this10.editor.applyDelta(delta); + var lastOp = applied.ops[applied.ops.length - 1]; + if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { + _this10.editor.deleteText(_this10.getLength() - 1, 1); + applied.delete(1); + } + var ret = deleted.compose(applied); + return ret; + }, source); + } + }, { + key: 'setSelection', + value: function setSelection(index, length, source) { + if (index == null) { + this.selection.setRange(null, length || Quill.sources.API); + } else { + var _overload15 = overload(index, length, source); + + var _overload16 = _slicedToArray(_overload15, 4); + + index = _overload16[0]; + length = _overload16[1]; + source = _overload16[3]; + + this.selection.setRange(new _selection.Range(index, length), source); + } + this.selection.scrollIntoView(); + } + }, { + key: 'setText', + value: function setText(text) { + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + var delta = new _quillDelta2.default().insert(text); + return this.setContents(delta, source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes + this.selection.update(source); + return change; + } + }, { + key: 'updateContents', + value: function updateContents(delta) { + var _this11 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + return _this11.editor.applyDelta(delta, source); + }, source, true); + } + }]); + + return Quill; + }(); + + Quill.DEFAULTS = { + bounds: null, + formats: null, + modules: {}, + placeholder: '', + readOnly: false, + strict: true, + theme: 'default' + }; + Quill.events = _emitter4.default.events; + Quill.sources = _emitter4.default.sources; + // eslint-disable-next-line no-undef + Quill.version = false ? 'dev' : ("1.1.5"); + + Quill.imports = { + 'delta': _quillDelta2.default, + 'parchment': _parchment2.default, + 'core/module': _module2.default, + 'core/theme': _theme2.default + }; + + function expandConfig(container, userConfig) { + userConfig = (0, _extend2.default)(true, { + container: container, + modules: { + clipboard: true, + keyboard: true, + history: true + } + }, userConfig); + if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { + userConfig.theme = _theme2.default; + } else { + userConfig.theme = Quill.import('themes/' + userConfig.theme); + if (userConfig.theme == null) { + throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); + } + } + var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); + [themeConfig, userConfig].forEach(function (config) { + config.modules = config.modules || {}; + Object.keys(config.modules).forEach(function (module) { + if (config.modules[module] === true) { + config.modules[module] = {}; + } + }); + }); + var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); + var moduleConfig = moduleNames.reduce(function (config, name) { + var moduleClass = Quill.import('modules/' + name); + if (moduleClass == null) { + debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); + } else { + config[name] = moduleClass.DEFAULTS || {}; + } + return config; + }, {}); + // Special case toolbar shorthand + if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { + userConfig.modules.toolbar = { + container: userConfig.modules.toolbar + }; + } + userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); + ['bounds', 'container'].forEach(function (key) { + if (typeof userConfig[key] === 'string') { + userConfig[key] = document.querySelector(userConfig[key]); + } + }); + userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { + if (userConfig.modules[name]) { + config[name] = userConfig.modules[name]; + } + return config; + }, {}); + return userConfig; + } + + // Handle selection preservation and TEXT_CHANGE emission + // common to modification APIs + function modify(modifier, source, index, shift) { + if (!this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { + return new _quillDelta2.default(); + } + var range = index == null ? null : this.getSelection(); + var oldDelta = this.editor.delta; + var change = modifier(); + if (range != null) { + if (index === true) index = range.index; + if (shift == null) { + range = shiftRange(range, change, source); + } else if (shift !== 0) { + range = shiftRange(range, index, shift, source); + } + this.setSelection(range, _emitter4.default.sources.SILENT); + } + if (change.length() > 0) { + var _emitter; + + var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + return change; + } + + function overload(index, length, name, value, source) { + var formats = {}; + if (typeof index.index === 'number' && typeof index.length === 'number') { + // Allow for throwaway end (used by insertText/insertEmbed) + if (typeof length !== 'number') { + source = value, value = name, name = length, length = index.length, index = index.index; + } else { + length = index.length, index = index.index; + } + } else if (typeof length !== 'number') { + source = value, value = name, name = length, length = 0; + } + // Handle format being object, two format name/value strings or excluded + if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { + formats = name; + source = value; + } else if (typeof name === 'string') { + if (value != null) { + formats[name] = value; + } else { + source = name; + } + } + // Handle optional source + source = source || _emitter4.default.sources.API; + return [index, length, formats, source]; + } + + function shiftRange(range, index, length, source) { + if (range == null) return null; + var start = void 0, + end = void 0; + if (index instanceof _quillDelta2.default) { + var _map = [range.index, range.index + range.length].map(function (pos) { + return index.transformPosition(pos, source === _emitter4.default.sources.USER); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + } else { + var _map3 = [range.index, range.index + range.length].map(function (pos) { + if (pos < index || pos === index && source !== _emitter4.default.sources.USER) return pos; + if (length >= 0) { + return pos + length; + } else { + return Math.max(index, pos + length); + } + }); + + var _map4 = _slicedToArray(_map3, 2); + + start = _map4[0]; + end = _map4[1]; + } + return new _selection.Range(start, end - start); + } + + exports.expandConfig = expandConfig; + exports.overload = overload; + exports.default = Quill; + +/***/ }, +/* 19 */ +/***/ function(module, exports) { + + 'use strict'; + + var elem = document.createElement('div'); + elem.classList.toggle('test-class', false); + if (elem.classList.contains('test-class')) { + (function () { + var _toggle = DOMTokenList.prototype.toggle; + DOMTokenList.prototype.toggle = function (token, force) { + if (arguments.length > 1 && !this.contains(token) === !force) { + return force; + } else { + return _toggle.call(this, token); + } + }; + })(); + } + + if (!String.prototype.startsWith) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; + } + + if (!String.prototype.endsWith) { + String.prototype.endsWith = function (searchString, position) { + var subjectString = this.toString(); + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length; + } + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; + } + + if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, "find", { + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } + } + return undefined; + } + }); + } + + // Disable resizing in Firefox + document.addEventListener("DOMContentLoaded", function () { + document.execCommand("enableObjectResizing", false, false); + }); + +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { + + var diff = __webpack_require__(21); + var equal = __webpack_require__(22); + var extend = __webpack_require__(25); + var op = __webpack_require__(26); + + + var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() + + + var Delta = function (ops) { + // Assume we are given a well formed ops + if (Array.isArray(ops)) { + this.ops = ops; + } else if (ops != null && Array.isArray(ops.ops)) { + this.ops = ops.ops; + } else { + this.ops = []; + } + }; + + + Delta.prototype.insert = function (text, attributes) { + var newOp = {}; + if (text.length === 0) return this; + newOp.insert = text; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); + }; + + Delta.prototype['delete'] = function (length) { + if (length <= 0) return this; + return this.push({ 'delete': length }); + }; + + Delta.prototype.retain = function (length, attributes) { + if (length <= 0) return this; + var newOp = { retain: length }; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); + }; + + Delta.prototype.push = function (newOp) { + var index = this.ops.length; + var lastOp = this.ops[index - 1]; + newOp = extend(true, {}, newOp); + if (typeof lastOp === 'object') { + if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { + this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; + return this; + } + // Since it does not matter if we insert before or after deleting at the same index, + // always prefer to insert first + if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { + index -= 1; + lastOp = this.ops[index - 1]; + if (typeof lastOp !== 'object') { + this.ops.unshift(newOp); + return this; + } + } + if (equal(newOp.attributes, lastOp.attributes)) { + if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { + this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { + this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } + } + } + if (index === this.ops.length) { + this.ops.push(newOp); + } else { + this.ops.splice(index, 0, newOp); + } + return this; + }; + + Delta.prototype.filter = function (predicate) { + return this.ops.filter(predicate); + }; + + Delta.prototype.forEach = function (predicate) { + this.ops.forEach(predicate); + }; + + Delta.prototype.map = function (predicate) { + return this.ops.map(predicate); + }; + + Delta.prototype.partition = function (predicate) { + var passed = [], failed = []; + this.forEach(function(op) { + var target = predicate(op) ? passed : failed; + target.push(op); + }); + return [passed, failed]; + }; + + Delta.prototype.reduce = function (predicate, initial) { + return this.ops.reduce(predicate, initial); + }; + + Delta.prototype.chop = function () { + var lastOp = this.ops[this.ops.length - 1]; + if (lastOp && lastOp.retain && !lastOp.attributes) { + this.ops.pop(); + } + return this; + }; + + Delta.prototype.length = function () { + return this.reduce(function (length, elem) { + return length + op.length(elem); + }, 0); + }; + + Delta.prototype.slice = function (start, end) { + start = start || 0; + if (typeof end !== 'number') end = Infinity; + var ops = []; + var iter = op.iterator(this.ops); + var index = 0; + while (index < end && iter.hasNext()) { + var nextOp; + if (index < start) { + nextOp = iter.next(start - index); + } else { + nextOp = iter.next(end - index); + ops.push(nextOp); + } + index += op.length(nextOp); + } + return new Delta(ops); + }; + + + Delta.prototype.compose = function (other) { + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else if (thisIter.peekType() === 'delete') { + delta.push(thisIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (typeof otherOp.retain === 'number') { + var newOp = {}; + if (typeof thisOp.retain === 'number') { + newOp.retain = length; + } else { + newOp.insert = thisOp.insert; + } + // Preserve null when composing with a retain, otherwise remove it for inserts + var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); + if (attributes) newOp.attributes = attributes; + delta.push(newOp); + // Other op should be delete, we could be an insert or retain + // Insert + delete cancels out + } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { + delta.push(otherOp); + } + } + } + return delta.chop(); + }; + + Delta.prototype.concat = function (other) { + var delta = new Delta(this.ops.slice()); + if (other.ops.length > 0) { + delta.push(other.ops[0]); + delta.ops = delta.ops.concat(other.ops.slice(1)); + } + return delta; + }; + + Delta.prototype.diff = function (other, index) { + if (this.ops === other.ops) { + return new Delta(); + } + var strings = [this, other].map(function (delta) { + return delta.map(function (op) { + if (op.insert != null) { + return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; + } + var prep = (delta === other) ? 'on' : 'with'; + throw new Error('diff() called ' + prep + ' non-document'); + }).join(''); + }); + var delta = new Delta(); + var diffResult = diff(strings[0], strings[1], index); + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + diffResult.forEach(function (component) { + var length = component[1].length; + while (length > 0) { + var opLength = 0; + switch (component[0]) { + case diff.INSERT: + opLength = Math.min(otherIter.peekLength(), length); + delta.push(otherIter.next(opLength)); + break; + case diff.DELETE: + opLength = Math.min(length, thisIter.peekLength()); + thisIter.next(opLength); + delta['delete'](opLength); + break; + case diff.EQUAL: + opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); + var thisOp = thisIter.next(opLength); + var otherOp = otherIter.next(opLength); + if (equal(thisOp.insert, otherOp.insert)) { + delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); + } else { + delta.push(otherOp)['delete'](opLength); + } + break; + } + length -= opLength; + } + }); + return delta.chop(); + }; + + Delta.prototype.eachLine = function (predicate, newline) { + newline = newline || '\n'; + var iter = op.iterator(this.ops); + var line = new Delta(); + while (iter.hasNext()) { + if (iter.peekType() !== 'insert') return; + var thisOp = iter.peek(); + var start = op.length(thisOp) - iter.peekLength(); + var 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 { + predicate(line, iter.next(1).attributes || {}); + line = new Delta(); + } + } + if (line.length() > 0) { + predicate(line, {}); + } + }; + + Delta.prototype.transform = function (other, priority) { + priority = !!priority; + if (typeof other === 'number') { + return this.transformPosition(other, priority); + } + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { + delta.retain(op.length(thisIter.next())); + } else if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (thisOp['delete']) { + // Our delete either makes their delete redundant or removes their retain + continue; + } else if (otherOp['delete']) { + delta.push(otherOp); + } else { + // We retain either their retain or insert + delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); + } + } + } + return delta.chop(); + }; + + Delta.prototype.transformPosition = function (index, priority) { + priority = !!priority; + var thisIter = op.iterator(this.ops); + var offset = 0; + while (thisIter.hasNext() && offset <= index) { + var length = thisIter.peekLength(); + var nextType = thisIter.peekType(); + thisIter.next(); + if (nextType === 'delete') { + index -= Math.min(length, index - offset); + continue; + } else if (nextType === 'insert' && (offset < index || !priority)) { + index += length; + } + offset += length; + } + return index; + }; + + + module.exports = Delta; + + +/***/ }, +/* 21 */ +/***/ function(module, exports) { + + /** + * This library modifies the diff-patch-match library by Neil Fraser + * by removing the patch and match functionality and certain advanced + * options in the diff function. The original license is as follows: + * + * === + * + * Diff Match and Patch + * + * Copyright 2006 Google Inc. + * http://code.google.com/p/google-diff-match-patch/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + /** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ + var DIFF_DELETE = -1; + var DIFF_INSERT = 1; + var DIFF_EQUAL = 0; + + + /** + * Find the differences between two texts. Simplifies the problem by stripping + * any common prefix or suffix off the texts before diffing. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {Int} cursor_pos Expected edit position in text1 (optional) + * @return {Array} Array of diff tuples. + */ + function diff_main(text1, text2, cursor_pos) { + // Check for equality (speedup). + if (text1 == text2) { + if (text1) { + return [[DIFF_EQUAL, text1]]; + } + return []; + } + + // Check cursor_pos within bounds + if (cursor_pos < 0 || text1.length < cursor_pos) { + cursor_pos = null; + } + + // Trim off common prefix (speedup). + var commonlength = diff_commonPrefix(text1, text2); + var commonprefix = text1.substring(0, commonlength); + text1 = text1.substring(commonlength); + text2 = text2.substring(commonlength); + + // Trim off common suffix (speedup). + 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); + + // Compute the diff on the middle block. + var diffs = diff_compute_(text1, text2); + + // Restore the prefix and suffix. + if (commonprefix) { + diffs.unshift([DIFF_EQUAL, commonprefix]); + } + if (commonsuffix) { + diffs.push([DIFF_EQUAL, commonsuffix]); + } + diff_cleanupMerge(diffs); + if (cursor_pos != null) { + diffs = fix_cursor(diffs, cursor_pos); + } + return diffs; + }; + + + /** + * Find the differences between two texts. Assumes that the texts do not + * have any common prefix or suffix. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + */ + function diff_compute_(text1, text2) { + var diffs; + + if (!text1) { + // Just add some text (speedup). + return [[DIFF_INSERT, text2]]; + } + + if (!text2) { + // Just delete some text (speedup). + return [[DIFF_DELETE, text1]]; + } + + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + var i = longtext.indexOf(shorttext); + if (i != -1) { + // Shorter text is inside the longer text (speedup). + diffs = [[DIFF_INSERT, longtext.substring(0, i)], + [DIFF_EQUAL, shorttext], + [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; + // Swap insertions for deletions if diff is reversed. + if (text1.length > text2.length) { + diffs[0][0] = diffs[2][0] = DIFF_DELETE; + } + return diffs; + } + + if (shorttext.length == 1) { + // Single character string. + // After the previous speedup, the character can't be an equality. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + } + + // Check to see if the problem can be split in two. + var hm = diff_halfMatch_(text1, text2); + if (hm) { + // A half-match was found, sort out the return data. + var text1_a = hm[0]; + var text1_b = hm[1]; + var text2_a = hm[2]; + var text2_b = hm[3]; + var mid_common = hm[4]; + // Send both pairs off for separate processing. + var diffs_a = diff_main(text1_a, text2_a); + var diffs_b = diff_main(text1_b, text2_b); + // Merge the results. + return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); + } + + return diff_bisect_(text1, text2); + }; + + + /** + * Find the 'middle snake' of a diff, split the problem in two + * and return the recursively constructed diff. + * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + * @private + */ + function diff_bisect_(text1, text2) { + // Cache the text lengths to prevent multiple calls. + var text1_length = text1.length; + var text2_length = text2.length; + var max_d = Math.ceil((text1_length + text2_length) / 2); + var v_offset = max_d; + var v_length = 2 * max_d; + var v1 = new Array(v_length); + var v2 = new Array(v_length); + // Setting all elements to -1 is faster in Chrome & Firefox than mixing + // integers and undefined. + for (var x = 0; x < v_length; x++) { + v1[x] = -1; + v2[x] = -1; + } + v1[v_offset + 1] = 0; + v2[v_offset + 1] = 0; + var delta = text1_length - text2_length; + // If the total number of characters is odd, then the front path will collide + // with the reverse path. + var front = (delta % 2 != 0); + // Offsets for start and end of k loop. + // Prevents mapping of space beyond the grid. + var k1start = 0; + var k1end = 0; + var k2start = 0; + var k2end = 0; + for (var d = 0; d < max_d; d++) { + // Walk the front path one step. + for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { + var k1_offset = v_offset + k1; + var x1; + if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { + x1 = v1[k1_offset + 1]; + } else { + x1 = v1[k1_offset - 1] + 1; + } + var y1 = x1 - k1; + while (x1 < text1_length && y1 < text2_length && + text1.charAt(x1) == text2.charAt(y1)) { + x1++; + y1++; + } + v1[k1_offset] = x1; + if (x1 > text1_length) { + // Ran off the right of the graph. + k1end += 2; + } else if (y1 > text2_length) { + // Ran off the bottom of the graph. + k1start += 2; + } else if (front) { + var k2_offset = v_offset + delta - k1; + if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { + // Mirror x2 onto top-left coordinate system. + var x2 = text1_length - v2[k2_offset]; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + + // Walk the reverse path one step. + for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { + var k2_offset = v_offset + k2; + var x2; + if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { + x2 = v2[k2_offset + 1]; + } else { + x2 = v2[k2_offset - 1] + 1; + } + var y2 = x2 - k2; + while (x2 < text1_length && y2 < text2_length && + text1.charAt(text1_length - x2 - 1) == + text2.charAt(text2_length - y2 - 1)) { + x2++; + y2++; + } + v2[k2_offset] = x2; + if (x2 > text1_length) { + // Ran off the left of the graph. + k2end += 2; + } else if (y2 > text2_length) { + // Ran off the top of the graph. + 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]; + var y1 = v_offset + x1 - k1_offset; + // Mirror x2 onto top-left coordinate system. + x2 = text1_length - x2; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + } + // Diff took too long and hit the deadline or + // number of diffs equals number of characters, no commonality at all. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + }; + + + /** + * Given the location of the 'middle snake', split the diff in two parts + * and recurse. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} x Index of split point in text1. + * @param {number} y Index of split point in text2. + * @return {Array} Array of diff tuples. + */ + function diff_bisectSplit_(text1, text2, x, y) { + var text1a = text1.substring(0, x); + var text2a = text2.substring(0, y); + var text1b = text1.substring(x); + var text2b = text2.substring(y); + + // Compute both diffs serially. + var diffs = diff_main(text1a, text2a); + var diffsb = diff_main(text1b, text2b); + + return diffs.concat(diffsb); + }; + + + /** + * Determine the common prefix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the start of each + * string. + */ + function diff_commonPrefix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerstart = 0; + while (pointermin < pointermid) { + if (text1.substring(pointerstart, pointermid) == + text2.substring(pointerstart, pointermid)) { + pointermin = pointermid; + pointerstart = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; + }; + + + /** + * Determine the common suffix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of each string. + */ + function diff_commonSuffix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || + text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerend = 0; + while (pointermin < pointermid) { + if (text1.substring(text1.length - pointermid, text1.length - pointerend) == + text2.substring(text2.length - pointermid, text2.length - pointerend)) { + pointermin = pointermid; + pointerend = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; + }; + + + /** + * Do the two texts share a substring which is at least half the length of the + * longer text? + * This speedup can produce non-minimal diffs. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {Array.} Five element Array, containing the prefix of + * text1, the suffix of text1, the prefix of text2, the suffix of + * text2 and the common middle. Or null if there was no match. + */ + function diff_halfMatch_(text1, text2) { + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { + return null; // Pointless. + } + + /** + * Does a substring of shorttext exist within longtext such that the substring + * is at least half the length of longtext? + * Closure, but does not reference any external variables. + * @param {string} longtext Longer string. + * @param {string} shorttext Shorter string. + * @param {number} i Start index of quarter length substring within longtext. + * @return {Array.} Five element Array, containing the prefix of + * longtext, the suffix of longtext, the prefix of shorttext, the suffix + * of shorttext and the common middle. Or null if there was no match. + * @private + */ + function diff_halfMatchI_(longtext, shorttext, i) { + // Start with a 1/4 length substring at position i as a seed. + var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); + var j = -1; + var best_common = ''; + var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; + while ((j = shorttext.indexOf(seed, j + 1)) != -1) { + var prefixLength = diff_commonPrefix(longtext.substring(i), + shorttext.substring(j)); + var suffixLength = diff_commonSuffix(longtext.substring(0, i), + shorttext.substring(0, j)); + if (best_common.length < suffixLength + prefixLength) { + best_common = shorttext.substring(j - suffixLength, j) + + shorttext.substring(j, j + prefixLength); + best_longtext_a = longtext.substring(0, i - suffixLength); + best_longtext_b = longtext.substring(i + prefixLength); + best_shorttext_a = shorttext.substring(0, j - suffixLength); + best_shorttext_b = shorttext.substring(j + prefixLength); + } + } + if (best_common.length * 2 >= longtext.length) { + return [best_longtext_a, best_longtext_b, + best_shorttext_a, best_shorttext_b, best_common]; + } else { + return null; + } + } + + // First check if the second quarter is the seed for a half-match. + var hm1 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 4)); + // Check again based on the third quarter. + var hm2 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 2)); + var hm; + if (!hm1 && !hm2) { + return null; + } else if (!hm2) { + hm = hm1; + } else if (!hm1) { + hm = hm2; + } else { + // Both matched. Select the longest. + hm = hm1[4].length > hm2[4].length ? hm1 : hm2; + } + + // A half-match was found, sort out the return data. + var text1_a, text1_b, text2_a, text2_b; + if (text1.length > text2.length) { + text1_a = hm[0]; + text1_b = hm[1]; + text2_a = hm[2]; + text2_b = hm[3]; + } else { + 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]; + }; + + + /** + * Reorder and merge like edit sections. Merge equalities. + * Any edit section can move as long as it doesn't cross an equality. + * @param {Array} diffs Array of diff tuples. + */ + function diff_cleanupMerge(diffs) { + diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. + var pointer = 0; + var count_delete = 0; + var count_insert = 0; + var text_delete = ''; + var text_insert = ''; + var commonlength; + while (pointer < diffs.length) { + 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: + // Upon reaching an equality, check for prior redundancies. + if (count_delete + count_insert > 1) { + if (count_delete !== 0 && count_insert !== 0) { + // Factor out any common prefixies. + commonlength = diff_commonPrefix(text_insert, text_delete); + if (commonlength !== 0) { + if ((pointer - count_delete - count_insert) > 0 && + diffs[pointer - count_delete - count_insert - 1][0] == + DIFF_EQUAL) { + diffs[pointer - count_delete - count_insert - 1][1] += + text_insert.substring(0, commonlength); + } else { + diffs.splice(0, 0, [DIFF_EQUAL, + text_insert.substring(0, commonlength)]); + pointer++; + } + text_insert = text_insert.substring(commonlength); + text_delete = text_delete.substring(commonlength); + } + // Factor out any common suffixies. + commonlength = diff_commonSuffix(text_insert, text_delete); + if (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); + } + } + // Delete the offending records and add the merged ones. + if (count_delete === 0) { + diffs.splice(pointer - count_insert, + count_delete + count_insert, [DIFF_INSERT, text_insert]); + } else if (count_insert === 0) { + diffs.splice(pointer - count_delete, + count_delete + count_insert, [DIFF_DELETE, text_delete]); + } else { + diffs.splice(pointer - count_delete - count_insert, + count_delete + count_insert, [DIFF_DELETE, text_delete], + [DIFF_INSERT, text_insert]); + } + pointer = pointer - count_delete - count_insert + + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; + } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { + // Merge this equality with the previous one. + diffs[pointer - 1][1] += diffs[pointer][1]; + diffs.splice(pointer, 1); + } else { + pointer++; + } + count_insert = 0; + count_delete = 0; + text_delete = ''; + text_insert = ''; + break; + } + } + if (diffs[diffs.length - 1][1] === '') { + diffs.pop(); // Remove the dummy entry at the end. + } + + // Second pass: look for single edits surrounded on both sides by equalities + // which can be shifted sideways to eliminate an equality. + // e.g: ABAC -> ABAC + var changes = false; + pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if (diffs[pointer - 1][0] == DIFF_EQUAL && + diffs[pointer + 1][0] == DIFF_EQUAL) { + // This is a single edit surrounded by equalities. + if (diffs[pointer][1].substring(diffs[pointer][1].length - + diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { + // Shift the edit over the previous equality. + 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 = true; + } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == + diffs[pointer + 1][1]) { + // Shift the edit over the next equality. + 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 = true; + } + } + pointer++; + } + // If shifts were made, the diff needs reordering and another shift sweep. + if (changes) { + diff_cleanupMerge(diffs); + } + }; + + + var diff = diff_main; + diff.INSERT = DIFF_INSERT; + diff.DELETE = DIFF_DELETE; + diff.EQUAL = DIFF_EQUAL; + + module.exports = diff; + + /* + * Modify a diff such that the cursor position points to the start of a change: + * E.g. + * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) + * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] + * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) + * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} A tuple [cursor location in the modified diff, modified diff] + */ + function cursor_normalize_diff (diffs, cursor_pos) { + if (cursor_pos === 0) { + return [DIFF_EQUAL, diffs]; + } + for (var current_pos = 0, i = 0; i < diffs.length; i++) { + var d = diffs[i]; + if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { + var next_pos = current_pos + d[1].length; + if (cursor_pos === next_pos) { + return [i + 1, diffs]; + } else if (cursor_pos < next_pos) { + // copy to prevent side effects + diffs = diffs.slice(); + // split d into two diff changes + var split_pos = cursor_pos - current_pos; + var d_left = [d[0], d[1].slice(0, split_pos)]; + var d_right = [d[0], d[1].slice(split_pos)]; + diffs.splice(i, 1, d_left, d_right); + return [i + 1, diffs]; + } else { + current_pos = next_pos; + } + } + } + throw new Error('cursor_pos is out of bounds!') + } + + /* + * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). + * + * Case 1) + * Check if a naive shift is possible: + * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) + * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result + * Case 2) + * Check if the following shifts are possible: + * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] + * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] + * ^ ^ + * d d_next + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} Array of diff tuples + */ + function fix_cursor (diffs, cursor_pos) { + var norm = cursor_normalize_diff(diffs, cursor_pos); + var ndiffs = norm[1]; + var cursor_pointer = norm[0]; + var d = ndiffs[cursor_pointer]; + var d_next = ndiffs[cursor_pointer + 1]; + + if (d == null) { + // Text was deleted from end of original string, + // cursor is now out of bounds in new string + return diffs; + } else if (d[0] !== DIFF_EQUAL) { + // A modification happened at the cursor location. + // This is the expected outcome, so we can return the original diff. + return diffs; + } else { + if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { + // Case 1) + // It is possible to perform a naive shift + ndiffs.splice(cursor_pointer, 2, d_next, d) + return merge_tuples(ndiffs, cursor_pointer, 2) + } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { + // Case 2) + // d[1] is a prefix of d_next[1] + // We can assume that d_next[0] !== 0, since d[0] === 0 + // Shift edit locations.. + ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); + var suffix = d_next[1].slice(d[1].length); + if (suffix.length > 0) { + ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); + } + return merge_tuples(ndiffs, cursor_pointer, 3) + } else { + // Not possible to perform any modification + return diffs; + } + } + + } + + /* + * Try to merge tuples with their neigbors in a given range. + * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] + * + * @param {Array} diffs Array of diff tuples. + * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). + * @param {Int} length Number of consecutive elements to check. + * @return {Array} Array of merged diff tuples. + */ + function merge_tuples (diffs, start, length) { + // Check from (start-1) to (start+length). + for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { + if (i + 1 < diffs.length) { + var left_d = diffs[i]; + var right_d = diffs[i+1]; + if (left_d[0] === right_d[1]) { + diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); + } + } + } + return diffs; + } + + +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { + + var pSlice = Array.prototype.slice; + var objectKeys = __webpack_require__(23); + var isArguments = __webpack_require__(24); + + var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } + } + + function isUndefinedOrNull(value) { + return value === null || value === undefined; + } + + function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; + } + + function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; + } + + +/***/ }, +/* 23 */ +/***/ function(module, exports) { + + exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + + exports.shim = shim; + function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; + } + + +/***/ }, +/* 24 */ +/***/ function(module, exports) { + + var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) + })() == '[object Arguments]'; + + exports = module.exports = supportsArgumentsClass ? supported : unsupported; + + exports.supported = supported; + function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; + }; + + exports.unsupported = unsupported; + function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; + }; + + +/***/ }, +/* 25 */ +/***/ function(module, exports) { + + 'use strict'; + + var hasOwn = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + + var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; + }; + + var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) {/**/} + + return typeof key === 'undefined' || hasOwn.call(obj, key); + }; + + module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0], + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; + }; + + + +/***/ }, +/* 26 */ +/***/ function(module, exports, __webpack_require__) { + + var equal = __webpack_require__(22); + var extend = __webpack_require__(25); + + + var lib = { + attributes: { + compose: function (a, b, keepNull) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = extend(true, {}, b); + if (!keepNull) { + attributes = Object.keys(attributes).reduce(function (copy, key) { + if (attributes[key] != null) { + copy[key] = attributes[key]; + } + return copy; + }, {}); + } + for (var key in a) { + if (a[key] !== undefined && b[key] === undefined) { + attributes[key] = a[key]; + } + } + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + diff: function(a, b) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { + if (!equal(a[key], b[key])) { + attributes[key] = b[key] === undefined ? null : b[key]; + } + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + transform: function (a, b, priority) { + if (typeof a !== 'object') return b; + if (typeof b !== 'object') return undefined; + if (!priority) return b; // b simply overwrites us without priority + var attributes = Object.keys(b).reduce(function (attributes, key) { + if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + } + }, + + iterator: function (ops) { + return new Iterator(ops); + }, + + length: function (op) { + if (typeof op['delete'] === 'number') { + return op['delete']; + } else if (typeof op.retain === 'number') { + return op.retain; + } else { + return typeof op.insert === 'string' ? op.insert.length : 1; + } + } + }; + + + function Iterator(ops) { + this.ops = ops; + this.index = 0; + this.offset = 0; + }; + + Iterator.prototype.hasNext = function () { + return this.peekLength() < Infinity; + }; + + Iterator.prototype.next = function (length) { + if (!length) length = Infinity; + var nextOp = this.ops[this.index]; + if (nextOp) { + var offset = this.offset; + var opLength = lib.length(nextOp) + if (length >= opLength - offset) { + length = opLength - offset; + this.index += 1; + this.offset = 0; + } else { + this.offset += length; + } + if (typeof nextOp['delete'] === 'number') { + return { 'delete': length }; + } else { + var retOp = {}; + if (nextOp.attributes) { + retOp.attributes = nextOp.attributes; + } + if (typeof nextOp.retain === 'number') { + retOp.retain = length; + } else if (typeof nextOp.insert === 'string') { + retOp.insert = nextOp.insert.substr(offset, length); + } else { + // offset should === 0, length should === 1 + retOp.insert = nextOp.insert; + } + return retOp; + } + } else { + return { retain: Infinity }; + } + }; + + Iterator.prototype.peek = function () { + return this.ops[this.index]; + }; + + Iterator.prototype.peekLength = function () { + if (this.ops[this.index]) { + // Should never return 0 if our index is being managed correctly + return lib.length(this.ops[this.index]) - this.offset; + } else { + return Infinity; + } + }; + + Iterator.prototype.peekType = function () { + if (this.ops[this.index]) { + if (typeof this.ops[this.index]['delete'] === 'number') { + return 'delete'; + } else if (typeof this.ops[this.index].retain === 'number') { + return 'retain'; + } else { + return 'insert'; + } + } + return 'retain'; + }; + + + module.exports = lib; + + +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _quillDelta = __webpack_require__(20); + + var _quillDelta2 = _interopRequireDefault(_quillDelta); + + var _op = __webpack_require__(26); + + var _op2 = _interopRequireDefault(_op); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _code = __webpack_require__(28); + + var _code2 = _interopRequireDefault(_code); + + var _cursor = __webpack_require__(35); + + var _cursor2 = _interopRequireDefault(_cursor); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + var _clone = __webpack_require__(39); + + var _clone2 = _interopRequireDefault(_clone); + + var _deepEqual = __webpack_require__(40); + + var _deepEqual2 = _interopRequireDefault(_deepEqual); + + var _extend = __webpack_require__(30); + + var _extend2 = _interopRequireDefault(_extend); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var Editor = function () { + function Editor(scroll) { + _classCallCheck(this, Editor); + + this.scroll = scroll; + this.delta = this.getDelta(); + } + + _createClass(Editor, [{ + key: 'applyDelta', + value: function applyDelta(delta) { + var _this = this; + + var consumeNextNewline = false; + this.scroll.update(); + var scrollLength = this.scroll.length(); + this.scroll.batch = true; + delta = normalizeDelta(delta); + delta.reduce(function (index, op) { + var length = op.retain || op.delete || op.insert.length || 1; + var attributes = op.attributes || {}; + if (op.insert != null) { + if (typeof op.insert === 'string') { + var text = op.insert; + if (text.endsWith('\n') && consumeNextNewline) { + consumeNextNewline = false; + text = text.slice(0, -1); + } + if (index >= scrollLength && !text.endsWith('\n')) { + consumeNextNewline = true; + } + _this.scroll.insertAt(index, text); + + var _scroll$line = _this.scroll.line(index), + _scroll$line2 = _slicedToArray(_scroll$line, 2), + line = _scroll$line2[0], + offset = _scroll$line2[1]; + + var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); + if (line instanceof _block2.default) { + var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), + _line$descendant2 = _slicedToArray(_line$descendant, 1), + leaf = _line$descendant2[0]; + + formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); + } + attributes = _op2.default.attributes.diff(formats, attributes) || {}; + } else if (_typeof(op.insert) === 'object') { + var key = Object.keys(op.insert)[0]; // There should only be one key + if (key == null) return index; + _this.scroll.insertAt(index, key, op.insert[key]); + } + scrollLength += length; + } + Object.keys(attributes).forEach(function (name) { + _this.scroll.formatAt(index, length, name, attributes[name]); + }); + return index + length; + }, 0); + delta.reduce(function (index, op) { + if (typeof op.delete === 'number') { + _this.scroll.deleteAt(index, op.delete); + return index; + } + return index + (op.retain || op.insert.length || 1); + }, 0); + this.scroll.batch = false; + this.scroll.optimize(); + return this.update(delta); + } + }, { + key: 'deleteText', + value: function deleteText(index, length) { + this.scroll.deleteAt(index, length); + return this.update(new _quillDelta2.default().retain(index).delete(length)); + } + }, { + key: 'formatLine', + value: function formatLine(index, length) { + var _this2 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + this.scroll.update(); + Object.keys(formats).forEach(function (format) { + var lines = _this2.scroll.lines(index, Math.max(length, 1)); + var lengthRemaining = length; + lines.forEach(function (line) { + var lineLength = line.length(); + if (!(line instanceof _code2.default)) { + line.format(format, formats[format]); + } else { + var codeIndex = index - line.offset(_this2.scroll); + var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; + line.formatAt(codeIndex, codeLength, format, formats[format]); + } + lengthRemaining -= lineLength; + }); + }); + this.scroll.optimize(); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'formatText', + value: function formatText(index, length) { + var _this3 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + Object.keys(formats).forEach(function (format) { + _this3.scroll.formatAt(index, length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'getContents', + value: function getContents(index, length) { + return this.delta.slice(index, index + length); + } + }, { + key: 'getDelta', + value: function getDelta() { + return this.scroll.lines().reduce(function (delta, line) { + return delta.concat(line.delta()); + }, new _quillDelta2.default()); + } + }, { + key: 'getFormat', + value: function getFormat(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var lines = [], + leaves = []; + if (length === 0) { + this.scroll.path(index).forEach(function (path) { + var _path = _slicedToArray(path, 1), + blot = _path[0]; + + if (blot instanceof _block2.default) { + lines.push(blot); + } else if (blot instanceof _parchment2.default.Leaf) { + leaves.push(blot); + } + }); + } else { + lines = this.scroll.lines(index, length); + leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); + } + var formatsArr = [lines, leaves].map(function (blots) { + if (blots.length === 0) return {}; + var formats = (0, _block.bubbleFormats)(blots.shift()); + while (Object.keys(formats).length > 0) { + var blot = blots.shift(); + if (blot == null) return formats; + formats = combineFormats((0, _block.bubbleFormats)(blot), formats); + } + return formats; + }); + return _extend2.default.apply(_extend2.default, formatsArr); + } + }, { + key: 'getText', + value: function getText(index, length) { + return this.getContents(index, length).filter(function (op) { + return typeof op.insert === 'string'; + }).map(function (op) { + return op.insert; + }).join(''); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + this.scroll.insertAt(index, embed, value); + return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); + } + }, { + key: 'insertText', + value: function insertText(index, text) { + var _this4 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + this.scroll.insertAt(index, text); + Object.keys(formats).forEach(function (format) { + _this4.scroll.formatAt(index, text.length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); + } + }, { + key: 'isBlank', + value: function isBlank() { + if (this.scroll.children.length == 0) return true; + if (this.scroll.children.length > 1) return false; + var child = this.scroll.children.head; + return child.length() <= 1 && Object.keys(child.formats()).length == 0; + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length) { + var text = this.getText(index, length); + + var _scroll$line3 = this.scroll.line(index + length), + _scroll$line4 = _slicedToArray(_scroll$line3, 2), + line = _scroll$line4[0], + offset = _scroll$line4[1]; + + var suffixLength = 0, + suffix = new _quillDelta2.default(); + if (line != null) { + if (!(line instanceof _code2.default)) { + suffixLength = line.length() - offset; + } else { + suffixLength = line.newlineIndex(offset) - offset + 1; + } + suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); + } + var contents = this.getContents(index, length + suffixLength); + var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); + var delta = new _quillDelta2.default().retain(index).concat(diff); + return this.applyDelta(delta); + } + }, { + key: 'update', + value: function update(change) { + var _this5 = this; + + var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + + var oldDelta = this.delta; + if (mutations.length === 1 && mutations[0].type === 'characterData' && _parchment2.default.find(mutations[0].target)) { + (function () { + // Optimization for character changes + var textBlot = _parchment2.default.find(mutations[0].target); + var formats = (0, _block.bubbleFormats)(textBlot); + var index = textBlot.offset(_this5.scroll); + var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); + var oldText = new _quillDelta2.default().insert(oldValue); + var newText = new _quillDelta2.default().insert(textBlot.value()); + var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); + change = diffDelta.reduce(function (delta, op) { + if (op.insert) { + return delta.insert(op.insert, formats); + } else { + return delta.push(op); + } + }, new _quillDelta2.default()); + _this5.delta = oldDelta.compose(change); + })(); + } else { + this.delta = this.getDelta(); + if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { + change = oldDelta.diff(this.delta, cursorIndex); + } + } + return change; + } + }]); + + return Editor; + }(); + + function combineFormats(formats, combined) { + return Object.keys(combined).reduce(function (merged, name) { + if (formats[name] == null) return merged; + if (combined[name] === formats[name]) { + merged[name] = combined[name]; + } else if (Array.isArray(combined[name])) { + if (combined[name].indexOf(formats[name]) < 0) { + merged[name] = combined[name].concat([formats[name]]); + } + } else { + merged[name] = [combined[name], formats[name]]; + } + return merged; + }, {}); + } + + function normalizeDelta(delta) { + return delta.reduce(function (delta, op) { + if (op.insert === 1) { + var attributes = (0, _clone2.default)(op.attributes); + delete attributes['image']; + return delta.insert({ image: op.attributes.image }, attributes); + } + if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { + op = (0, _clone2.default)(op); + if (op.attributes.list) { + op.attributes.list = 'ordered'; + } else { + op.attributes.list = 'bullet'; + delete op.attributes.bullet; + } + } + if (typeof op.insert === 'string') { + var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + return delta.insert(text, op.attributes); + } + return delta.push(op); + }, new _quillDelta2.default()); + } + + exports.default = Editor; + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Code = undefined; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _quillDelta = __webpack_require__(20); + + var _quillDelta2 = _interopRequireDefault(_quillDelta); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + var _inline = __webpack_require__(33); + + var _inline2 = _interopRequireDefault(_inline); + + var _text = __webpack_require__(34); + + var _text2 = _interopRequireDefault(_text); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Code = function (_Inline) { + _inherits(Code, _Inline); + + function Code() { + _classCallCheck(this, Code); + + return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); + } + + return Code; + }(_inline2.default); + + Code.blotName = 'code'; + Code.tagName = 'CODE'; + + var CodeBlock = function (_Block) { + _inherits(CodeBlock, _Block); + + function CodeBlock() { + _classCallCheck(this, CodeBlock); + + return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); + } + + _createClass(CodeBlock, [{ + key: 'delta', + value: function delta() { + var _this3 = this; + + var text = this.domNode.textContent; + if (text.endsWith('\n')) { + // Should always be true + text = text.slice(0, -1); + } + return text.split('\n').reduce(function (delta, frag) { + return delta.insert(frag).insert('\n', _this3.formats()); + }, new _quillDelta2.default()); + } + }, { + key: 'format', + value: function format(name, value) { + if (name === this.statics.blotName && value) return; + + var _descendant = this.descendant(_text2.default, this.length() - 1), + _descendant2 = _slicedToArray(_descendant, 1), + text = _descendant2[0]; + + if (text != null) { + text.deleteAt(text.length() - 1, 1); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length === 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { + return; + } + var nextNewline = this.newlineIndex(index); + if (nextNewline < 0 || nextNewline >= index + length) return; + var prevNewline = this.newlineIndex(index, true) + 1; + var isolateLength = nextNewline - prevNewline + 1; + var blot = this.isolate(prevNewline, isolateLength); + var next = blot.next; + blot.format(name, value); + if (next instanceof CodeBlock) { + next.formatAt(0, index - prevNewline + length - isolateLength, name, value); + } + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return; + + var _descendant3 = this.descendant(_text2.default, index), + _descendant4 = _slicedToArray(_descendant3, 2), + text = _descendant4[0], + offset = _descendant4[1]; + + text.insertAt(offset, value); + } + }, { + key: 'length', + value: function length() { + var length = this.domNode.textContent.length; + if (!this.domNode.textContent.endsWith('\n')) { + return length + 1; + } + return length; + } + }, { + key: 'newlineIndex', + value: function newlineIndex(searchIndex) { + var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (!reverse) { + var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); + return offset > -1 ? searchIndex + offset : -1; + } else { + return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); + } + } + }, { + key: 'optimize', + value: function optimize() { + if (!this.domNode.textContent.endsWith('\n')) { + this.appendChild(_parchment2.default.create('text', '\n')); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { + next.optimize(); + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); + [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { + var blot = _parchment2.default.find(node); + if (blot == null) { + node.parentNode.removeChild(node); + } else if (blot instanceof _parchment2.default.Embed) { + blot.remove(); + } else { + blot.unwrap(); + } + }); + } + }], [{ + key: 'create', + value: function create(value) { + var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); + domNode.setAttribute('spellcheck', false); + return domNode; + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return CodeBlock; + }(_block2.default); + + CodeBlock.blotName = 'code-block'; + CodeBlock.tagName = 'PRE'; + CodeBlock.TAB = ' '; + + exports.Code = Code; + exports.default = CodeBlock; + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _extend = __webpack_require__(30); + + var _extend2 = _interopRequireDefault(_extend); + + var _quillDelta = __webpack_require__(20); + + var _quillDelta2 = _interopRequireDefault(_quillDelta); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _break = __webpack_require__(31); + + var _break2 = _interopRequireDefault(_break); + + var _embed = __webpack_require__(32); + + var _embed2 = _interopRequireDefault(_embed); + + var _inline = __webpack_require__(33); + + var _inline2 = _interopRequireDefault(_inline); + + var _text = __webpack_require__(34); + + var _text2 = _interopRequireDefault(_text); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var NEWLINE_LENGTH = 1; + + var BlockEmbed = function (_Embed) { + _inherits(BlockEmbed, _Embed); + + function BlockEmbed() { + _classCallCheck(this, BlockEmbed); + + return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); + } + + _createClass(BlockEmbed, [{ + key: 'attach', + value: function attach() { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); + this.attributes = new _parchment2.default.Attributor.Store(this.domNode); + } + }, { + key: 'delta', + value: function delta() { + return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); + } + }, { + key: 'format', + value: function format(name, value) { + var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); + if (attribute != null) { + this.attributes.attribute(attribute, value); + } + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + this.format(name, value); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (typeof value === 'string' && value.endsWith('\n')) { + var block = _parchment2.default.create(Block.blotName); + this.parent.insertBefore(block, index === 0 ? this : this.next); + block.insertAt(0, value.slice(0, -1)); + } else { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); + } + } + }]); + + return BlockEmbed; + }(_embed2.default); + + BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; + // It is important for cursor behavior BlockEmbeds use tags that are block level elements + + + var Block = function (_Parchment$Block) { + _inherits(Block, _Parchment$Block); + + function Block(domNode) { + _classCallCheck(this, Block); + + var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); + + _this2.cache = {}; + return _this2; + } + + _createClass(Block, [{ + key: 'delta', + value: function delta() { + if (this.cache.delta == null) { + this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { + if (leaf.length() === 0) { + return delta; + } else { + return delta.insert(leaf.value(), bubbleFormats(leaf)); + } + }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); + } + return this.cache.delta; + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); + this.cache = {}; + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length <= 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + if (index + length === this.length()) { + this.format(name, value); + } + } else { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); + } + this.cache = {}; + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); + if (value.length === 0) return; + var lines = value.split('\n'); + var text = lines.shift(); + if (text.length > 0) { + if (index < this.length() - 1 || this.children.tail == null) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); + } else { + this.children.tail.insertAt(this.children.tail.length(), text); + } + this.cache = {}; + } + var block = this; + lines.reduce(function (index, line) { + block = block.split(index, true); + block.insertAt(0, line); + return line.length; + }, index + text.length); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + var head = this.children.head; + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); + if (head instanceof _break2.default) { + head.remove(); + } + this.cache = {}; + } + }, { + key: 'length', + value: function length() { + if (this.cache.length == null) { + this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; + } + return this.cache.length; + } + }, { + key: 'moveChildren', + value: function moveChildren(target, ref) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); + this.cache = {}; + } + }, { + key: 'optimize', + value: function optimize() { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this); + this.cache = {}; + } + }, { + key: 'path', + value: function path(index) { + return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); + } + }, { + key: 'removeChild', + value: function removeChild(child) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); + this.cache = {}; + } + }, { + key: 'split', + value: function split(index) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { + var clone = this.clone(); + if (index === 0) { + this.parent.insertBefore(clone, this); + return this; + } else { + this.parent.insertBefore(clone, this.next); + return clone; + } + } else { + var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); + this.cache = {}; + return next; + } + } + }]); + + return Block; + }(_parchment2.default.Block); + + Block.blotName = 'block'; + Block.tagName = 'P'; + Block.defaultChild = 'break'; + Block.allowedChildren = [_inline2.default, _embed2.default, _text2.default]; + + function bubbleFormats(blot) { + var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (blot == null) return formats; + if (typeof blot.formats === 'function') { + formats = (0, _extend2.default)(formats, blot.formats()); + } + if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { + return formats; + } + return bubbleFormats(blot.parent, formats); + } + + exports.bubbleFormats = bubbleFormats; + exports.BlockEmbed = BlockEmbed; + exports.default = Block; + +/***/ }, +/* 30 */ +/***/ function(module, exports) { + + 'use strict'; + + var hasOwn = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + + var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; + }; + + var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) {/**/} + + return typeof key === 'undefined' || hasOwn.call(obj, key); + }; + + module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0], + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; + }; + + + +/***/ }, +/* 31 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _embed = __webpack_require__(32); + + var _embed2 = _interopRequireDefault(_embed); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Break = function (_Embed) { + _inherits(Break, _Embed); + + function Break() { + _classCallCheck(this, Break); + + return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); + } + + _createClass(Break, [{ + key: 'insertInto', + value: function insertInto(parent, ref) { + if (parent.children.length === 0) { + _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); + } else { + this.remove(); + } + } + }, { + key: 'length', + value: function length() { + return 0; + } + }, { + key: 'value', + value: function value() { + return ''; + } + }], [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + return Break; + }(_embed2.default); + + Break.blotName = 'break'; + Break.tagName = 'BR'; + + exports.default = Break; + +/***/ }, +/* 32 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Embed = function (_Parchment$Embed) { + _inherits(Embed, _Parchment$Embed); + + function Embed() { + _classCallCheck(this, Embed); + + return _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).apply(this, arguments)); + } + + return Embed; + }(_parchment2.default.Embed); + + exports.default = Embed; + +/***/ }, +/* 33 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _embed = __webpack_require__(32); + + var _embed2 = _interopRequireDefault(_embed); + + var _text = __webpack_require__(34); + + var _text2 = _interopRequireDefault(_text); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Inline = function (_Parchment$Inline) { + _inherits(Inline, _Parchment$Inline); + + function Inline() { + _classCallCheck(this, Inline); + + return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); + } + + _createClass(Inline, [{ + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { + var blot = this.isolate(index, length); + if (value) { + blot.wrap(name, value); + } + } else { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); + } + } + }, { + key: 'optimize', + value: function optimize() { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this); + if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { + var parent = this.parent.isolate(this.offset(), this.length()); + this.moveChildren(parent); + parent.wrap(this); + } + } + }], [{ + key: 'compare', + value: function compare(self, other) { + var selfIndex = Inline.order.indexOf(self); + var otherIndex = Inline.order.indexOf(other); + if (selfIndex >= 0 || otherIndex >= 0) { + return selfIndex - otherIndex; + } else if (self === other) { + return 0; + } else if (self < other) { + return -1; + } else { + return 1; + } + } + }]); + + return Inline; + }(_parchment2.default.Inline); + + Inline.allowedChildren = [Inline, _embed2.default, _text2.default]; + // Lower index means deeper in the DOM tree, since not found (-1) is for embeds + Inline.order = ['cursor', 'inline', // Must be lower + 'code', 'underline', 'strike', 'italic', 'bold', 'script', 'link' // Must be higher + ]; + + exports.default = Inline; + +/***/ }, +/* 34 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var TextBlot = function (_Parchment$Text) { + _inherits(TextBlot, _Parchment$Text); + + function TextBlot() { + _classCallCheck(this, TextBlot); + + return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); + } + + return TextBlot; + }(_parchment2.default.Text); + + exports.default = TextBlot; + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _embed = __webpack_require__(32); + + var _embed2 = _interopRequireDefault(_embed); + + var _text = __webpack_require__(34); + + var _text2 = _interopRequireDefault(_text); + + var _emitter = __webpack_require__(36); + + var _emitter2 = _interopRequireDefault(_emitter); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Cursor = function (_Embed) { + _inherits(Cursor, _Embed); + + _createClass(Cursor, null, [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + function Cursor(domNode, selection) { + _classCallCheck(this, Cursor); + + var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); + + _this.selection = selection; + _this.textNode = document.createTextNode(Cursor.CONTENTS); + _this.domNode.appendChild(_this.textNode); + _this._length = 0; + return _this; + } + + _createClass(Cursor, [{ + key: 'detach', + value: function detach() { + // super.detach() will also clear domNode.__blot + if (this.parent != null) this.parent.removeChild(this); + } + }, { + key: 'format', + value: function format(name, value) { + if (this._length !== 0) { + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); + } + var target = this, + index = 0; + while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { + index += target.offset(target.parent); + target = target.parent; + } + if (target != null) { + this._length = Cursor.CONTENTS.length; + target.optimize(); + target.formatAt(index, Cursor.CONTENTS.length, name, value); + this._length = 0; + } + } + }, { + key: 'index', + value: function index(node, offset) { + if (node === this.textNode) return 0; + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'length', + value: function length() { + return this._length; + } + }, { + key: 'position', + value: function position() { + return [this.textNode, this.textNode.data.length]; + } + }, { + key: 'remove', + value: function remove() { + _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); + this.parent = null; + } + }, { + key: 'restore', + value: function restore() { + var _this2 = this; + + if (this.selection.composing) return; + if (this.parent == null) return; + var textNode = this.textNode; + var range = this.selection.getNativeRange(); + var restoreText = void 0, + start = void 0, + end = void 0; + if (range != null && range.start.node === textNode && range.end.node === textNode) { + var _ref = [textNode, range.start.offset, range.end.offset]; + restoreText = _ref[0]; + start = _ref[1]; + end = _ref[2]; + } + // Link format will insert text outside of anchor tag + while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { + this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); + } + if (this.textNode.data !== Cursor.CONTENTS) { + var text = this.textNode.data.split(Cursor.CONTENTS).join(''); + if (this.next instanceof _text2.default) { + restoreText = this.next.domNode; + this.next.insertAt(0, text); + this.textNode.data = Cursor.CONTENTS; + } else { + this.textNode.data = text; + this.parent.insertBefore(_parchment2.default.create(this.textNode), this); + this.textNode = document.createTextNode(Cursor.CONTENTS); + this.domNode.appendChild(this.textNode); + } + } + this.remove(); + if (start == null) return; + this.selection.emitter.once(_emitter2.default.events.SCROLL_OPTIMIZE, function () { + var _map = [start, end].map(function (offset) { + return Math.max(0, Math.min(restoreText.data.length, offset - 1)); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + + _this2.selection.setNativeRange(restoreText, start, restoreText, end); + }); + } + }, { + key: 'update', + value: function update(mutations) { + var _this3 = this; + + mutations.forEach(function (mutation) { + if (mutation.type === 'characterData' && mutation.target === _this3.textNode) { + _this3.restore(); + } + }); + } + }, { + key: 'value', + value: function value() { + return ''; + } + }]); + + return Cursor; + }(_embed2.default); + + Cursor.blotName = 'cursor'; + Cursor.className = 'ql-cursor'; + Cursor.tagName = 'span'; + Cursor.CONTENTS = '\uFEFF'; // Zero width no break space + + + exports.default = Cursor; + +/***/ }, +/* 36 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _eventemitter = __webpack_require__(37); + + var _eventemitter2 = _interopRequireDefault(_eventemitter); + + var _logger = __webpack_require__(38); + + var _logger2 = _interopRequireDefault(_logger); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var debug = (0, _logger2.default)('quill:events'); + + var Emitter = function (_EventEmitter) { + _inherits(Emitter, _EventEmitter); + + function Emitter() { + _classCallCheck(this, Emitter); + + var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); + + _this.on('error', debug.error); + return _this; + } + + _createClass(Emitter, [{ + key: 'emit', + value: function emit() { + debug.log.apply(debug, arguments); + _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); + } + }]); + + return Emitter; + }(_eventemitter2.default); + + Emitter.events = { + EDITOR_CHANGE: 'editor-change', + SCROLL_BEFORE_UPDATE: 'scroll-before-update', + SCROLL_OPTIMIZE: 'scroll-optimize', + SCROLL_UPDATE: 'scroll-update', + SELECTION_CHANGE: 'selection-change', + TEXT_CHANGE: 'text-change' + }; + Emitter.sources = { + API: 'api', + SILENT: 'silent', + USER: 'user' + }; + + exports.default = Emitter; + +/***/ }, +/* 37 */ +/***/ function(module, exports) { + + 'use strict'; + + var has = Object.prototype.hasOwnProperty + , prefix = '~'; + + /** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @api private + */ + function Events() {} + + // + // We try to not inherit from `Object.prototype`. In some engines creating an + // instance in this way is faster than calling `Object.create(null)` directly. + // If `Object.create(null)` is not supported we prefix the event names with a + // character to make sure that the built-in object properties are not + // overridden or used as an attack vector. + // + if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; + } + + /** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {Mixed} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @api private + */ + function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; + } + + /** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @api public + */ + function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; + } + + /** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ + EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; + }; + + /** + * Return the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Boolean} exists Only check if there are listeners. + * @returns {Array|Boolean} + * @api public + */ + EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; + }; + + /** + * Calls each of the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @api public + */ + EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + 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++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (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 true; + }; + + /** + * Add a listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; + }; + + /** + * Add a one-time listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; + }; + + /** + * Remove the listeners of a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {Mixed} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn + && (!once || listeners.once) + && (!context || listeners.context === context) + ) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + + return this; + }; + + /** + * Remove all listeners, or those of the specified event. + * + * @param {String|Symbol} [event] The event name. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; + }; + + // + // Alias methods names because people roll like that. + // + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + EventEmitter.prototype.addListener = EventEmitter.prototype.on; + + // + // This function doesn't apply anymore. + // + EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; + }; + + // + // Expose the prefix. + // + EventEmitter.prefixed = prefix; + + // + // Allow `EventEmitter` to be imported as module namespace. + // + EventEmitter.EventEmitter = EventEmitter; + + // + // Expose the module. + // + if ('undefined' !== typeof module) { + module.exports = EventEmitter; + } + + +/***/ }, +/* 38 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + var levels = ['error', 'warn', 'log', 'info']; + var level = 'warn'; + + function debug(method) { + if (levels.indexOf(method) <= levels.indexOf(level)) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + console[method].apply(console, args); // eslint-disable-line no-console + } + } + + function namespace(ns) { + return levels.reduce(function (logger, method) { + logger[method] = debug.bind(console, method, ns); + return logger; + }, {}); + } + + debug.level = namespace.level = function (newLevel) { + level = newLevel; + }; + + exports.default = namespace; + +/***/ }, +/* 39 */ +/***/ function(module, exports) { + + var clone = (function() { + 'use strict'; + + var nativeMap; + try { + nativeMap = Map; + } catch(_) { + // maybe a reference error because no `Map`. Give it a dummy value that no + // value will ever be an instanceof. + nativeMap = function() {}; + } + + var nativeSet; + try { + nativeSet = Set; + } catch(_) { + nativeSet = function() {}; + } + + var nativePromise; + try { + nativePromise = Promise; + } catch(_) { + nativePromise = function() {}; + } + + /** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). + */ + function clone(parent, circular, depth, prototype) { + var filter; + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + filter = circular.filter; + circular = circular.circular; + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth === 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (parent instanceof nativeMap) { + child = new nativeMap(); + } else if (parent instanceof nativeSet) { + child = new nativeSet(); + } else if (parent instanceof nativePromise) { + child = new nativePromise(function (resolve, reject) { + parent.then(function(value) { + resolve(_clone(value, depth - 1)); + }, function(err) { + reject(_clone(err, depth - 1)); + }); + }); + } else if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + child = new Buffer(parent.length); + parent.copy(child); + return child; + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + if (parent instanceof nativeMap) { + var keyIterator = parent.keys(); + while(true) { + var next = keyIterator.next(); + if (next.done) { + break; + } + var keyChild = _clone(next.value, depth - 1); + var valueChild = _clone(parent.get(next.value), depth - 1); + child.set(keyChild, valueChild); + } + } + if (parent instanceof nativeSet) { + var iterator = parent.keys(); + while(true) { + var next = iterator.next(); + if (next.done) { + break; + } + var entryChild = _clone(next.value, depth - 1); + child.add(entryChild); + } + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(parent); + for (var i = 0; i < symbols.length; i++) { + // Don't need to worry about cloning a symbol because it is a primitive, + // like a number or string. + var symbol = symbols[i]; + child[symbol] = _clone(parent[symbol], depth - 1); + } + } + + return child; + } + + return _clone(parent, depth); + } + + /** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ + clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); + }; + + // private utility functions + + function __objToStr(o) { + return Object.prototype.toString.call(o); + } + clone.__objToStr = __objToStr; + + function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; + } + clone.__isDate = __isDate; + + function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; + } + clone.__isArray = __isArray; + + function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; + } + clone.__isRegExp = __isRegExp; + + function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; + } + clone.__getRegExpFlags = __getRegExpFlags; + + return clone; + })(); + + if (typeof module === 'object' && module.exports) { + module.exports = clone; + } + + +/***/ }, +/* 40 */ +/***/ function(module, exports, __webpack_require__) { + + var pSlice = Array.prototype.slice; + var objectKeys = __webpack_require__(41); + var isArguments = __webpack_require__(42); + + var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } + } + + function isUndefinedOrNull(value) { + return value === null || value === undefined; + } + + function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; + } + + function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; + } + + +/***/ }, +/* 41 */ +/***/ function(module, exports) { + + exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + + exports.shim = shim; + function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; + } + + +/***/ }, +/* 42 */ +/***/ function(module, exports) { + + var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) + })() == '[object Arguments]'; + + exports = module.exports = supportsArgumentsClass ? supported : unsupported; + + exports.supported = supported; + function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; + }; + + exports.unsupported = unsupported; + function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; + }; + + +/***/ }, +/* 43 */ +/***/ function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var Module = function Module(quill) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Module); + + this.quill = quill; + this.options = options; + }; + + Module.DEFAULTS = {}; + + exports.default = Module; + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Range = undefined; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _clone = __webpack_require__(39); + + var _clone2 = _interopRequireDefault(_clone); + + var _deepEqual = __webpack_require__(40); + + var _deepEqual2 = _interopRequireDefault(_deepEqual); + + var _emitter3 = __webpack_require__(36); + + var _emitter4 = _interopRequireDefault(_emitter3); + + var _logger = __webpack_require__(38); + + var _logger2 = _interopRequireDefault(_logger); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var debug = (0, _logger2.default)('quill:selection'); + + var Range = function Range(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + _classCallCheck(this, Range); + + this.index = index; + this.length = length; + }; + + var Selection = function () { + function Selection(scroll, emitter) { + var _this = this; + + _classCallCheck(this, Selection); + + this.emitter = emitter; + this.scroll = scroll; + this.composing = false; + this.root = this.scroll.domNode; + this.root.addEventListener('compositionstart', function () { + _this.composing = true; + }); + this.root.addEventListener('compositionend', function () { + _this.composing = false; + }); + this.cursor = _parchment2.default.create('cursor', this); + // savedRange is last non-null range + this.lastRange = this.savedRange = new Range(0, 0); + ['keyup', 'mouseup', 'mouseleave', 'touchend', 'touchleave', 'focus', 'blur'].forEach(function (eventName) { + _this.root.addEventListener(eventName, function () { + // When range used to be a selection and user click within the selection, + // the range now being a cursor has not updated yet without setTimeout + setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 100); + }); + }); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { + if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { + _this.update(_emitter4.default.sources.SILENT); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { + var native = _this.getNativeRange(); + if (native == null) return; + if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle + // TODO unclear if this has negative side effects + _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { + try { + _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); + } catch (ignored) {} + }); + }); + this.update(_emitter4.default.sources.SILENT); + } + + _createClass(Selection, [{ + key: 'focus', + value: function focus() { + if (this.hasFocus()) return; + var bodyTop = document.body.scrollTop; + this.root.focus(); + document.body.scrollTop = bodyTop; + this.setRange(this.savedRange); + } + }, { + key: 'format', + value: function format(_format, value) { + this.scroll.update(); + var nativeRange = this.getNativeRange(); + if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; + if (nativeRange.start.node !== this.cursor.textNode) { + var blot = _parchment2.default.find(nativeRange.start.node, false); + if (blot == null) return; + // TODO Give blot ability to not split + if (blot instanceof _parchment2.default.Leaf) { + var after = blot.split(nativeRange.start.offset); + blot.parent.insertBefore(this.cursor, after); + } else { + blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen + } + this.cursor.attach(); + } + this.cursor.format(_format, value); + this.scroll.optimize(); + this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); + this.update(); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var scrollLength = this.scroll.length(); + index = Math.min(index, scrollLength - 1); + length = Math.min(index + length, scrollLength - 1) - index; + var bounds = void 0, + node = void 0, + _scroll$leaf = this.scroll.leaf(index), + _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), + leaf = _scroll$leaf2[0], + offset = _scroll$leaf2[1]; + if (leaf == null) return null; + + var _leaf$position = leaf.position(offset, true); + + var _leaf$position2 = _slicedToArray(_leaf$position, 2); + + node = _leaf$position2[0]; + offset = _leaf$position2[1]; + + var range = document.createRange(); + if (length > 0) { + range.setStart(node, offset); + + var _scroll$leaf3 = this.scroll.leaf(index + length); + + var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); + + leaf = _scroll$leaf4[0]; + offset = _scroll$leaf4[1]; + + if (leaf == null) return null; + + var _leaf$position3 = leaf.position(offset, true); + + var _leaf$position4 = _slicedToArray(_leaf$position3, 2); + + node = _leaf$position4[0]; + offset = _leaf$position4[1]; + + range.setEnd(node, offset); + bounds = range.getBoundingClientRect(); + } else { + var side = 'left'; + var rect = void 0; + if (node instanceof Text) { + if (offset < node.data.length) { + range.setStart(node, offset); + range.setEnd(node, offset + 1); + } else { + range.setStart(node, offset - 1); + range.setEnd(node, offset); + side = 'right'; + } + rect = range.getBoundingClientRect(); + } else { + rect = leaf.domNode.getBoundingClientRect(); + if (offset > 0) side = 'right'; + } + bounds = { + height: rect.height, + left: rect[side], + width: 0, + top: rect.top + }; + } + var containerBounds = this.root.parentNode.getBoundingClientRect(); + return { + left: bounds.left - containerBounds.left, + right: bounds.left + bounds.width - containerBounds.left, + top: bounds.top - containerBounds.top, + bottom: bounds.top + bounds.height - containerBounds.top, + height: bounds.height, + width: bounds.width + }; + } + }, { + key: 'getNativeRange', + value: function getNativeRange() { + var selection = document.getSelection(); + if (selection == null || selection.rangeCount <= 0) return null; + var nativeRange = selection.getRangeAt(0); + if (nativeRange == null) return null; + if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { + return null; + } + var range = { + start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, + end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, + native: nativeRange + }; + [range.start, range.end].forEach(function (position) { + var node = position.node, + offset = position.offset; + while (!(node instanceof Text) && node.childNodes.length > 0) { + if (node.childNodes.length > offset) { + node = node.childNodes[offset]; + offset = 0; + } else if (node.childNodes.length === offset) { + node = node.lastChild; + offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; + } else { + break; + } + } + position.node = node, position.offset = offset; + }); + debug.info('getNativeRange', range); + return range; + } + }, { + key: 'getRange', + value: function getRange() { + var _this2 = this; + + var range = this.getNativeRange(); + if (range == null) return [null, null]; + var positions = [[range.start.node, range.start.offset]]; + if (!range.native.collapsed) { + positions.push([range.end.node, range.end.offset]); + } + var indexes = positions.map(function (position) { + var _position = _slicedToArray(position, 2), + node = _position[0], + offset = _position[1]; + + var blot = _parchment2.default.find(node, true); + var index = blot.offset(_this2.scroll); + if (offset === 0) { + return index; + } else if (blot instanceof _parchment2.default.Container) { + return index + blot.length(); + } else { + return index + blot.index(node, offset); + } + }); + var start = Math.min.apply(Math, _toConsumableArray(indexes)), + end = Math.max.apply(Math, _toConsumableArray(indexes)); + return [new Range(start, end - start), range]; + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return document.activeElement === this.root; + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView() { + var range = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.lastRange; + + if (range == null) return; + var bounds = this.getBounds(range.index, range.length); + if (bounds == null) return; + if (this.root.offsetHeight < bounds.bottom) { + var _scroll$line = this.scroll.line(Math.min(range.index + range.length, this.scroll.length() - 1)), + _scroll$line2 = _slicedToArray(_scroll$line, 1), + line = _scroll$line2[0]; + + this.root.scrollTop = line.domNode.offsetTop + line.domNode.offsetHeight - this.root.offsetHeight; + } else if (bounds.top < 0) { + var _scroll$line3 = this.scroll.line(Math.min(range.index, this.scroll.length() - 1)), + _scroll$line4 = _slicedToArray(_scroll$line3, 1), + _line = _scroll$line4[0]; + + this.root.scrollTop = _line.domNode.offsetTop; + } + } + }, { + key: 'setNativeRange', + value: function setNativeRange(startNode, startOffset) { + var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; + var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; + var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); + if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { + return; + } + var selection = document.getSelection(); + if (selection == null) return; + if (startNode != null) { + if (!this.hasFocus()) this.root.focus(); + var nativeRange = this.getNativeRange(); + if (nativeRange == null || force || startNode !== nativeRange.start.node || startOffset !== nativeRange.start.offset || endNode !== nativeRange.end.node || endOffset !== nativeRange.end.offset) { + var range = document.createRange(); + range.setStart(startNode, startOffset); + range.setEnd(endNode, endOffset); + selection.removeAllRanges(); + selection.addRange(range); + } + } else { + selection.removeAllRanges(); + this.root.blur(); + document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) + } + } + }, { + key: 'setRange', + value: function setRange(range) { + var _this3 = this; + + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + if (typeof force === 'string') { + source = force; + force = false; + } + debug.info('setRange', range); + if (range != null) { + (function () { + var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; + var args = []; + var scrollLength = _this3.scroll.length(); + indexes.forEach(function (index, i) { + index = Math.min(scrollLength - 1, index); + var node = void 0, + _scroll$leaf5 = _this3.scroll.leaf(index), + _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), + leaf = _scroll$leaf6[0], + offset = _scroll$leaf6[1]; + var _leaf$position5 = leaf.position(offset, i !== 0); + + var _leaf$position6 = _slicedToArray(_leaf$position5, 2); + + node = _leaf$position6[0]; + offset = _leaf$position6[1]; + + args.push(node, offset); + }); + if (args.length < 2) { + args = args.concat(args); + } + _this3.setNativeRange.apply(_this3, _toConsumableArray(args).concat([force])); + })(); + } else { + this.setNativeRange(null); + } + this.update(source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var nativeRange = void 0, + oldRange = this.lastRange; + + var _getRange = this.getRange(); + + var _getRange2 = _slicedToArray(_getRange, 2); + + this.lastRange = _getRange2[0]; + nativeRange = _getRange2[1]; + + if (this.lastRange != null) { + this.savedRange = this.lastRange; + } + if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { + var _emitter; + + if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { + this.cursor.restore(); + } + var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + } + }]); + + return Selection; + }(); + + function contains(parent, descendant) { + try { + // Firefox inserts inaccessible nodes around video elements + descendant.parentNode; + } catch (e) { + return false; + } + // IE11 has bug with Text nodes + // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect + if (descendant instanceof Text) { + descendant = descendant.parentNode; + } + return parent.contains(descendant); + } + + exports.Range = Range; + exports.default = Selection; + +/***/ }, +/* 45 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var Theme = function () { + function Theme(quill, options) { + _classCallCheck(this, Theme); + + this.quill = quill; + this.options = options; + this.modules = {}; + } + + _createClass(Theme, [{ + key: 'init', + value: function init() { + var _this = this; + + Object.keys(this.options.modules).forEach(function (name) { + if (_this.modules[name] == null) { + _this.addModule(name); + } + }); + } + }, { + key: 'addModule', + value: function addModule(name) { + var moduleClass = this.quill.constructor.import('modules/' + name); + this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); + return this.modules[name]; + } + }]); + + return Theme; + }(); + + Theme.DEFAULTS = { + modules: {} + }; + Theme.themes = { + 'default': Theme + }; + + exports.default = Theme; + +/***/ }, +/* 46 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Container = function (_Parchment$Container) { + _inherits(Container, _Parchment$Container); + + function Container() { + _classCallCheck(this, Container); + + return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); + } + + return Container; + }(_parchment2.default.Container); + + Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; + + exports.default = Container; + +/***/ }, +/* 47 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _emitter = __webpack_require__(36); + + var _emitter2 = _interopRequireDefault(_emitter); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + var _break = __webpack_require__(31); + + var _break2 = _interopRequireDefault(_break); + + var _container = __webpack_require__(46); + + var _container2 = _interopRequireDefault(_container); + + var _code = __webpack_require__(28); + + var _code2 = _interopRequireDefault(_code); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + function isLine(blot) { + return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; + } + + var Scroll = function (_Parchment$Scroll) { + _inherits(Scroll, _Parchment$Scroll); + + function Scroll(domNode, config) { + _classCallCheck(this, Scroll); + + var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); + + _this.emitter = config.emitter; + if (Array.isArray(config.whitelist)) { + _this.whitelist = config.whitelist.reduce(function (whitelist, format) { + whitelist[format] = true; + return whitelist; + }, {}); + } + _this.optimize(); + _this.enable(); + return _this; + } + + _createClass(Scroll, [{ + key: 'deleteAt', + value: function deleteAt(index, length) { + var _line = this.line(index), + _line2 = _slicedToArray(_line, 2), + first = _line2[0], + offset = _line2[1]; + + var _line3 = this.line(index + length), + _line4 = _slicedToArray(_line3, 1), + last = _line4[0]; + + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); + if (last != null && first !== last && offset > 0 && !(first instanceof _block.BlockEmbed) && !(last instanceof _block.BlockEmbed)) { + if (last instanceof _code2.default) { + last.deleteAt(last.length() - 1, 1); + } + var ref = last.children.head instanceof _break2.default ? null : last.children.head; + first.moveChildren(last, ref); + first.remove(); + } + this.optimize(); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.domNode.setAttribute('contenteditable', enabled); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, format, value) { + if (this.whitelist != null && !this.whitelist[format]) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); + this.optimize(); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null && this.whitelist != null && !this.whitelist[value]) return; + if (index >= this.length()) { + if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { + var blot = _parchment2.default.create(this.statics.defaultChild); + this.appendChild(blot); + if (def == null && value.endsWith('\n')) { + value = value.slice(0, -1); + } + blot.insertAt(0, value, def); + } else { + var embed = _parchment2.default.create(value, def); + this.appendChild(embed); + } + } else { + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); + } + this.optimize(); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { + var wrapper = _parchment2.default.create(this.statics.defaultChild); + wrapper.appendChild(blot); + blot = wrapper; + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); + } + }, { + key: 'leaf', + value: function leaf(index) { + return this.path(index).pop() || [null, -1]; + } + }, { + key: 'line', + value: function line(index) { + if (index === this.length()) { + return this.line(index - 1); + } + return this.descendant(isLine, index); + } + }, { + key: 'lines', + value: function lines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + var getLines = function getLines(blot, index, length) { + var lines = [], + lengthLeft = length; + blot.children.forEachAt(index, length, function (child, index, length) { + if (isLine(child)) { + lines.push(child); + } else if (child instanceof _parchment2.default.Container) { + lines = lines.concat(getLines(child, index, lengthLeft)); + } + lengthLeft -= length; + }); + return lines; + }; + return getLines(this, index, length); + } + }, { + key: 'optimize', + value: function optimize() { + var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + if (this.batch === true) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations); + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations); + } + } + }, { + key: 'path', + value: function path(index) { + return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self + } + }, { + key: 'update', + value: function update(mutations) { + if (this.batch === true) return; + var source = _emitter2.default.sources.USER; + if (typeof mutations === 'string') { + source = mutations; + } + if (!Array.isArray(mutations)) { + mutations = this.observer.takeRecords(); + } + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); + } + } + }]); + + return Scroll; + }(_parchment2.default.Scroll); + + Scroll.blotName = 'scroll'; + Scroll.className = 'ql-editor'; + Scroll.tagName = 'DIV'; + Scroll.defaultChild = 'block'; + Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; + + exports.default = Scroll; + +/***/ }, +/* 48 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _quillDelta = __webpack_require__(20); + + var _quillDelta2 = _interopRequireDefault(_quillDelta); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _quill = __webpack_require__(18); + + var _quill2 = _interopRequireDefault(_quill); + + var _logger = __webpack_require__(38); + + var _logger2 = _interopRequireDefault(_logger); + + var _module = __webpack_require__(43); + + var _module2 = _interopRequireDefault(_module); + + var _align = __webpack_require__(49); + + var _background = __webpack_require__(50); + + var _color = __webpack_require__(51); + + var _direction = __webpack_require__(52); + + var _font = __webpack_require__(53); + + var _size = __webpack_require__(54); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var debug = (0, _logger2.default)('quill:clipboard'); + + var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; + + var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; + }, {}); + + var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; + }, {}); + + var Clipboard = function (_Module) { + _inherits(Clipboard, _Module); + + function Clipboard(quill, options) { + _classCallCheck(this, Clipboard); + + var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); + + _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); + _this.container = _this.quill.addContainer('ql-clipboard'); + _this.container.setAttribute('contenteditable', true); + _this.container.setAttribute('tabindex', -1); + _this.matchers = []; + CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (pair) { + _this.addMatcher.apply(_this, _toConsumableArray(pair)); + }); + return _this; + } + + _createClass(Clipboard, [{ + key: 'addMatcher', + value: function addMatcher(selector, matcher) { + this.matchers.push([selector, matcher]); + } + }, { + key: 'convert', + value: function convert(html) { + var _this2 = this; + + var DOM_KEY = '__ql-matcher'; + if (typeof html === 'string') { + this.container.innerHTML = html; + } + var textMatchers = [], + elementMatchers = []; + this.matchers.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + selector = _pair[0], + matcher = _pair[1]; + + switch (selector) { + case Node.TEXT_NODE: + textMatchers.push(matcher); + break; + case Node.ELEMENT_NODE: + elementMatchers.push(matcher); + break; + default: + [].forEach.call(_this2.container.querySelectorAll(selector), function (node) { + // TODO use weakmap + node[DOM_KEY] = node[DOM_KEY] || []; + node[DOM_KEY].push(matcher); + }); + break; + } + }); + var traverse = function traverse(node) { + // Post-order + if (node.nodeType === node.TEXT_NODE) { + return textMatchers.reduce(function (delta, matcher) { + return matcher(node, delta); + }, new _quillDelta2.default()); + } else if (node.nodeType === node.ELEMENT_NODE) { + return [].reduce.call(node.childNodes || [], function (delta, childNode) { + var childrenDelta = traverse(childNode); + if (childNode.nodeType === node.ELEMENT_NODE) { + childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + } + return delta.concat(childrenDelta); + }, new _quillDelta2.default()); + } else { + return new _quillDelta2.default(); + } + }; + var delta = traverse(this.container); + // Remove trailing newline + if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); + } + debug.log('convert', this.container.innerHTML, delta); + this.container.innerHTML = ''; + return delta; + } + }, { + key: 'dangerouslyPasteHTML', + value: function dangerouslyPasteHTML(index, html) { + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; + + if (typeof index === 'string') { + return this.quill.setContents(this.convert(index), html); + } else { + var paste = this.convert(html); + return this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); + } + } + }, { + key: 'onPaste', + value: function onPaste(e) { + var _this3 = this; + + if (e.defaultPrevented || !this.quill.isEnabled()) return; + var range = this.quill.getSelection(); + var delta = new _quillDelta2.default().retain(range.index).delete(range.length); + var bodyTop = document.body.scrollTop; + this.container.focus(); + setTimeout(function () { + _this3.quill.selection.update(_quill2.default.sources.SILENT); + delta = delta.concat(_this3.convert()); + _this3.quill.updateContents(delta, _quill2.default.sources.USER); + // range.length contributes to delta.length() + _this3.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); + document.body.scrollTop = bodyTop; + _this3.quill.selection.scrollIntoView(); + }, 1); + } + }]); + + return Clipboard; + }(_module2.default); + + Clipboard.DEFAULTS = { + matchers: [] + }; + + function computeStyle(node) { + if (node.nodeType !== Node.ELEMENT_NODE) return {}; + var DOM_KEY = '__ql-computed-style'; + return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); + } + + function deltaEndsWith(delta, text) { + var endText = ""; + for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { + var op = delta.ops[i]; + if (typeof op.insert !== 'string') break; + endText = op.insert + endText; + } + return endText.slice(-1 * text.length) === text; + } + + function isLine(node) { + if (node.childNodes.length === 0) return false; // Exclude embed blocks + var style = computeStyle(node); + return ['block', 'list-item'].indexOf(style.display) > -1; + } + + function matchAlias(format, node, delta) { + return delta.compose(new _quillDelta2.default().retain(delta.length(), _defineProperty({}, format, true))); + } + + function matchAttributor(node, delta) { + var attributes = _parchment2.default.Attributor.Attribute.keys(node); + var classes = _parchment2.default.Attributor.Class.keys(node); + var styles = _parchment2.default.Attributor.Style.keys(node); + var formats = {}; + attributes.concat(classes).concat(styles).forEach(function (name) { + var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); + if (attr != null) { + formats[attr.attrName] = attr.value(node); + if (formats[attr.attrName]) return; + } + if (ATTRIBUTE_ATTRIBUTORS[name] != null) { + attr = ATTRIBUTE_ATTRIBUTORS[name]; + formats[attr.attrName] = attr.value(node); + } + if (STYLE_ATTRIBUTORS[name] != null) { + attr = STYLE_ATTRIBUTORS[name]; + formats[attr.attrName] = attr.value(node); + } + }); + if (Object.keys(formats).length > 0) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats)); + } + return delta; + } + + function matchBlot(node, delta) { + var match = _parchment2.default.query(node); + if (match == null) return delta; + if (match.prototype instanceof _parchment2.default.Embed) { + var embed = {}; + var value = match.value(node); + if (value != null) { + embed[match.blotName] = value; + delta = new _quillDelta2.default().insert(embed, match.formats(node)); + } + } else if (typeof match.formats === 'function') { + var formats = _defineProperty({}, match.blotName, match.formats(node)); + delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats)); + } + return delta; + } + + function matchBreak(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + delta.insert('\n'); + } + return delta; + } + + function matchIgnore() { + return new _quillDelta2.default(); + } + + function matchNewline(node, delta) { + if (isLine(node) && !deltaEndsWith(delta, '\n')) { + delta.insert('\n'); + } + return delta; + } + + function matchSpacing(node, delta) { + if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { + var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); + if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { + delta.insert('\n'); + } + } + return delta; + } + + function matchStyles(node, delta) { + var formats = {}; + var style = node.style || {}; + if (style.fontWeight && computeStyle(node).fontWeight === 'bold') { + formats.bold = true; + } + if (Object.keys(formats).length > 0) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats)); + } + if (parseFloat(style.textIndent || 0) > 0) { + // Could be 0.5in + delta = new _quillDelta2.default().insert('\t').concat(delta); + } + return delta; + } + + function matchText(node, delta) { + var text = node.data; + // Word represents empty line with   + if (node.parentNode.tagName === 'O:P') { + return delta.insert(text.trim()); + } + if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { + // eslint-disable-next-line func-style + var replacer = function replacer(collapse, match) { + match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; + return match.length < 1 && collapse ? ' ' : match; + }; + text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); + text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace + if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { + text = text.replace(/^\s+/, replacer.bind(replacer, false)); + } + if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { + text = text.replace(/\s+$/, replacer.bind(replacer, false)); + } + } + return delta.insert(text); + } + + exports.default = Clipboard; + exports.matchAttributor = matchAttributor; + exports.matchBlot = matchBlot; + exports.matchNewline = matchNewline; + exports.matchSpacing = matchSpacing; + exports.matchText = matchText; + +/***/ }, +/* 49 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['right', 'center', 'justify'] + }; + + var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); + var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); + var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); + + exports.AlignAttribute = AlignAttribute; + exports.AlignClass = AlignClass; + exports.AlignStyle = AlignStyle; + +/***/ }, +/* 50 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.BackgroundStyle = exports.BackgroundClass = undefined; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _color = __webpack_require__(51); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { + scope: _parchment2.default.Scope.INLINE + }); + var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { + scope: _parchment2.default.Scope.INLINE + }); + + exports.BackgroundClass = BackgroundClass; + exports.BackgroundStyle = BackgroundStyle; + +/***/ }, +/* 51 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var ColorAttributor = function (_Parchment$Attributor) { + _inherits(ColorAttributor, _Parchment$Attributor); + + function ColorAttributor() { + _classCallCheck(this, ColorAttributor); + + return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); + } + + _createClass(ColorAttributor, [{ + key: 'value', + value: function value(domNode) { + var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); + if (!value.startsWith('rgb(')) return value; + value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); + return '#' + value.split(',').map(function (component) { + return ('00' + parseInt(component).toString(16)).slice(-2); + }).join(''); + } + }]); + + return ColorAttributor; + }(_parchment2.default.Attributor.Style); + + var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { + scope: _parchment2.default.Scope.INLINE + }); + var ColorStyle = new ColorAttributor('color', 'color', { + scope: _parchment2.default.Scope.INLINE + }); + + exports.ColorAttributor = ColorAttributor; + exports.ColorClass = ColorClass; + exports.ColorStyle = ColorStyle; + +/***/ }, +/* 52 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['rtl'] + }; + + var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); + var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); + var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); + + exports.DirectionAttribute = DirectionAttribute; + exports.DirectionClass = DirectionClass; + exports.DirectionStyle = DirectionStyle; + +/***/ }, +/* 53 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FontClass = exports.FontStyle = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var config = { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['serif', 'monospace'] + }; + + var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); + + var FontStyleAttributor = function (_Parchment$Attributor) { + _inherits(FontStyleAttributor, _Parchment$Attributor); + + function FontStyleAttributor() { + _classCallCheck(this, FontStyleAttributor); + + return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); + } + + _createClass(FontStyleAttributor, [{ + key: 'value', + value: function value(node) { + return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); + } + }]); + + return FontStyleAttributor; + }(_parchment2.default.Attributor.Style); + + var FontStyle = new FontStyleAttributor('font', 'font-family', config); + + exports.FontStyle = FontStyle; + exports.FontClass = FontClass; + +/***/ }, +/* 54 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.SizeStyle = exports.SizeClass = undefined; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['small', 'large', 'huge'] + }); + var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['10px', '18px', '32px'] + }); + + exports.SizeClass = SizeClass; + exports.SizeStyle = SizeStyle; + +/***/ }, +/* 55 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getLastChangeIndex = exports.default = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _quill = __webpack_require__(18); + + var _quill2 = _interopRequireDefault(_quill); + + var _module = __webpack_require__(43); + + var _module2 = _interopRequireDefault(_module); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var History = function (_Module) { + _inherits(History, _Module); + + function History(quill, options) { + _classCallCheck(this, History); + + var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); + + _this.lastRecorded = 0; + _this.ignoreChange = false; + _this.clear(); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { + if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; + if (!_this.options.userOnly || source === _quill2.default.sources.USER) { + _this.record(delta, oldDelta); + } else { + _this.transform(delta); + } + }); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); + if (/Win/i.test(navigator.platform)) { + _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); + } + return _this; + } + + _createClass(History, [{ + key: 'change', + value: function change(source, dest) { + if (this.stack[source].length === 0) return; + var delta = this.stack[source].pop(); + this.lastRecorded = 0; + this.ignoreChange = true; + this.quill.updateContents(delta[source], _quill2.default.sources.USER); + this.ignoreChange = false; + var index = getLastChangeIndex(delta[source]); + this.quill.setSelection(index); + this.quill.selection.scrollIntoView(); + this.stack[dest].push(delta); + } + }, { + key: 'clear', + value: function clear() { + this.stack = { undo: [], redo: [] }; + } + }, { + key: 'record', + value: function record(changeDelta, oldDelta) { + if (changeDelta.ops.length === 0) return; + this.stack.redo = []; + var undoDelta = this.quill.getContents().diff(oldDelta); + var timestamp = Date.now(); + if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { + var delta = this.stack.undo.pop(); + undoDelta = undoDelta.compose(delta.undo); + changeDelta = delta.redo.compose(changeDelta); + } else { + this.lastRecorded = timestamp; + } + this.stack.undo.push({ + redo: changeDelta, + undo: undoDelta + }); + if (this.stack.undo.length > this.options.maxStack) { + this.stack.undo.shift(); + } + } + }, { + key: 'redo', + value: function redo() { + this.change('redo', 'undo'); + } + }, { + key: 'transform', + value: function transform(delta) { + this.stack.undo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + this.stack.redo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + } + }, { + key: 'undo', + value: function undo() { + this.change('undo', 'redo'); + } + }]); + + return History; + }(_module2.default); + + History.DEFAULTS = { + delay: 1000, + maxStack: 100, + userOnly: false + }; + + function endsWithNewlineChange(delta) { + var lastOp = delta.ops[delta.ops.length - 1]; + if (lastOp == null) return false; + if (lastOp.insert != null) { + return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); + } + if (lastOp.attributes != null) { + return Object.keys(lastOp.attributes).some(function (attr) { + return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; + }); + } + return false; + } + + function getLastChangeIndex(delta) { + var deleteLength = delta.reduce(function (length, op) { + length += op.delete || 0; + return length; + }, 0); + var changeIndex = delta.length() - deleteLength; + if (endsWithNewlineChange(delta)) { + changeIndex -= 1; + } + return changeIndex; + } + + exports.default = History; + exports.getLastChangeIndex = getLastChangeIndex; + +/***/ }, +/* 56 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _clone = __webpack_require__(39); + + var _clone2 = _interopRequireDefault(_clone); + + var _deepEqual = __webpack_require__(40); + + var _deepEqual2 = _interopRequireDefault(_deepEqual); + + var _extend = __webpack_require__(30); + + var _extend2 = _interopRequireDefault(_extend); + + var _op = __webpack_require__(26); + + var _op2 = _interopRequireDefault(_op); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _quill = __webpack_require__(18); + + var _quill2 = _interopRequireDefault(_quill); + + var _logger = __webpack_require__(38); + + var _logger2 = _interopRequireDefault(_logger); + + var _module = __webpack_require__(43); + + var _module2 = _interopRequireDefault(_module); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var debug = (0, _logger2.default)('quill:keyboard'); + + var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; + + var Keyboard = function (_Module) { + _inherits(Keyboard, _Module); + + _createClass(Keyboard, null, [{ + key: 'match', + value: function match(evt, binding) { + binding = normalize(binding); + if (!!binding.shortKey !== evt[SHORTKEY] && binding.shortKey !== null) return false; + if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { + return key != SHORTKEY && !!binding[key] !== evt[key] && binding[key] !== null; + })) { + return false; + } + return binding.key === (evt.which || evt.keyCode); + } + }]); + + function Keyboard(quill, options) { + _classCallCheck(this, Keyboard); + + var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); + + _this.bindings = {}; + Object.keys(_this.options.bindings).forEach(function (name) { + if (_this.options.bindings[name]) { + _this.addBinding(_this.options.bindings[name]); + } + }); + _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); + _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^$/ }, handleDelete); + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); + if (/Trident/i.test(navigator.userAgent)) { + _this.addBinding({ key: Keyboard.keys.BACKSPACE, shortKey: true }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE, shortKey: true }, handleDelete); + } + _this.listen(); + return _this; + } + + _createClass(Keyboard, [{ + key: 'addBinding', + value: function addBinding(key) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var binding = normalize(key); + if (binding == null || binding.key == null) { + return debug.warn('Attempted to add invalid keyboard binding', binding); + } + if (typeof context === 'function') { + context = { handler: context }; + } + if (typeof handler === 'function') { + handler = { handler: handler }; + } + binding = (0, _extend2.default)(binding, context, handler); + this.bindings[binding.key] = this.bindings[binding.key] || []; + this.bindings[binding.key].push(binding); + } + }, { + key: 'listen', + value: function listen() { + var _this2 = this; + + this.quill.root.addEventListener('keydown', function (evt) { + if (evt.defaultPrevented) return; + var which = evt.which || evt.keyCode; + var bindings = (_this2.bindings[which] || []).filter(function (binding) { + return Keyboard.match(evt, binding); + }); + if (bindings.length === 0) return; + var range = _this2.quill.getSelection(); + if (range == null || !_this2.quill.hasFocus()) return; + + var _quill$scroll$line = _this2.quill.scroll.line(range.index), + _quill$scroll$line2 = _slicedToArray(_quill$scroll$line, 2), + line = _quill$scroll$line2[0], + offset = _quill$scroll$line2[1]; + + var _quill$scroll$leaf = _this2.quill.scroll.leaf(range.index), + _quill$scroll$leaf2 = _slicedToArray(_quill$scroll$leaf, 2), + leafStart = _quill$scroll$leaf2[0], + offsetStart = _quill$scroll$leaf2[1]; + + var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.scroll.leaf(range.index + range.length), + _ref2 = _slicedToArray(_ref, 2), + leafEnd = _ref2[0], + offsetEnd = _ref2[1]; + + var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; + var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; + var curContext = { + collapsed: range.length === 0, + empty: range.length === 0 && line.length() <= 1, + format: _this2.quill.getFormat(range), + offset: offset, + prefix: prefixText, + suffix: suffixText + }; + var prevented = bindings.some(function (binding) { + if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; + if (binding.empty != null && binding.empty !== curContext.empty) return false; + if (binding.offset != null && binding.offset !== curContext.offset) return false; + if (Array.isArray(binding.format)) { + // any format is present + if (binding.format.every(function (name) { + return curContext.format[name] == null; + })) { + return false; + } + } else if (_typeof(binding.format) === 'object') { + // all formats must match + if (!Object.keys(binding.format).every(function (name) { + if (binding.format[name] === true) return curContext.format[name] != null; + if (binding.format[name] === false) return curContext.format[name] == null; + return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); + })) { + return false; + } + } + if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; + if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; + return binding.handler.call(_this2, range, curContext) !== true; + }); + if (prevented) { + evt.preventDefault(); + } + }); + } + }]); + + return Keyboard; + }(_module2.default); + + Keyboard.keys = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + ESCAPE: 27, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46 + }; + + Keyboard.DEFAULTS = { + bindings: { + 'bold': makeFormatHandler('bold'), + 'italic': makeFormatHandler('italic'), + 'underline': makeFormatHandler('underline'), + 'indent': { + // highlight tab or tab at beginning of list, indent or blockquote + key: Keyboard.keys.TAB, + format: ['blockquote', 'indent', 'list'], + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '+1', _quill2.default.sources.USER); + } + }, + 'outdent': { + key: Keyboard.keys.TAB, + shiftKey: true, + format: ['blockquote', 'indent', 'list'], + // highlight tab or tab at beginning of list, indent or blockquote + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } + }, + 'outdent backspace': { + key: Keyboard.keys.BACKSPACE, + collapsed: true, + format: ['blockquote', 'indent', 'list'], + offset: 0, + handler: function handler(range, context) { + if (context.format.indent != null) { + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } else if (context.format.blockquote != null) { + this.quill.format('blockquote', false, _quill2.default.sources.USER); + } else if (context.format.list != null) { + this.quill.format('list', false, _quill2.default.sources.USER); + } + } + }, + 'indent code-block': makeCodeBlockHandler(true), + 'outdent code-block': makeCodeBlockHandler(false), + 'remove tab': { + key: Keyboard.keys.TAB, + shiftKey: true, + collapsed: true, + prefix: /\t$/, + handler: function handler(range) { + this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); + } + }, + 'tab': { + key: Keyboard.keys.TAB, + handler: function handler(range, context) { + if (!context.collapsed) { + this.quill.scroll.deleteAt(range.index, range.length); + } + this.quill.insertText(range.index, '\t', _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + } + }, + 'list empty enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['list'], + empty: true, + handler: function handler(range, context) { + this.quill.format('list', false, _quill2.default.sources.USER); + if (context.format.indent) { + this.quill.format('indent', false, _quill2.default.sources.USER); + } + } + }, + 'header enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['header'], + suffix: /^$/, + handler: function handler(range) { + this.quill.scroll.insertAt(range.index, '\n'); + this.quill.formatText(range.index + 1, 1, 'header', false, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.selection.scrollIntoView(); + } + }, + 'list autofill': { + key: ' ', + collapsed: true, + format: { list: false }, + prefix: /^(1\.|-)$/, + handler: function handler(range, context) { + var length = context.prefix.length; + this.quill.scroll.deleteAt(range.index - length, length); + this.quill.formatLine(range.index - length, 1, 'list', length === 1 ? 'bullet' : 'ordered', _quill2.default.sources.USER); + this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); + } + } + } + }; + + function handleBackspace(range, context) { + if (range.index === 0) return; + + var _quill$scroll$line3 = this.quill.scroll.line(range.index), + _quill$scroll$line4 = _slicedToArray(_quill$scroll$line3, 1), + line = _quill$scroll$line4[0]; + + var formats = {}; + if (context.offset === 0) { + var curFormats = line.formats(); + var prevFormats = this.quill.getFormat(range.index - 1, 1); + formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; + } + this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index - 1, 1, formats, _quill2.default.sources.USER); + } + this.quill.selection.scrollIntoView(); + } + + function handleDelete(range) { + if (range.index >= this.quill.getLength() - 1) return; + this.quill.deleteText(range.index, 1, _quill2.default.sources.USER); + } + + function handleDeleteRange(range) { + this.quill.deleteText(range, _quill2.default.sources.USER); + this.quill.setSelection(range.index, _quill2.default.sources.SILENT); + this.quill.selection.scrollIntoView(); + } + + function handleEnter(range, context) { + var _this3 = this; + + if (range.length > 0) { + this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change + } + var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { + if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { + lineFormats[format] = context.format[format]; + } + return lineFormats; + }, {}); + this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); + this.quill.selection.scrollIntoView(); + Object.keys(context.format).forEach(function (name) { + if (lineFormats[name] != null) return; + if (Array.isArray(context.format[name])) return; + if (name === 'link') return; + _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); + }); + } + + function makeCodeBlockHandler(indent) { + return { + key: Keyboard.keys.TAB, + shiftKey: !indent, + format: { 'code-block': true }, + handler: function handler(range) { + var CodeBlock = _parchment2.default.query('code-block'); + var index = range.index, + length = range.length; + + var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + block = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (block == null) return; + var scrollOffset = this.quill.scroll.offset(block); + var start = block.newlineIndex(offset, true) + 1; + var end = block.newlineIndex(scrollOffset + offset + length); + var lines = block.domNode.textContent.slice(start, end).split('\n'); + offset = 0; + lines.forEach(function (line, i) { + if (indent) { + block.insertAt(start + offset, CodeBlock.TAB); + offset += CodeBlock.TAB.length; + if (i === 0) { + index += CodeBlock.TAB.length; + } else { + length += CodeBlock.TAB.length; + } + } else if (line.startsWith(CodeBlock.TAB)) { + block.deleteAt(start + offset, CodeBlock.TAB.length); + offset -= CodeBlock.TAB.length; + if (i === 0) { + index -= CodeBlock.TAB.length; + } else { + length -= CodeBlock.TAB.length; + } + } + offset += line.length + 1; + }); + this.quill.update(_quill2.default.sources.USER); + this.quill.setSelection(index, length, _quill2.default.sources.SILENT); + } + }; + } + + function makeFormatHandler(format) { + return { + key: format[0].toUpperCase(), + shortKey: true, + handler: function handler(range, context) { + this.quill.format(format, !context.format[format], _quill2.default.sources.USER); + } + }; + } + + function normalize(binding) { + if (typeof binding === 'string' || typeof binding === 'number') { + return normalize({ key: binding }); + } + if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { + binding = (0, _clone2.default)(binding, false); + } + if (typeof binding.key === 'string') { + if (Keyboard.keys[binding.key.toUpperCase()] != null) { + binding.key = Keyboard.keys[binding.key.toUpperCase()]; + } else if (binding.key.length === 1) { + binding.key = binding.key.toUpperCase().charCodeAt(0); + } else { + return null; + } + } + return binding; + } + + exports.default = Keyboard; + +/***/ } +/******/ ]) +}); +; \ No newline at end of file diff -Nru bibledit-5.0.912/quill/1.1.5/quill.js bibledit-5.0.922/quill/1.1.5/quill.js --- bibledit-5.0.912/quill/1.1.5/quill.js 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.1.5/quill.js 2020-09-18 15:38:20.000000000 +0000 @@ -0,0 +1,10741 @@ +/*! + * Quill Editor v1.1.5 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["Quill"] = factory(); + else + root["Quill"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(57); + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _quill = __webpack_require__(18); + + var _quill2 = _interopRequireDefault(_quill); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + var _break = __webpack_require__(31); + + var _break2 = _interopRequireDefault(_break); + + var _container = __webpack_require__(46); + + var _container2 = _interopRequireDefault(_container); + + var _cursor = __webpack_require__(35); + + var _cursor2 = _interopRequireDefault(_cursor); + + var _embed = __webpack_require__(32); + + var _embed2 = _interopRequireDefault(_embed); + + var _inline = __webpack_require__(33); + + var _inline2 = _interopRequireDefault(_inline); + + var _scroll = __webpack_require__(47); + + var _scroll2 = _interopRequireDefault(_scroll); + + var _text = __webpack_require__(34); + + var _text2 = _interopRequireDefault(_text); + + var _clipboard = __webpack_require__(48); + + var _clipboard2 = _interopRequireDefault(_clipboard); + + var _history = __webpack_require__(55); + + var _history2 = _interopRequireDefault(_history); + + var _keyboard = __webpack_require__(56); + + var _keyboard2 = _interopRequireDefault(_keyboard); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + _quill2.default.register({ + 'blots/block': _block2.default, + 'blots/block/embed': _block.BlockEmbed, + 'blots/break': _break2.default, + 'blots/container': _container2.default, + 'blots/cursor': _cursor2.default, + 'blots/embed': _embed2.default, + 'blots/inline': _inline2.default, + 'blots/scroll': _scroll2.default, + 'blots/text': _text2.default, + + 'modules/clipboard': _clipboard2.default, + 'modules/history': _history2.default, + 'modules/keyboard': _keyboard2.default + }); + + _parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); + + module.exports = _quill2.default; + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var container_1 = __webpack_require__(3); + var format_1 = __webpack_require__(7); + var leaf_1 = __webpack_require__(12); + var scroll_1 = __webpack_require__(13); + var inline_1 = __webpack_require__(14); + var block_1 = __webpack_require__(15); + var embed_1 = __webpack_require__(16); + var text_1 = __webpack_require__(17); + var attributor_1 = __webpack_require__(8); + var class_1 = __webpack_require__(10); + var style_1 = __webpack_require__(11); + var store_1 = __webpack_require__(9); + var Registry = __webpack_require__(6); + var Parchment = { + Scope: Registry.Scope, + create: Registry.create, + find: Registry.find, + query: Registry.query, + register: Registry.register, + Container: container_1.default, + Format: format_1.default, + Leaf: leaf_1.default, + Embed: embed_1.default, + Scroll: scroll_1.default, + Block: block_1.default, + Inline: inline_1.default, + Text: text_1.default, + Attributor: { + Attribute: attributor_1.default, + Class: class_1.default, + Style: style_1.default, + Store: store_1.default + } + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Parchment; + + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var linked_list_1 = __webpack_require__(4); + var shadow_1 = __webpack_require__(5); + var Registry = __webpack_require__(6); + var ContainerBlot = (function (_super) { + __extends(ContainerBlot, _super); + function ContainerBlot() { + _super.apply(this, arguments); + } + ContainerBlot.prototype.appendChild = function (other) { + this.insertBefore(other); + }; + ContainerBlot.prototype.attach = function () { + var _this = this; + _super.prototype.attach.call(this); + this.children = new linked_list_1.default(); + // Need to be reversed for if DOM nodes already in order + [].slice.call(this.domNode.childNodes).reverse().forEach(function (node) { + try { + var child = makeBlot(node); + _this.insertBefore(child, _this.children.head); + } + catch (err) { + if (err instanceof Registry.ParchmentError) + return; + else + throw err; + } + }); + }; + ContainerBlot.prototype.deleteAt = function (index, length) { + if (index === 0 && length === this.length()) { + return this.remove(); + } + this.children.forEachAt(index, length, function (child, offset, length) { + child.deleteAt(offset, length); + }); + }; + ContainerBlot.prototype.descendant = function (criteria, index) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + return [child, offset]; + } + else if (child instanceof ContainerBlot) { + return child.descendant(criteria, offset); + } + else { + return [null, -1]; + } + }; + ContainerBlot.prototype.descendants = function (criteria, index, length) { + if (index === void 0) { index = 0; } + if (length === void 0) { length = Number.MAX_VALUE; } + var descendants = [], lengthLeft = length; + this.children.forEachAt(index, length, function (child, index, length) { + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + descendants.push(child); + } + if (child instanceof ContainerBlot) { + descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); + } + lengthLeft -= length; + }); + return descendants; + }; + ContainerBlot.prototype.detach = function () { + this.children.forEach(function (child) { + child.detach(); + }); + _super.prototype.detach.call(this); + }; + ContainerBlot.prototype.formatAt = function (index, length, name, value) { + this.children.forEachAt(index, length, function (child, offset, length) { + child.formatAt(offset, length, name, value); + }); + }; + ContainerBlot.prototype.insertAt = function (index, value, def) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if (child) { + child.insertAt(offset, value, def); + } + else { + var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def); + this.appendChild(blot); + } + }; + ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { + if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function (child) { + return childBlot instanceof child; + })) { + throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); + } + childBlot.insertInto(this, refBlot); + }; + ContainerBlot.prototype.length = function () { + return this.children.reduce(function (memo, child) { + return memo + child.length(); + }, 0); + }; + ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { + this.children.forEach(function (child) { + targetParent.insertBefore(child, refNode); + }); + }; + ContainerBlot.prototype.optimize = function () { + _super.prototype.optimize.call(this); + if (this.children.length === 0) { + if (this.statics.defaultChild != null) { + var child = Registry.create(this.statics.defaultChild); + this.appendChild(child); + child.optimize(); + } + else { + this.remove(); + } + } + }; + ContainerBlot.prototype.path = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; + var position = [[this, index]]; + if (child instanceof ContainerBlot) { + return position.concat(child.path(offset, inclusive)); + } + else if (child != null) { + position.push([child, offset]); + } + return position; + }; + ContainerBlot.prototype.removeChild = function (child) { + this.children.remove(child); + }; + ContainerBlot.prototype.replace = function (target) { + if (target instanceof ContainerBlot) { + target.moveChildren(this); + } + _super.prototype.replace.call(this, target); + }; + ContainerBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = this.clone(); + this.parent.insertBefore(after, this.next); + this.children.forEachAt(index, this.length(), function (child, offset, length) { + child = child.split(offset, force); + after.appendChild(child); + }); + return after; + }; + ContainerBlot.prototype.unwrap = function () { + this.moveChildren(this.parent, this.next); + this.remove(); + }; + ContainerBlot.prototype.update = function (mutations) { + var _this = this; + var addedNodes = [], removedNodes = []; + mutations.forEach(function (mutation) { + if (mutation.target === _this.domNode && mutation.type === 'childList') { + addedNodes.push.apply(addedNodes, mutation.addedNodes); + removedNodes.push.apply(removedNodes, mutation.removedNodes); + } + }); + removedNodes.forEach(function (node) { + if (node.parentNode != null && + (document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY)) { + // Node has not actually been removed + return; + } + var blot = Registry.find(node); + if (blot == null) + return; + if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { + blot.detach(); + } + }); + addedNodes.filter(function (node) { + return node.parentNode == _this.domNode; + }).sort(function (a, b) { + if (a === b) + return 0; + if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { + return 1; + } + return -1; + }).forEach(function (node) { + var refBlot = null; + if (node.nextSibling != null) { + refBlot = Registry.find(node.nextSibling); + } + var blot = makeBlot(node); + if (blot.next != refBlot || blot.next == null) { + if (blot.parent != null) { + blot.parent.removeChild(_this); + } + _this.insertBefore(blot, refBlot); + } + }); + }; + return ContainerBlot; + }(shadow_1.default)); + function makeBlot(node) { + var blot = Registry.find(node); + if (blot == null) { + try { + blot = Registry.create(node); + } + catch (e) { + blot = Registry.create(Registry.Scope.INLINE); + [].slice.call(node.childNodes).forEach(function (child) { + blot.domNode.appendChild(child); + }); + node.parentNode.replaceChild(blot.domNode, node); + blot.attach(); + } + } + return blot; + } + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = ContainerBlot; + + +/***/ }, +/* 4 */ +/***/ function(module, exports) { + + "use strict"; + var LinkedList = (function () { + function LinkedList() { + this.head = this.tail = undefined; + this.length = 0; + } + LinkedList.prototype.append = function () { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i - 0] = arguments[_i]; + } + this.insertBefore(nodes[0], undefined); + if (nodes.length > 1) { + this.append.apply(this, nodes.slice(1)); + } + }; + LinkedList.prototype.contains = function (node) { + var cur, next = this.iterator(); + while (cur = next()) { + if (cur === node) + return true; + } + return false; + }; + LinkedList.prototype.insertBefore = function (node, refNode) { + node.next = refNode; + if (refNode != null) { + node.prev = refNode.prev; + if (refNode.prev != null) { + refNode.prev.next = node; + } + refNode.prev = node; + if (refNode === this.head) { + this.head = node; + } + } + else if (this.tail != null) { + this.tail.next = node; + node.prev = this.tail; + this.tail = node; + } + else { + node.prev = undefined; + this.head = this.tail = node; + } + this.length += 1; + }; + LinkedList.prototype.offset = function (target) { + var index = 0, cur = this.head; + while (cur != null) { + if (cur === target) + return index; + index += cur.length(); + cur = cur.next; + } + return -1; + }; + LinkedList.prototype.remove = function (node) { + if (!this.contains(node)) + return; + if (node.prev != null) + node.prev.next = node.next; + if (node.next != null) + node.next.prev = node.prev; + if (node === this.head) + this.head = node.next; + if (node === this.tail) + this.tail = node.prev; + this.length -= 1; + }; + LinkedList.prototype.iterator = function (curNode) { + if (curNode === void 0) { curNode = this.head; } + // TODO use yield when we can + return function () { + var ret = curNode; + if (curNode != null) + curNode = curNode.next; + return ret; + }; + }; + LinkedList.prototype.find = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var cur, next = this.iterator(); + while (cur = next()) { + var length_1 = cur.length(); + if (index < length_1 || (inclusive && index === length_1 && (cur.next == null || cur.next.length() !== 0))) { + return [cur, index]; + } + index -= length_1; + } + return [null, 0]; + }; + LinkedList.prototype.forEach = function (callback) { + var cur, next = this.iterator(); + while (cur = next()) { + callback(cur); + } + }; + LinkedList.prototype.forEachAt = function (index, length, callback) { + if (length <= 0) + return; + var _a = this.find(index), startNode = _a[0], offset = _a[1]; + var cur, curIndex = index - offset, next = this.iterator(startNode); + while ((cur = next()) && curIndex < index + length) { + var curLength = cur.length(); + if (index > curIndex) { + callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); + } + else { + callback(cur, 0, Math.min(curLength, index + length - curIndex)); + } + curIndex += curLength; + } + }; + LinkedList.prototype.map = function (callback) { + return this.reduce(function (memo, cur) { + memo.push(callback(cur)); + return memo; + }, []); + }; + LinkedList.prototype.reduce = function (callback, memo) { + var cur, next = this.iterator(); + while (cur = next()) { + memo = callback(memo, cur); + } + return memo; + }; + return LinkedList; + }()); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = LinkedList; + + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var Registry = __webpack_require__(6); + var ShadowBlot = (function () { + function ShadowBlot(domNode) { + this.domNode = domNode; + this.attach(); + } + Object.defineProperty(ShadowBlot.prototype, "statics", { + // Hack for accessing inherited static methods + get: function () { + return this.constructor; + }, + enumerable: true, + configurable: true + }); + ShadowBlot.create = function (value) { + if (this.tagName == null) { + throw new Registry.ParchmentError('Blot definition missing tagName'); + } + var node; + if (Array.isArray(this.tagName)) { + if (typeof value === 'string') { + value = value.toUpperCase(); + if (parseInt(value).toString() === value) { + value = parseInt(value); + } + } + if (typeof value === 'number') { + node = document.createElement(this.tagName[value - 1]); + } + else if (this.tagName.indexOf(value) > -1) { + node = document.createElement(value); + } + else { + node = document.createElement(this.tagName[0]); + } + } + else { + node = document.createElement(this.tagName); + } + if (this.className) { + node.classList.add(this.className); + } + return node; + }; + ShadowBlot.prototype.attach = function () { + this.domNode[Registry.DATA_KEY] = { blot: this }; + }; + ShadowBlot.prototype.clone = function () { + var domNode = this.domNode.cloneNode(); + return Registry.create(domNode); + }; + ShadowBlot.prototype.detach = function () { + if (this.parent != null) + this.parent.removeChild(this); + delete this.domNode[Registry.DATA_KEY]; + }; + ShadowBlot.prototype.deleteAt = function (index, length) { + var blot = this.isolate(index, length); + blot.remove(); + }; + ShadowBlot.prototype.formatAt = function (index, length, name, value) { + var blot = this.isolate(index, length); + if (Registry.query(name, Registry.Scope.BLOT) != null && value) { + blot.wrap(name, value); + } + else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { + var parent_1 = Registry.create(this.statics.scope); + blot.wrap(parent_1); + parent_1.format(name, value); + } + }; + ShadowBlot.prototype.insertAt = function (index, value, def) { + var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def); + var ref = this.split(index); + this.parent.insertBefore(blot, ref); + }; + ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { + if (this.parent != null) { + this.parent.children.remove(this); + } + parentBlot.children.insertBefore(this, refBlot); + if (refBlot != null) { + var refDomNode = refBlot.domNode; + } + if (this.next == null || this.domNode.nextSibling != refDomNode) { + parentBlot.domNode.insertBefore(this.domNode, refDomNode); + } + this.parent = parentBlot; + }; + ShadowBlot.prototype.isolate = function (index, length) { + var target = this.split(index); + target.split(length); + return target; + }; + ShadowBlot.prototype.length = function () { + return 1; + }; + ; + ShadowBlot.prototype.offset = function (root) { + if (root === void 0) { root = this.parent; } + if (this.parent == null || this == root) + return 0; + return this.parent.children.offset(this) + this.parent.offset(root); + }; + ShadowBlot.prototype.optimize = function () { + // TODO clean up once we use WeakMap + if (this.domNode[Registry.DATA_KEY] != null) { + delete this.domNode[Registry.DATA_KEY].mutations; + } + }; + ShadowBlot.prototype.remove = function () { + if (this.domNode.parentNode != null) { + this.domNode.parentNode.removeChild(this.domNode); + } + this.detach(); + }; + ShadowBlot.prototype.replace = function (target) { + if (target.parent == null) + return; + target.parent.insertBefore(this, target.next); + target.remove(); + }; + ShadowBlot.prototype.replaceWith = function (name, value) { + var replacement = typeof name === 'string' ? Registry.create(name, value) : name; + replacement.replace(this); + return replacement; + }; + ShadowBlot.prototype.split = function (index, force) { + return index === 0 ? this : this.next; + }; + ShadowBlot.prototype.update = function (mutations) { + if (mutations === void 0) { mutations = []; } + // Nothing to do by default + }; + ShadowBlot.prototype.wrap = function (name, value) { + var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; + if (this.parent != null) { + this.parent.insertBefore(wrapper, this.next); + } + wrapper.appendChild(this); + return wrapper; + }; + ShadowBlot.blotName = 'abstract'; + return ShadowBlot; + }()); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = ShadowBlot; + + +/***/ }, +/* 6 */ +/***/ function(module, exports) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ParchmentError = (function (_super) { + __extends(ParchmentError, _super); + function ParchmentError(message) { + message = '[Parchment] ' + message; + _super.call(this, message); + this.message = message; + this.name = this.constructor.name; + } + return ParchmentError; + }(Error)); + exports.ParchmentError = ParchmentError; + var attributes = {}; + var classes = {}; + var tags = {}; + var types = {}; + exports.DATA_KEY = '__blot'; + (function (Scope) { + Scope[Scope["TYPE"] = 3] = "TYPE"; + Scope[Scope["LEVEL"] = 12] = "LEVEL"; + Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; + Scope[Scope["BLOT"] = 14] = "BLOT"; + Scope[Scope["INLINE"] = 7] = "INLINE"; + Scope[Scope["BLOCK"] = 11] = "BLOCK"; + Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; + Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; + Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; + Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; + Scope[Scope["ANY"] = 15] = "ANY"; + })(exports.Scope || (exports.Scope = {})); + var Scope = exports.Scope; + ; + function create(input, value) { + var match = query(input); + if (match == null) { + throw new ParchmentError("Unable to create " + input + " blot"); + } + var BlotClass = match; + var node = input instanceof Node ? input : BlotClass.create(value); + return new BlotClass(node, value); + } + exports.create = create; + function find(node, bubble) { + if (bubble === void 0) { bubble = false; } + if (node == null) + return null; + if (node[exports.DATA_KEY] != null) + return node[exports.DATA_KEY].blot; + if (bubble) + return find(node.parentNode, bubble); + return null; + } + exports.find = find; + function query(query, scope) { + if (scope === void 0) { scope = Scope.ANY; } + var match; + if (typeof query === 'string') { + match = types[query] || attributes[query]; + } + else if (query instanceof Text) { + match = types['text']; + } + else if (typeof query === 'number') { + if (query & Scope.LEVEL & Scope.BLOCK) { + match = types['block']; + } + else if (query & Scope.LEVEL & Scope.INLINE) { + match = types['inline']; + } + } + else if (query instanceof HTMLElement) { + var names = (query.getAttribute('class') || '').split(/\s+/); + for (var i in names) { + match = classes[names[i]]; + if (match) + break; + } + match = match || tags[query.tagName]; + } + if (match == null) { + if (query instanceof Node) { + console.log(query.nodeType); + } + } + if (match == null) + return null; + if ((scope & Scope.LEVEL & match.scope) && (scope & Scope.TYPE & match.scope)) + return match; + return null; + } + exports.query = query; + function register() { + var Definitions = []; + for (var _i = 0; _i < arguments.length; _i++) { + Definitions[_i - 0] = arguments[_i]; + } + if (Definitions.length > 1) { + return Definitions.map(function (d) { + return register(d); + }); + } + var Definition = Definitions[0]; + if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { + throw new ParchmentError('Invalid definition'); + } + else if (Definition.blotName === 'abstract') { + throw new ParchmentError('Cannot register abstract class'); + } + types[Definition.blotName || Definition.attrName] = Definition; + if (typeof Definition.keyName === 'string') { + attributes[Definition.keyName] = Definition; + } + else { + if (Definition.className != null) { + classes[Definition.className] = Definition; + } + if (Definition.tagName != null) { + if (Array.isArray(Definition.tagName)) { + Definition.tagName = Definition.tagName.map(function (tagName) { + return tagName.toUpperCase(); + }); + } + else { + Definition.tagName = Definition.tagName.toUpperCase(); + } + var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; + tagNames.forEach(function (tag) { + if (tags[tag] == null || Definition.className == null) { + tags[tag] = Definition; + } + }); + } + } + return Definition; + } + exports.register = register; + + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var attributor_1 = __webpack_require__(8); + var store_1 = __webpack_require__(9); + var container_1 = __webpack_require__(3); + var Registry = __webpack_require__(6); + var FormatBlot = (function (_super) { + __extends(FormatBlot, _super); + function FormatBlot() { + _super.apply(this, arguments); + } + FormatBlot.formats = function (domNode) { + if (typeof this.tagName === 'string') { + return true; + } + else if (Array.isArray(this.tagName)) { + return domNode.tagName.toLowerCase(); + } + return undefined; + }; + FormatBlot.prototype.attach = function () { + _super.prototype.attach.call(this); + this.attributes = new store_1.default(this.domNode); + }; + FormatBlot.prototype.format = function (name, value) { + var format = Registry.query(name); + if (format instanceof attributor_1.default) { + this.attributes.attribute(format, value); + } + else if (value) { + if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { + this.replaceWith(name, value); + } + } + }; + FormatBlot.prototype.formats = function () { + var formats = this.attributes.values(); + var format = this.statics.formats(this.domNode); + if (format != null) { + formats[this.statics.blotName] = format; + } + return formats; + }; + FormatBlot.prototype.replaceWith = function (name, value) { + var replacement = _super.prototype.replaceWith.call(this, name, value); + this.attributes.copy(replacement); + return replacement; + }; + FormatBlot.prototype.update = function (mutations) { + var _this = this; + _super.prototype.update.call(this, mutations); + if (mutations.some(function (mutation) { + return mutation.target === _this.domNode && mutation.type === 'attributes'; + })) { + this.attributes.build(); + } + }; + FormatBlot.prototype.wrap = function (name, value) { + var wrapper = _super.prototype.wrap.call(this, name, value); + if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { + this.attributes.move(wrapper); + } + return wrapper; + }; + return FormatBlot; + }(container_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = FormatBlot; + + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var Registry = __webpack_require__(6); + var Attributor = (function () { + function Attributor(attrName, keyName, options) { + if (options === void 0) { options = {}; } + this.attrName = attrName; + this.keyName = keyName; + var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; + if (options.scope != null) { + // Ignore type bits, force attribute bit + this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; + } + else { + this.scope = Registry.Scope.ATTRIBUTE; + } + if (options.whitelist != null) + this.whitelist = options.whitelist; + } + Attributor.keys = function (node) { + return [].map.call(node.attributes, function (item) { + return item.name; + }); + }; + Attributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + node.setAttribute(this.keyName, value); + return true; + }; + Attributor.prototype.canAdd = function (node, value) { + var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); + if (match != null && (this.whitelist == null || this.whitelist.indexOf(value) > -1)) { + return true; + } + return false; + }; + Attributor.prototype.remove = function (node) { + node.removeAttribute(this.keyName); + }; + Attributor.prototype.value = function (node) { + return node.getAttribute(this.keyName); + }; + return Attributor; + }()); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Attributor; + + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var attributor_1 = __webpack_require__(8); + var class_1 = __webpack_require__(10); + var style_1 = __webpack_require__(11); + var Registry = __webpack_require__(6); + var AttributorStore = (function () { + function AttributorStore(domNode) { + this.attributes = {}; + this.domNode = domNode; + this.build(); + } + AttributorStore.prototype.attribute = function (attribute, value) { + if (value) { + if (attribute.add(this.domNode, value)) { + if (attribute.value(this.domNode) != null) { + this.attributes[attribute.attrName] = attribute; + } + else { + delete this.attributes[attribute.attrName]; + } + } + } + else { + attribute.remove(this.domNode); + delete this.attributes[attribute.attrName]; + } + }; + AttributorStore.prototype.build = function () { + var _this = this; + this.attributes = {}; + var attributes = attributor_1.default.keys(this.domNode); + var classes = class_1.default.keys(this.domNode); + var styles = style_1.default.keys(this.domNode); + attributes.concat(classes).concat(styles).forEach(function (name) { + var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); + if (attr instanceof attributor_1.default) { + _this.attributes[attr.attrName] = attr; + } + }); + }; + AttributorStore.prototype.copy = function (target) { + var _this = this; + Object.keys(this.attributes).forEach(function (key) { + var value = _this.attributes[key].value(_this.domNode); + target.format(key, value); + }); + }; + AttributorStore.prototype.move = function (target) { + var _this = this; + this.copy(target); + Object.keys(this.attributes).forEach(function (key) { + _this.attributes[key].remove(_this.domNode); + }); + this.attributes = {}; + }; + AttributorStore.prototype.values = function () { + var _this = this; + return Object.keys(this.attributes).reduce(function (attributes, name) { + attributes[name] = _this.attributes[name].value(_this.domNode); + return attributes; + }, {}); + }; + return AttributorStore; + }()); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = AttributorStore; + + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var attributor_1 = __webpack_require__(8); + function match(node, prefix) { + var className = node.getAttribute('class') || ''; + return className.split(/\s+/).filter(function (name) { + return name.indexOf(prefix + "-") === 0; + }); + } + var ClassAttributor = (function (_super) { + __extends(ClassAttributor, _super); + function ClassAttributor() { + _super.apply(this, arguments); + } + ClassAttributor.keys = function (node) { + return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { + return name.split('-').slice(0, -1).join('-'); + }); + }; + ClassAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + this.remove(node); + node.classList.add(this.keyName + "-" + value); + return true; + }; + ClassAttributor.prototype.remove = function (node) { + var matches = match(node, this.keyName); + matches.forEach(function (name) { + node.classList.remove(name); + }); + if (node.classList.length === 0) { + node.removeAttribute('class'); + } + }; + ClassAttributor.prototype.value = function (node) { + var result = match(node, this.keyName)[0] || ''; + return result.slice(this.keyName.length + 1); // +1 for hyphen + }; + return ClassAttributor; + }(attributor_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = ClassAttributor; + + +/***/ }, +/* 11 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var attributor_1 = __webpack_require__(8); + function camelize(name) { + var parts = name.split('-'); + var rest = parts.slice(1).map(function (part) { + return part[0].toUpperCase() + part.slice(1); + }).join(''); + return parts[0] + rest; + } + var StyleAttributor = (function (_super) { + __extends(StyleAttributor, _super); + function StyleAttributor() { + _super.apply(this, arguments); + } + StyleAttributor.keys = function (node) { + return (node.getAttribute('style') || '').split(';').map(function (value) { + var arr = value.split(':'); + return arr[0].trim(); + }); + }; + StyleAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + node.style[camelize(this.keyName)] = value; + return true; + }; + StyleAttributor.prototype.remove = function (node) { + node.style[camelize(this.keyName)] = ''; + if (!node.getAttribute('style')) { + node.removeAttribute('style'); + } + }; + StyleAttributor.prototype.value = function (node) { + return node.style[camelize(this.keyName)]; + }; + return StyleAttributor; + }(attributor_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = StyleAttributor; + + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var shadow_1 = __webpack_require__(5); + var Registry = __webpack_require__(6); + var LeafBlot = (function (_super) { + __extends(LeafBlot, _super); + function LeafBlot() { + _super.apply(this, arguments); + } + LeafBlot.value = function (domNode) { + return true; + }; + LeafBlot.prototype.index = function (node, offset) { + if (node !== this.domNode) + return -1; + return Math.min(offset, 1); + }; + LeafBlot.prototype.position = function (index, inclusive) { + var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); + if (index > 0) + offset += 1; + return [this.parent.domNode, offset]; + }; + LeafBlot.prototype.value = function () { + return (_a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a); + var _a; + }; + LeafBlot.scope = Registry.Scope.INLINE_BLOT; + return LeafBlot; + }(shadow_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = LeafBlot; + + +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var container_1 = __webpack_require__(3); + var Registry = __webpack_require__(6); + var OBSERVER_CONFIG = { + attributes: true, + characterData: true, + characterDataOldValue: true, + childList: true, + subtree: true + }; + var MAX_OPTIMIZE_ITERATIONS = 100; + var ScrollBlot = (function (_super) { + __extends(ScrollBlot, _super); + function ScrollBlot(node) { + var _this = this; + _super.call(this, node); + this.parent = null; + this.observer = new MutationObserver(function (mutations) { + _this.update(mutations); + }); + this.observer.observe(this.domNode, OBSERVER_CONFIG); + } + ScrollBlot.prototype.detach = function () { + _super.prototype.detach.call(this); + this.observer.disconnect(); + }; + ScrollBlot.prototype.deleteAt = function (index, length) { + this.update(); + if (index === 0 && length === this.length()) { + this.children.forEach(function (child) { + child.remove(); + }); + } + else { + _super.prototype.deleteAt.call(this, index, length); + } + }; + ScrollBlot.prototype.formatAt = function (index, length, name, value) { + this.update(); + _super.prototype.formatAt.call(this, index, length, name, value); + }; + ScrollBlot.prototype.insertAt = function (index, value, def) { + this.update(); + _super.prototype.insertAt.call(this, index, value, def); + }; + ScrollBlot.prototype.optimize = function (mutations) { + var _this = this; + if (mutations === void 0) { mutations = []; } + _super.prototype.optimize.call(this); + mutations.push.apply(mutations, this.observer.takeRecords()); + // TODO use WeakMap + var mark = function (blot, markParent) { + if (markParent === void 0) { markParent = true; } + if (blot == null || blot === _this) + return; + if (blot.domNode.parentNode == null) + return; + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + blot.domNode[Registry.DATA_KEY].mutations = []; + } + if (markParent) + mark(blot.parent); + }; + var optimize = function (blot) { + if (blot.domNode[Registry.DATA_KEY] == null || blot.domNode[Registry.DATA_KEY].mutations == null) { + return; + } + if (blot instanceof container_1.default) { + blot.children.forEach(optimize); + } + blot.optimize(); + }; + var remaining = mutations; + for (var i = 0; remaining.length > 0; i += 1) { + if (i >= MAX_OPTIMIZE_ITERATIONS) { + throw new Error('[Parchment] Maximum optimize iterations reached'); + } + remaining.forEach(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return; + if (blot.domNode === mutation.target) { + if (mutation.type === 'childList') { + mark(Registry.find(mutation.previousSibling, false)); + [].forEach.call(mutation.addedNodes, function (node) { + var child = Registry.find(node, false); + mark(child, false); + if (child instanceof container_1.default) { + child.children.forEach(function (grandChild) { + mark(grandChild, false); + }); + } + }); + } + else if (mutation.type === 'attributes') { + mark(blot.prev); + } + } + mark(blot); + }); + this.children.forEach(optimize); + remaining = this.observer.takeRecords(); + mutations.push.apply(mutations, remaining); + } + }; + ScrollBlot.prototype.update = function (mutations) { + var _this = this; + mutations = mutations || this.observer.takeRecords(); + // TODO use WeakMap + mutations.map(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return; + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + blot.domNode[Registry.DATA_KEY].mutations = [mutation]; + return blot; + } + else { + blot.domNode[Registry.DATA_KEY].mutations.push(mutation); + return null; + } + }).forEach(function (blot) { + if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null) + return; + blot.update(blot.domNode[Registry.DATA_KEY].mutations || []); + }); + if (this.domNode[Registry.DATA_KEY].mutations != null) { + _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations); + } + this.optimize(mutations); + }; + ScrollBlot.blotName = 'scroll'; + ScrollBlot.defaultChild = 'block'; + ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; + ScrollBlot.tagName = 'DIV'; + return ScrollBlot; + }(container_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = ScrollBlot; + + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var format_1 = __webpack_require__(7); + var Registry = __webpack_require__(6); + // Shallow object comparison + function isEqual(obj1, obj2) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) + return false; + for (var prop in obj1) { + if (obj1[prop] !== obj2[prop]) + return false; + } + return true; + } + var InlineBlot = (function (_super) { + __extends(InlineBlot, _super); + function InlineBlot() { + _super.apply(this, arguments); + } + InlineBlot.formats = function (domNode) { + if (domNode.tagName === InlineBlot.tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + InlineBlot.prototype.format = function (name, value) { + var _this = this; + if (name === this.statics.blotName && !value) { + this.children.forEach(function (child) { + if (!(child instanceof format_1.default)) { + child = child.wrap(InlineBlot.blotName, true); + } + _this.attributes.copy(child); + }); + this.unwrap(); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + InlineBlot.prototype.formatAt = function (index, length, name, value) { + if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { + var blot = this.isolate(index, length); + blot.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + InlineBlot.prototype.optimize = function () { + _super.prototype.optimize.call(this); + var formats = this.formats(); + if (Object.keys(formats).length === 0) { + return this.unwrap(); // unformatted span + } + var next = this.next; + if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { + next.moveChildren(this); + next.remove(); + } + }; + InlineBlot.blotName = 'inline'; + InlineBlot.scope = Registry.Scope.INLINE_BLOT; + InlineBlot.tagName = 'SPAN'; + return InlineBlot; + }(format_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = InlineBlot; + + +/***/ }, +/* 15 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var format_1 = __webpack_require__(7); + var Registry = __webpack_require__(6); + var BlockBlot = (function (_super) { + __extends(BlockBlot, _super); + function BlockBlot() { + _super.apply(this, arguments); + } + BlockBlot.formats = function (domNode) { + var tagName = Registry.query(BlockBlot.blotName).tagName; + if (domNode.tagName === tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + BlockBlot.prototype.format = function (name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) == null) { + return; + } + else if (name === this.statics.blotName && !value) { + this.replaceWith(BlockBlot.blotName); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + BlockBlot.prototype.formatAt = function (index, length, name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) != null) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + BlockBlot.prototype.insertAt = function (index, value, def) { + if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { + // Insert text or inline + _super.prototype.insertAt.call(this, index, value, def); + } + else { + var after = this.split(index); + var blot = Registry.create(value, def); + after.parent.insertBefore(blot, after); + } + }; + BlockBlot.blotName = 'block'; + BlockBlot.scope = Registry.Scope.BLOCK_BLOT; + BlockBlot.tagName = 'P'; + return BlockBlot; + }(format_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = BlockBlot; + + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var leaf_1 = __webpack_require__(12); + var EmbedBlot = (function (_super) { + __extends(EmbedBlot, _super); + function EmbedBlot() { + _super.apply(this, arguments); + } + EmbedBlot.formats = function (domNode) { + return undefined; + }; + EmbedBlot.prototype.format = function (name, value) { + // super.formatAt wraps, which is what we want in general, + // but this allows subclasses to overwrite for formats + // that just apply to particular embeds + _super.prototype.formatAt.call(this, 0, this.length(), name, value); + }; + EmbedBlot.prototype.formatAt = function (index, length, name, value) { + if (index === 0 && length === this.length()) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + EmbedBlot.prototype.formats = function () { + return this.statics.formats(this.domNode); + }; + return EmbedBlot; + }(leaf_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = EmbedBlot; + + +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var leaf_1 = __webpack_require__(12); + var Registry = __webpack_require__(6); + var TextBlot = (function (_super) { + __extends(TextBlot, _super); + function TextBlot(node) { + _super.call(this, node); + this.text = this.statics.value(this.domNode); + } + TextBlot.create = function (value) { + return document.createTextNode(value); + }; + TextBlot.value = function (domNode) { + return domNode.data; + }; + TextBlot.prototype.deleteAt = function (index, length) { + this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); + }; + TextBlot.prototype.index = function (node, offset) { + if (this.domNode === node) { + return offset; + } + return -1; + }; + TextBlot.prototype.insertAt = function (index, value, def) { + if (def == null) { + this.text = this.text.slice(0, index) + value + this.text.slice(index); + this.domNode.data = this.text; + } + else { + _super.prototype.insertAt.call(this, index, value, def); + } + }; + TextBlot.prototype.length = function () { + return this.text.length; + }; + TextBlot.prototype.optimize = function () { + _super.prototype.optimize.call(this); + this.text = this.statics.value(this.domNode); + if (this.text.length === 0) { + this.remove(); + } + else if (this.next instanceof TextBlot && this.next.prev === this) { + this.insertAt(this.length(), this.next.value()); + this.next.remove(); + } + }; + TextBlot.prototype.position = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + return [this.domNode, index]; + }; + TextBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = Registry.create(this.domNode.splitText(index)); + this.parent.insertBefore(after, this.next); + this.text = this.statics.value(this.domNode); + return after; + }; + TextBlot.prototype.update = function (mutations) { + var _this = this; + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this.domNode; + })) { + this.text = this.statics.value(this.domNode); + } + }; + TextBlot.prototype.value = function () { + return this.text; + }; + TextBlot.blotName = 'text'; + TextBlot.scope = Registry.Scope.INLINE_BLOT; + return TextBlot; + }(leaf_1.default)); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = TextBlot; + + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.overload = exports.expandConfig = undefined; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + __webpack_require__(19); + + var _quillDelta = __webpack_require__(20); + + var _quillDelta2 = _interopRequireDefault(_quillDelta); + + var _editor = __webpack_require__(27); + + var _editor2 = _interopRequireDefault(_editor); + + var _emitter3 = __webpack_require__(36); + + var _emitter4 = _interopRequireDefault(_emitter3); + + var _module = __webpack_require__(43); + + var _module2 = _interopRequireDefault(_module); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _selection = __webpack_require__(44); + + var _selection2 = _interopRequireDefault(_selection); + + var _extend = __webpack_require__(30); + + var _extend2 = _interopRequireDefault(_extend); + + var _logger = __webpack_require__(38); + + var _logger2 = _interopRequireDefault(_logger); + + var _theme = __webpack_require__(45); + + var _theme2 = _interopRequireDefault(_theme); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var debug = (0, _logger2.default)('quill'); + + var Quill = function () { + _createClass(Quill, null, [{ + key: 'debug', + value: function debug(limit) { + if (limit === true) { + limit = 'log'; + } + _logger2.default.level(limit); + } + }, { + key: 'import', + value: function _import(name) { + if (this.imports[name] == null) { + debug.error('Cannot import ' + name + '. Are you sure it was registered?'); + } + return this.imports[name]; + } + }, { + key: 'register', + value: function register(path, target) { + var _this = this; + + var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (typeof path !== 'string') { + var name = path.attrName || path.blotName; + if (typeof name === 'string') { + // register(Blot | Attributor, overwrite) + this.register('formats/' + name, path, target); + } else { + Object.keys(path).forEach(function (key) { + _this.register(key, path[key], target); + }); + } + } else { + if (this.imports[path] != null && !overwrite) { + debug.warn('Overwriting ' + path + ' with', target); + } + this.imports[path] = target; + if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { + _parchment2.default.register(target); + } + } + } + }]); + + function Quill(container) { + var _this2 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Quill); + + this.options = expandConfig(container, options); + this.container = this.options.container; + if (this.container == null) { + return debug.error('Invalid Quill container', container); + } + if (this.options.debug) { + Quill.debug(this.options.debug); + } + var html = this.container.innerHTML.trim(); + this.container.classList.add('ql-container'); + this.container.innerHTML = ''; + this.root = this.addContainer('ql-editor'); + this.root.classList.add('ql-blank'); + this.emitter = new _emitter4.default(); + this.scroll = _parchment2.default.create(this.root, { + emitter: this.emitter, + whitelist: this.options.formats + }); + this.editor = new _editor2.default(this.scroll); + this.selection = new _selection2.default(this.scroll, this.emitter); + this.theme = new this.options.theme(this, this.options); + this.keyboard = this.theme.addModule('keyboard'); + this.clipboard = this.theme.addModule('clipboard'); + this.history = this.theme.addModule('history'); + this.theme.init(); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { + if (type === _emitter4.default.events.TEXT_CHANGE) { + _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { + var range = _this2.selection.lastRange; + var index = range && range.length === 0 ? range.index : undefined; + modify.call(_this2, function () { + return _this2.editor.update(null, mutations, index); + }, source); + }); + var contents = this.clipboard.convert('
    ' + html + '


    '); + this.setContents(contents); + this.history.clear(); + if (this.options.placeholder) { + this.root.setAttribute('data-placeholder', this.options.placeholder); + } + if (this.options.readOnly) { + this.disable(); + } + } + + _createClass(Quill, [{ + key: 'addContainer', + value: function addContainer(container) { + var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (typeof container === 'string') { + var className = container; + container = document.createElement('div'); + container.classList.add(className); + } + this.container.insertBefore(container, refNode); + return container; + } + }, { + key: 'blur', + value: function blur() { + this.selection.setRange(null); + } + }, { + key: 'deleteText', + value: function deleteText(index, length, source) { + var _this3 = this; + + var _overload = overload(index, length, source); + + var _overload2 = _slicedToArray(_overload, 4); + + index = _overload2[0]; + length = _overload2[1]; + source = _overload2[3]; + + return modify.call(this, function () { + return _this3.editor.deleteText(index, length); + }, source, index, -1 * length); + } + }, { + key: 'disable', + value: function disable() { + this.enable(false); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.scroll.enable(enabled); + this.container.classList.toggle('ql-disabled', !enabled); + if (!enabled) { + this.blur(); + } + } + }, { + key: 'focus', + value: function focus() { + this.selection.focus(); + this.selection.scrollIntoView(); + } + }, { + key: 'format', + value: function format(name, value) { + var _this4 = this; + + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + return modify.call(this, function () { + var range = _this4.getSelection(true); + var change = new _quillDelta2.default(); + if (range == null) { + return change; + } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); + } else if (range.length === 0) { + _this4.selection.format(name, value); + return change; + } else { + change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); + } + _this4.setSelection(range, _emitter4.default.sources.SILENT); + return change; + }, source); + } + }, { + key: 'formatLine', + value: function formatLine(index, length, name, value, source) { + var _this5 = this; + + var formats = void 0; + + var _overload3 = overload(index, length, name, value, source); + + var _overload4 = _slicedToArray(_overload3, 4); + + index = _overload4[0]; + length = _overload4[1]; + formats = _overload4[2]; + source = _overload4[3]; + + return modify.call(this, function () { + return _this5.editor.formatLine(index, length, formats); + }, source, index, 0); + } + }, { + key: 'formatText', + value: function formatText(index, length, name, value, source) { + var _this6 = this; + + var formats = void 0; + + var _overload5 = overload(index, length, name, value, source); + + var _overload6 = _slicedToArray(_overload5, 4); + + index = _overload6[0]; + length = _overload6[1]; + formats = _overload6[2]; + source = _overload6[3]; + + return modify.call(this, function () { + return _this6.editor.formatText(index, length, formats); + }, source, index, 0); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (typeof index === 'number') { + return this.selection.getBounds(index, length); + } else { + return this.selection.getBounds(index.index, index.length); + } + } + }, { + key: 'getContents', + value: function getContents() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload7 = overload(index, length); + + var _overload8 = _slicedToArray(_overload7, 2); + + index = _overload8[0]; + length = _overload8[1]; + + return this.editor.getContents(index, length); + } + }, { + key: 'getFormat', + value: function getFormat() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(); + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (typeof index === 'number') { + return this.editor.getFormat(index, length); + } else { + return this.editor.getFormat(index.index, index.length); + } + } + }, { + key: 'getLength', + value: function getLength() { + return this.scroll.length(); + } + }, { + key: 'getModule', + value: function getModule(name) { + return this.theme.modules[name]; + } + }, { + key: 'getSelection', + value: function getSelection() { + var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (focus) this.focus(); + this.update(); // Make sure we access getRange with editor in consistent state + return this.selection.getRange()[0]; + } + }, { + key: 'getText', + value: function getText() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload9 = overload(index, length); + + var _overload10 = _slicedToArray(_overload9, 2); + + index = _overload10[0]; + length = _overload10[1]; + + return this.editor.getText(index, length); + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return this.selection.hasFocus(); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + var _this7 = this; + + var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; + + return modify.call(this, function () { + return _this7.editor.insertEmbed(index, embed, value); + }, source, index); + } + }, { + key: 'insertText', + value: function insertText(index, text, name, value, source) { + var _this8 = this; + + var formats = void 0; + + var _overload11 = overload(index, 0, name, value, source); + + var _overload12 = _slicedToArray(_overload11, 4); + + index = _overload12[0]; + formats = _overload12[2]; + source = _overload12[3]; + + return modify.call(this, function () { + return _this8.editor.insertText(index, text, formats); + }, source, index, text.length); + } + }, { + key: 'isEnabled', + value: function isEnabled() { + return !this.container.classList.contains('ql-disabled'); + } + }, { + key: 'off', + value: function off() { + return this.emitter.off.apply(this.emitter, arguments); + } + }, { + key: 'on', + value: function on() { + return this.emitter.on.apply(this.emitter, arguments); + } + }, { + key: 'once', + value: function once() { + return this.emitter.once.apply(this.emitter, arguments); + } + }, { + key: 'pasteHTML', + value: function pasteHTML(index, html, source) { + this.clipboard.dangerouslyPasteHTML(index, html, source); + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length, source) { + var _this9 = this; + + var _overload13 = overload(index, length, source); + + var _overload14 = _slicedToArray(_overload13, 4); + + index = _overload14[0]; + length = _overload14[1]; + source = _overload14[3]; + + return modify.call(this, function () { + return _this9.editor.removeFormat(index, length); + }, source, index); + } + }, { + key: 'setContents', + value: function setContents(delta) { + var _this10 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + var length = _this10.getLength(); + var deleted = _this10.editor.deleteText(0, length); + var applied = _this10.editor.applyDelta(delta); + var lastOp = applied.ops[applied.ops.length - 1]; + if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { + _this10.editor.deleteText(_this10.getLength() - 1, 1); + applied.delete(1); + } + var ret = deleted.compose(applied); + return ret; + }, source); + } + }, { + key: 'setSelection', + value: function setSelection(index, length, source) { + if (index == null) { + this.selection.setRange(null, length || Quill.sources.API); + } else { + var _overload15 = overload(index, length, source); + + var _overload16 = _slicedToArray(_overload15, 4); + + index = _overload16[0]; + length = _overload16[1]; + source = _overload16[3]; + + this.selection.setRange(new _selection.Range(index, length), source); + } + this.selection.scrollIntoView(); + } + }, { + key: 'setText', + value: function setText(text) { + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + var delta = new _quillDelta2.default().insert(text); + return this.setContents(delta, source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes + this.selection.update(source); + return change; + } + }, { + key: 'updateContents', + value: function updateContents(delta) { + var _this11 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + return _this11.editor.applyDelta(delta, source); + }, source, true); + } + }]); + + return Quill; + }(); + + Quill.DEFAULTS = { + bounds: null, + formats: null, + modules: {}, + placeholder: '', + readOnly: false, + strict: true, + theme: 'default' + }; + Quill.events = _emitter4.default.events; + Quill.sources = _emitter4.default.sources; + // eslint-disable-next-line no-undef + Quill.version = false ? 'dev' : ("1.1.5"); + + Quill.imports = { + 'delta': _quillDelta2.default, + 'parchment': _parchment2.default, + 'core/module': _module2.default, + 'core/theme': _theme2.default + }; + + function expandConfig(container, userConfig) { + userConfig = (0, _extend2.default)(true, { + container: container, + modules: { + clipboard: true, + keyboard: true, + history: true + } + }, userConfig); + if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { + userConfig.theme = _theme2.default; + } else { + userConfig.theme = Quill.import('themes/' + userConfig.theme); + if (userConfig.theme == null) { + throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); + } + } + var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); + [themeConfig, userConfig].forEach(function (config) { + config.modules = config.modules || {}; + Object.keys(config.modules).forEach(function (module) { + if (config.modules[module] === true) { + config.modules[module] = {}; + } + }); + }); + var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); + var moduleConfig = moduleNames.reduce(function (config, name) { + var moduleClass = Quill.import('modules/' + name); + if (moduleClass == null) { + debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); + } else { + config[name] = moduleClass.DEFAULTS || {}; + } + return config; + }, {}); + // Special case toolbar shorthand + if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { + userConfig.modules.toolbar = { + container: userConfig.modules.toolbar + }; + } + userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); + ['bounds', 'container'].forEach(function (key) { + if (typeof userConfig[key] === 'string') { + userConfig[key] = document.querySelector(userConfig[key]); + } + }); + userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { + if (userConfig.modules[name]) { + config[name] = userConfig.modules[name]; + } + return config; + }, {}); + return userConfig; + } + + // Handle selection preservation and TEXT_CHANGE emission + // common to modification APIs + function modify(modifier, source, index, shift) { + if (!this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { + return new _quillDelta2.default(); + } + var range = index == null ? null : this.getSelection(); + var oldDelta = this.editor.delta; + var change = modifier(); + if (range != null) { + if (index === true) index = range.index; + if (shift == null) { + range = shiftRange(range, change, source); + } else if (shift !== 0) { + range = shiftRange(range, index, shift, source); + } + this.setSelection(range, _emitter4.default.sources.SILENT); + } + if (change.length() > 0) { + var _emitter; + + var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + return change; + } + + function overload(index, length, name, value, source) { + var formats = {}; + if (typeof index.index === 'number' && typeof index.length === 'number') { + // Allow for throwaway end (used by insertText/insertEmbed) + if (typeof length !== 'number') { + source = value, value = name, name = length, length = index.length, index = index.index; + } else { + length = index.length, index = index.index; + } + } else if (typeof length !== 'number') { + source = value, value = name, name = length, length = 0; + } + // Handle format being object, two format name/value strings or excluded + if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { + formats = name; + source = value; + } else if (typeof name === 'string') { + if (value != null) { + formats[name] = value; + } else { + source = name; + } + } + // Handle optional source + source = source || _emitter4.default.sources.API; + return [index, length, formats, source]; + } + + function shiftRange(range, index, length, source) { + if (range == null) return null; + var start = void 0, + end = void 0; + if (index instanceof _quillDelta2.default) { + var _map = [range.index, range.index + range.length].map(function (pos) { + return index.transformPosition(pos, source === _emitter4.default.sources.USER); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + } else { + var _map3 = [range.index, range.index + range.length].map(function (pos) { + if (pos < index || pos === index && source !== _emitter4.default.sources.USER) return pos; + if (length >= 0) { + return pos + length; + } else { + return Math.max(index, pos + length); + } + }); + + var _map4 = _slicedToArray(_map3, 2); + + start = _map4[0]; + end = _map4[1]; + } + return new _selection.Range(start, end - start); + } + + exports.expandConfig = expandConfig; + exports.overload = overload; + exports.default = Quill; + +/***/ }, +/* 19 */ +/***/ function(module, exports) { + + 'use strict'; + + var elem = document.createElement('div'); + elem.classList.toggle('test-class', false); + if (elem.classList.contains('test-class')) { + (function () { + var _toggle = DOMTokenList.prototype.toggle; + DOMTokenList.prototype.toggle = function (token, force) { + if (arguments.length > 1 && !this.contains(token) === !force) { + return force; + } else { + return _toggle.call(this, token); + } + }; + })(); + } + + if (!String.prototype.startsWith) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; + } + + if (!String.prototype.endsWith) { + String.prototype.endsWith = function (searchString, position) { + var subjectString = this.toString(); + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length; + } + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; + } + + if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, "find", { + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } + } + return undefined; + } + }); + } + + // Disable resizing in Firefox + document.addEventListener("DOMContentLoaded", function () { + document.execCommand("enableObjectResizing", false, false); + }); + +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { + + var diff = __webpack_require__(21); + var equal = __webpack_require__(22); + var extend = __webpack_require__(25); + var op = __webpack_require__(26); + + + var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() + + + var Delta = function (ops) { + // Assume we are given a well formed ops + if (Array.isArray(ops)) { + this.ops = ops; + } else if (ops != null && Array.isArray(ops.ops)) { + this.ops = ops.ops; + } else { + this.ops = []; + } + }; + + + Delta.prototype.insert = function (text, attributes) { + var newOp = {}; + if (text.length === 0) return this; + newOp.insert = text; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); + }; + + Delta.prototype['delete'] = function (length) { + if (length <= 0) return this; + return this.push({ 'delete': length }); + }; + + Delta.prototype.retain = function (length, attributes) { + if (length <= 0) return this; + var newOp = { retain: length }; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); + }; + + Delta.prototype.push = function (newOp) { + var index = this.ops.length; + var lastOp = this.ops[index - 1]; + newOp = extend(true, {}, newOp); + if (typeof lastOp === 'object') { + if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { + this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; + return this; + } + // Since it does not matter if we insert before or after deleting at the same index, + // always prefer to insert first + if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { + index -= 1; + lastOp = this.ops[index - 1]; + if (typeof lastOp !== 'object') { + this.ops.unshift(newOp); + return this; + } + } + if (equal(newOp.attributes, lastOp.attributes)) { + if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { + this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { + this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } + } + } + if (index === this.ops.length) { + this.ops.push(newOp); + } else { + this.ops.splice(index, 0, newOp); + } + return this; + }; + + Delta.prototype.filter = function (predicate) { + return this.ops.filter(predicate); + }; + + Delta.prototype.forEach = function (predicate) { + this.ops.forEach(predicate); + }; + + Delta.prototype.map = function (predicate) { + return this.ops.map(predicate); + }; + + Delta.prototype.partition = function (predicate) { + var passed = [], failed = []; + this.forEach(function(op) { + var target = predicate(op) ? passed : failed; + target.push(op); + }); + return [passed, failed]; + }; + + Delta.prototype.reduce = function (predicate, initial) { + return this.ops.reduce(predicate, initial); + }; + + Delta.prototype.chop = function () { + var lastOp = this.ops[this.ops.length - 1]; + if (lastOp && lastOp.retain && !lastOp.attributes) { + this.ops.pop(); + } + return this; + }; + + Delta.prototype.length = function () { + return this.reduce(function (length, elem) { + return length + op.length(elem); + }, 0); + }; + + Delta.prototype.slice = function (start, end) { + start = start || 0; + if (typeof end !== 'number') end = Infinity; + var ops = []; + var iter = op.iterator(this.ops); + var index = 0; + while (index < end && iter.hasNext()) { + var nextOp; + if (index < start) { + nextOp = iter.next(start - index); + } else { + nextOp = iter.next(end - index); + ops.push(nextOp); + } + index += op.length(nextOp); + } + return new Delta(ops); + }; + + + Delta.prototype.compose = function (other) { + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else if (thisIter.peekType() === 'delete') { + delta.push(thisIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (typeof otherOp.retain === 'number') { + var newOp = {}; + if (typeof thisOp.retain === 'number') { + newOp.retain = length; + } else { + newOp.insert = thisOp.insert; + } + // Preserve null when composing with a retain, otherwise remove it for inserts + var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); + if (attributes) newOp.attributes = attributes; + delta.push(newOp); + // Other op should be delete, we could be an insert or retain + // Insert + delete cancels out + } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { + delta.push(otherOp); + } + } + } + return delta.chop(); + }; + + Delta.prototype.concat = function (other) { + var delta = new Delta(this.ops.slice()); + if (other.ops.length > 0) { + delta.push(other.ops[0]); + delta.ops = delta.ops.concat(other.ops.slice(1)); + } + return delta; + }; + + Delta.prototype.diff = function (other, index) { + if (this.ops === other.ops) { + return new Delta(); + } + var strings = [this, other].map(function (delta) { + return delta.map(function (op) { + if (op.insert != null) { + return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; + } + var prep = (delta === other) ? 'on' : 'with'; + throw new Error('diff() called ' + prep + ' non-document'); + }).join(''); + }); + var delta = new Delta(); + var diffResult = diff(strings[0], strings[1], index); + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + diffResult.forEach(function (component) { + var length = component[1].length; + while (length > 0) { + var opLength = 0; + switch (component[0]) { + case diff.INSERT: + opLength = Math.min(otherIter.peekLength(), length); + delta.push(otherIter.next(opLength)); + break; + case diff.DELETE: + opLength = Math.min(length, thisIter.peekLength()); + thisIter.next(opLength); + delta['delete'](opLength); + break; + case diff.EQUAL: + opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); + var thisOp = thisIter.next(opLength); + var otherOp = otherIter.next(opLength); + if (equal(thisOp.insert, otherOp.insert)) { + delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); + } else { + delta.push(otherOp)['delete'](opLength); + } + break; + } + length -= opLength; + } + }); + return delta.chop(); + }; + + Delta.prototype.eachLine = function (predicate, newline) { + newline = newline || '\n'; + var iter = op.iterator(this.ops); + var line = new Delta(); + while (iter.hasNext()) { + if (iter.peekType() !== 'insert') return; + var thisOp = iter.peek(); + var start = op.length(thisOp) - iter.peekLength(); + var 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 { + predicate(line, iter.next(1).attributes || {}); + line = new Delta(); + } + } + if (line.length() > 0) { + predicate(line, {}); + } + }; + + Delta.prototype.transform = function (other, priority) { + priority = !!priority; + if (typeof other === 'number') { + return this.transformPosition(other, priority); + } + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { + delta.retain(op.length(thisIter.next())); + } else if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (thisOp['delete']) { + // Our delete either makes their delete redundant or removes their retain + continue; + } else if (otherOp['delete']) { + delta.push(otherOp); + } else { + // We retain either their retain or insert + delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); + } + } + } + return delta.chop(); + }; + + Delta.prototype.transformPosition = function (index, priority) { + priority = !!priority; + var thisIter = op.iterator(this.ops); + var offset = 0; + while (thisIter.hasNext() && offset <= index) { + var length = thisIter.peekLength(); + var nextType = thisIter.peekType(); + thisIter.next(); + if (nextType === 'delete') { + index -= Math.min(length, index - offset); + continue; + } else if (nextType === 'insert' && (offset < index || !priority)) { + index += length; + } + offset += length; + } + return index; + }; + + + module.exports = Delta; + + +/***/ }, +/* 21 */ +/***/ function(module, exports) { + + /** + * This library modifies the diff-patch-match library by Neil Fraser + * by removing the patch and match functionality and certain advanced + * options in the diff function. The original license is as follows: + * + * === + * + * Diff Match and Patch + * + * Copyright 2006 Google Inc. + * http://code.google.com/p/google-diff-match-patch/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + /** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ + var DIFF_DELETE = -1; + var DIFF_INSERT = 1; + var DIFF_EQUAL = 0; + + + /** + * Find the differences between two texts. Simplifies the problem by stripping + * any common prefix or suffix off the texts before diffing. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {Int} cursor_pos Expected edit position in text1 (optional) + * @return {Array} Array of diff tuples. + */ + function diff_main(text1, text2, cursor_pos) { + // Check for equality (speedup). + if (text1 == text2) { + if (text1) { + return [[DIFF_EQUAL, text1]]; + } + return []; + } + + // Check cursor_pos within bounds + if (cursor_pos < 0 || text1.length < cursor_pos) { + cursor_pos = null; + } + + // Trim off common prefix (speedup). + var commonlength = diff_commonPrefix(text1, text2); + var commonprefix = text1.substring(0, commonlength); + text1 = text1.substring(commonlength); + text2 = text2.substring(commonlength); + + // Trim off common suffix (speedup). + 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); + + // Compute the diff on the middle block. + var diffs = diff_compute_(text1, text2); + + // Restore the prefix and suffix. + if (commonprefix) { + diffs.unshift([DIFF_EQUAL, commonprefix]); + } + if (commonsuffix) { + diffs.push([DIFF_EQUAL, commonsuffix]); + } + diff_cleanupMerge(diffs); + if (cursor_pos != null) { + diffs = fix_cursor(diffs, cursor_pos); + } + return diffs; + }; + + + /** + * Find the differences between two texts. Assumes that the texts do not + * have any common prefix or suffix. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + */ + function diff_compute_(text1, text2) { + var diffs; + + if (!text1) { + // Just add some text (speedup). + return [[DIFF_INSERT, text2]]; + } + + if (!text2) { + // Just delete some text (speedup). + return [[DIFF_DELETE, text1]]; + } + + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + var i = longtext.indexOf(shorttext); + if (i != -1) { + // Shorter text is inside the longer text (speedup). + diffs = [[DIFF_INSERT, longtext.substring(0, i)], + [DIFF_EQUAL, shorttext], + [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; + // Swap insertions for deletions if diff is reversed. + if (text1.length > text2.length) { + diffs[0][0] = diffs[2][0] = DIFF_DELETE; + } + return diffs; + } + + if (shorttext.length == 1) { + // Single character string. + // After the previous speedup, the character can't be an equality. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + } + + // Check to see if the problem can be split in two. + var hm = diff_halfMatch_(text1, text2); + if (hm) { + // A half-match was found, sort out the return data. + var text1_a = hm[0]; + var text1_b = hm[1]; + var text2_a = hm[2]; + var text2_b = hm[3]; + var mid_common = hm[4]; + // Send both pairs off for separate processing. + var diffs_a = diff_main(text1_a, text2_a); + var diffs_b = diff_main(text1_b, text2_b); + // Merge the results. + return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); + } + + return diff_bisect_(text1, text2); + }; + + + /** + * Find the 'middle snake' of a diff, split the problem in two + * and return the recursively constructed diff. + * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + * @private + */ + function diff_bisect_(text1, text2) { + // Cache the text lengths to prevent multiple calls. + var text1_length = text1.length; + var text2_length = text2.length; + var max_d = Math.ceil((text1_length + text2_length) / 2); + var v_offset = max_d; + var v_length = 2 * max_d; + var v1 = new Array(v_length); + var v2 = new Array(v_length); + // Setting all elements to -1 is faster in Chrome & Firefox than mixing + // integers and undefined. + for (var x = 0; x < v_length; x++) { + v1[x] = -1; + v2[x] = -1; + } + v1[v_offset + 1] = 0; + v2[v_offset + 1] = 0; + var delta = text1_length - text2_length; + // If the total number of characters is odd, then the front path will collide + // with the reverse path. + var front = (delta % 2 != 0); + // Offsets for start and end of k loop. + // Prevents mapping of space beyond the grid. + var k1start = 0; + var k1end = 0; + var k2start = 0; + var k2end = 0; + for (var d = 0; d < max_d; d++) { + // Walk the front path one step. + for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { + var k1_offset = v_offset + k1; + var x1; + if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { + x1 = v1[k1_offset + 1]; + } else { + x1 = v1[k1_offset - 1] + 1; + } + var y1 = x1 - k1; + while (x1 < text1_length && y1 < text2_length && + text1.charAt(x1) == text2.charAt(y1)) { + x1++; + y1++; + } + v1[k1_offset] = x1; + if (x1 > text1_length) { + // Ran off the right of the graph. + k1end += 2; + } else if (y1 > text2_length) { + // Ran off the bottom of the graph. + k1start += 2; + } else if (front) { + var k2_offset = v_offset + delta - k1; + if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { + // Mirror x2 onto top-left coordinate system. + var x2 = text1_length - v2[k2_offset]; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + + // Walk the reverse path one step. + for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { + var k2_offset = v_offset + k2; + var x2; + if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { + x2 = v2[k2_offset + 1]; + } else { + x2 = v2[k2_offset - 1] + 1; + } + var y2 = x2 - k2; + while (x2 < text1_length && y2 < text2_length && + text1.charAt(text1_length - x2 - 1) == + text2.charAt(text2_length - y2 - 1)) { + x2++; + y2++; + } + v2[k2_offset] = x2; + if (x2 > text1_length) { + // Ran off the left of the graph. + k2end += 2; + } else if (y2 > text2_length) { + // Ran off the top of the graph. + 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]; + var y1 = v_offset + x1 - k1_offset; + // Mirror x2 onto top-left coordinate system. + x2 = text1_length - x2; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + } + // Diff took too long and hit the deadline or + // number of diffs equals number of characters, no commonality at all. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + }; + + + /** + * Given the location of the 'middle snake', split the diff in two parts + * and recurse. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} x Index of split point in text1. + * @param {number} y Index of split point in text2. + * @return {Array} Array of diff tuples. + */ + function diff_bisectSplit_(text1, text2, x, y) { + var text1a = text1.substring(0, x); + var text2a = text2.substring(0, y); + var text1b = text1.substring(x); + var text2b = text2.substring(y); + + // Compute both diffs serially. + var diffs = diff_main(text1a, text2a); + var diffsb = diff_main(text1b, text2b); + + return diffs.concat(diffsb); + }; + + + /** + * Determine the common prefix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the start of each + * string. + */ + function diff_commonPrefix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerstart = 0; + while (pointermin < pointermid) { + if (text1.substring(pointerstart, pointermid) == + text2.substring(pointerstart, pointermid)) { + pointermin = pointermid; + pointerstart = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; + }; + + + /** + * Determine the common suffix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of each string. + */ + function diff_commonSuffix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || + text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerend = 0; + while (pointermin < pointermid) { + if (text1.substring(text1.length - pointermid, text1.length - pointerend) == + text2.substring(text2.length - pointermid, text2.length - pointerend)) { + pointermin = pointermid; + pointerend = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; + }; + + + /** + * Do the two texts share a substring which is at least half the length of the + * longer text? + * This speedup can produce non-minimal diffs. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {Array.} Five element Array, containing the prefix of + * text1, the suffix of text1, the prefix of text2, the suffix of + * text2 and the common middle. Or null if there was no match. + */ + function diff_halfMatch_(text1, text2) { + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { + return null; // Pointless. + } + + /** + * Does a substring of shorttext exist within longtext such that the substring + * is at least half the length of longtext? + * Closure, but does not reference any external variables. + * @param {string} longtext Longer string. + * @param {string} shorttext Shorter string. + * @param {number} i Start index of quarter length substring within longtext. + * @return {Array.} Five element Array, containing the prefix of + * longtext, the suffix of longtext, the prefix of shorttext, the suffix + * of shorttext and the common middle. Or null if there was no match. + * @private + */ + function diff_halfMatchI_(longtext, shorttext, i) { + // Start with a 1/4 length substring at position i as a seed. + var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); + var j = -1; + var best_common = ''; + var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; + while ((j = shorttext.indexOf(seed, j + 1)) != -1) { + var prefixLength = diff_commonPrefix(longtext.substring(i), + shorttext.substring(j)); + var suffixLength = diff_commonSuffix(longtext.substring(0, i), + shorttext.substring(0, j)); + if (best_common.length < suffixLength + prefixLength) { + best_common = shorttext.substring(j - suffixLength, j) + + shorttext.substring(j, j + prefixLength); + best_longtext_a = longtext.substring(0, i - suffixLength); + best_longtext_b = longtext.substring(i + prefixLength); + best_shorttext_a = shorttext.substring(0, j - suffixLength); + best_shorttext_b = shorttext.substring(j + prefixLength); + } + } + if (best_common.length * 2 >= longtext.length) { + return [best_longtext_a, best_longtext_b, + best_shorttext_a, best_shorttext_b, best_common]; + } else { + return null; + } + } + + // First check if the second quarter is the seed for a half-match. + var hm1 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 4)); + // Check again based on the third quarter. + var hm2 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 2)); + var hm; + if (!hm1 && !hm2) { + return null; + } else if (!hm2) { + hm = hm1; + } else if (!hm1) { + hm = hm2; + } else { + // Both matched. Select the longest. + hm = hm1[4].length > hm2[4].length ? hm1 : hm2; + } + + // A half-match was found, sort out the return data. + var text1_a, text1_b, text2_a, text2_b; + if (text1.length > text2.length) { + text1_a = hm[0]; + text1_b = hm[1]; + text2_a = hm[2]; + text2_b = hm[3]; + } else { + 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]; + }; + + + /** + * Reorder and merge like edit sections. Merge equalities. + * Any edit section can move as long as it doesn't cross an equality. + * @param {Array} diffs Array of diff tuples. + */ + function diff_cleanupMerge(diffs) { + diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. + var pointer = 0; + var count_delete = 0; + var count_insert = 0; + var text_delete = ''; + var text_insert = ''; + var commonlength; + while (pointer < diffs.length) { + 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: + // Upon reaching an equality, check for prior redundancies. + if (count_delete + count_insert > 1) { + if (count_delete !== 0 && count_insert !== 0) { + // Factor out any common prefixies. + commonlength = diff_commonPrefix(text_insert, text_delete); + if (commonlength !== 0) { + if ((pointer - count_delete - count_insert) > 0 && + diffs[pointer - count_delete - count_insert - 1][0] == + DIFF_EQUAL) { + diffs[pointer - count_delete - count_insert - 1][1] += + text_insert.substring(0, commonlength); + } else { + diffs.splice(0, 0, [DIFF_EQUAL, + text_insert.substring(0, commonlength)]); + pointer++; + } + text_insert = text_insert.substring(commonlength); + text_delete = text_delete.substring(commonlength); + } + // Factor out any common suffixies. + commonlength = diff_commonSuffix(text_insert, text_delete); + if (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); + } + } + // Delete the offending records and add the merged ones. + if (count_delete === 0) { + diffs.splice(pointer - count_insert, + count_delete + count_insert, [DIFF_INSERT, text_insert]); + } else if (count_insert === 0) { + diffs.splice(pointer - count_delete, + count_delete + count_insert, [DIFF_DELETE, text_delete]); + } else { + diffs.splice(pointer - count_delete - count_insert, + count_delete + count_insert, [DIFF_DELETE, text_delete], + [DIFF_INSERT, text_insert]); + } + pointer = pointer - count_delete - count_insert + + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; + } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { + // Merge this equality with the previous one. + diffs[pointer - 1][1] += diffs[pointer][1]; + diffs.splice(pointer, 1); + } else { + pointer++; + } + count_insert = 0; + count_delete = 0; + text_delete = ''; + text_insert = ''; + break; + } + } + if (diffs[diffs.length - 1][1] === '') { + diffs.pop(); // Remove the dummy entry at the end. + } + + // Second pass: look for single edits surrounded on both sides by equalities + // which can be shifted sideways to eliminate an equality. + // e.g: ABAC -> ABAC + var changes = false; + pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if (diffs[pointer - 1][0] == DIFF_EQUAL && + diffs[pointer + 1][0] == DIFF_EQUAL) { + // This is a single edit surrounded by equalities. + if (diffs[pointer][1].substring(diffs[pointer][1].length - + diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { + // Shift the edit over the previous equality. + 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 = true; + } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == + diffs[pointer + 1][1]) { + // Shift the edit over the next equality. + 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 = true; + } + } + pointer++; + } + // If shifts were made, the diff needs reordering and another shift sweep. + if (changes) { + diff_cleanupMerge(diffs); + } + }; + + + var diff = diff_main; + diff.INSERT = DIFF_INSERT; + diff.DELETE = DIFF_DELETE; + diff.EQUAL = DIFF_EQUAL; + + module.exports = diff; + + /* + * Modify a diff such that the cursor position points to the start of a change: + * E.g. + * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) + * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] + * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) + * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} A tuple [cursor location in the modified diff, modified diff] + */ + function cursor_normalize_diff (diffs, cursor_pos) { + if (cursor_pos === 0) { + return [DIFF_EQUAL, diffs]; + } + for (var current_pos = 0, i = 0; i < diffs.length; i++) { + var d = diffs[i]; + if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { + var next_pos = current_pos + d[1].length; + if (cursor_pos === next_pos) { + return [i + 1, diffs]; + } else if (cursor_pos < next_pos) { + // copy to prevent side effects + diffs = diffs.slice(); + // split d into two diff changes + var split_pos = cursor_pos - current_pos; + var d_left = [d[0], d[1].slice(0, split_pos)]; + var d_right = [d[0], d[1].slice(split_pos)]; + diffs.splice(i, 1, d_left, d_right); + return [i + 1, diffs]; + } else { + current_pos = next_pos; + } + } + } + throw new Error('cursor_pos is out of bounds!') + } + + /* + * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). + * + * Case 1) + * Check if a naive shift is possible: + * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) + * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result + * Case 2) + * Check if the following shifts are possible: + * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] + * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] + * ^ ^ + * d d_next + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} Array of diff tuples + */ + function fix_cursor (diffs, cursor_pos) { + var norm = cursor_normalize_diff(diffs, cursor_pos); + var ndiffs = norm[1]; + var cursor_pointer = norm[0]; + var d = ndiffs[cursor_pointer]; + var d_next = ndiffs[cursor_pointer + 1]; + + if (d == null) { + // Text was deleted from end of original string, + // cursor is now out of bounds in new string + return diffs; + } else if (d[0] !== DIFF_EQUAL) { + // A modification happened at the cursor location. + // This is the expected outcome, so we can return the original diff. + return diffs; + } else { + if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { + // Case 1) + // It is possible to perform a naive shift + ndiffs.splice(cursor_pointer, 2, d_next, d) + return merge_tuples(ndiffs, cursor_pointer, 2) + } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { + // Case 2) + // d[1] is a prefix of d_next[1] + // We can assume that d_next[0] !== 0, since d[0] === 0 + // Shift edit locations.. + ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); + var suffix = d_next[1].slice(d[1].length); + if (suffix.length > 0) { + ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); + } + return merge_tuples(ndiffs, cursor_pointer, 3) + } else { + // Not possible to perform any modification + return diffs; + } + } + + } + + /* + * Try to merge tuples with their neigbors in a given range. + * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] + * + * @param {Array} diffs Array of diff tuples. + * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). + * @param {Int} length Number of consecutive elements to check. + * @return {Array} Array of merged diff tuples. + */ + function merge_tuples (diffs, start, length) { + // Check from (start-1) to (start+length). + for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { + if (i + 1 < diffs.length) { + var left_d = diffs[i]; + var right_d = diffs[i+1]; + if (left_d[0] === right_d[1]) { + diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); + } + } + } + return diffs; + } + + +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { + + var pSlice = Array.prototype.slice; + var objectKeys = __webpack_require__(23); + var isArguments = __webpack_require__(24); + + var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } + } + + function isUndefinedOrNull(value) { + return value === null || value === undefined; + } + + function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; + } + + function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; + } + + +/***/ }, +/* 23 */ +/***/ function(module, exports) { + + exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + + exports.shim = shim; + function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; + } + + +/***/ }, +/* 24 */ +/***/ function(module, exports) { + + var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) + })() == '[object Arguments]'; + + exports = module.exports = supportsArgumentsClass ? supported : unsupported; + + exports.supported = supported; + function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; + }; + + exports.unsupported = unsupported; + function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; + }; + + +/***/ }, +/* 25 */ +/***/ function(module, exports) { + + 'use strict'; + + var hasOwn = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + + var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; + }; + + var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) {/**/} + + return typeof key === 'undefined' || hasOwn.call(obj, key); + }; + + module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0], + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; + }; + + + +/***/ }, +/* 26 */ +/***/ function(module, exports, __webpack_require__) { + + var equal = __webpack_require__(22); + var extend = __webpack_require__(25); + + + var lib = { + attributes: { + compose: function (a, b, keepNull) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = extend(true, {}, b); + if (!keepNull) { + attributes = Object.keys(attributes).reduce(function (copy, key) { + if (attributes[key] != null) { + copy[key] = attributes[key]; + } + return copy; + }, {}); + } + for (var key in a) { + if (a[key] !== undefined && b[key] === undefined) { + attributes[key] = a[key]; + } + } + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + diff: function(a, b) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { + if (!equal(a[key], b[key])) { + attributes[key] = b[key] === undefined ? null : b[key]; + } + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + transform: function (a, b, priority) { + if (typeof a !== 'object') return b; + if (typeof b !== 'object') return undefined; + if (!priority) return b; // b simply overwrites us without priority + var attributes = Object.keys(b).reduce(function (attributes, key) { + if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + } + }, + + iterator: function (ops) { + return new Iterator(ops); + }, + + length: function (op) { + if (typeof op['delete'] === 'number') { + return op['delete']; + } else if (typeof op.retain === 'number') { + return op.retain; + } else { + return typeof op.insert === 'string' ? op.insert.length : 1; + } + } + }; + + + function Iterator(ops) { + this.ops = ops; + this.index = 0; + this.offset = 0; + }; + + Iterator.prototype.hasNext = function () { + return this.peekLength() < Infinity; + }; + + Iterator.prototype.next = function (length) { + if (!length) length = Infinity; + var nextOp = this.ops[this.index]; + if (nextOp) { + var offset = this.offset; + var opLength = lib.length(nextOp) + if (length >= opLength - offset) { + length = opLength - offset; + this.index += 1; + this.offset = 0; + } else { + this.offset += length; + } + if (typeof nextOp['delete'] === 'number') { + return { 'delete': length }; + } else { + var retOp = {}; + if (nextOp.attributes) { + retOp.attributes = nextOp.attributes; + } + if (typeof nextOp.retain === 'number') { + retOp.retain = length; + } else if (typeof nextOp.insert === 'string') { + retOp.insert = nextOp.insert.substr(offset, length); + } else { + // offset should === 0, length should === 1 + retOp.insert = nextOp.insert; + } + return retOp; + } + } else { + return { retain: Infinity }; + } + }; + + Iterator.prototype.peek = function () { + return this.ops[this.index]; + }; + + Iterator.prototype.peekLength = function () { + if (this.ops[this.index]) { + // Should never return 0 if our index is being managed correctly + return lib.length(this.ops[this.index]) - this.offset; + } else { + return Infinity; + } + }; + + Iterator.prototype.peekType = function () { + if (this.ops[this.index]) { + if (typeof this.ops[this.index]['delete'] === 'number') { + return 'delete'; + } else if (typeof this.ops[this.index].retain === 'number') { + return 'retain'; + } else { + return 'insert'; + } + } + return 'retain'; + }; + + + module.exports = lib; + + +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _quillDelta = __webpack_require__(20); + + var _quillDelta2 = _interopRequireDefault(_quillDelta); + + var _op = __webpack_require__(26); + + var _op2 = _interopRequireDefault(_op); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _code = __webpack_require__(28); + + var _code2 = _interopRequireDefault(_code); + + var _cursor = __webpack_require__(35); + + var _cursor2 = _interopRequireDefault(_cursor); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + var _clone = __webpack_require__(39); + + var _clone2 = _interopRequireDefault(_clone); + + var _deepEqual = __webpack_require__(40); + + var _deepEqual2 = _interopRequireDefault(_deepEqual); + + var _extend = __webpack_require__(30); + + var _extend2 = _interopRequireDefault(_extend); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var Editor = function () { + function Editor(scroll) { + _classCallCheck(this, Editor); + + this.scroll = scroll; + this.delta = this.getDelta(); + } + + _createClass(Editor, [{ + key: 'applyDelta', + value: function applyDelta(delta) { + var _this = this; + + var consumeNextNewline = false; + this.scroll.update(); + var scrollLength = this.scroll.length(); + this.scroll.batch = true; + delta = normalizeDelta(delta); + delta.reduce(function (index, op) { + var length = op.retain || op.delete || op.insert.length || 1; + var attributes = op.attributes || {}; + if (op.insert != null) { + if (typeof op.insert === 'string') { + var text = op.insert; + if (text.endsWith('\n') && consumeNextNewline) { + consumeNextNewline = false; + text = text.slice(0, -1); + } + if (index >= scrollLength && !text.endsWith('\n')) { + consumeNextNewline = true; + } + _this.scroll.insertAt(index, text); + + var _scroll$line = _this.scroll.line(index), + _scroll$line2 = _slicedToArray(_scroll$line, 2), + line = _scroll$line2[0], + offset = _scroll$line2[1]; + + var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); + if (line instanceof _block2.default) { + var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), + _line$descendant2 = _slicedToArray(_line$descendant, 1), + leaf = _line$descendant2[0]; + + formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); + } + attributes = _op2.default.attributes.diff(formats, attributes) || {}; + } else if (_typeof(op.insert) === 'object') { + var key = Object.keys(op.insert)[0]; // There should only be one key + if (key == null) return index; + _this.scroll.insertAt(index, key, op.insert[key]); + } + scrollLength += length; + } + Object.keys(attributes).forEach(function (name) { + _this.scroll.formatAt(index, length, name, attributes[name]); + }); + return index + length; + }, 0); + delta.reduce(function (index, op) { + if (typeof op.delete === 'number') { + _this.scroll.deleteAt(index, op.delete); + return index; + } + return index + (op.retain || op.insert.length || 1); + }, 0); + this.scroll.batch = false; + this.scroll.optimize(); + return this.update(delta); + } + }, { + key: 'deleteText', + value: function deleteText(index, length) { + this.scroll.deleteAt(index, length); + return this.update(new _quillDelta2.default().retain(index).delete(length)); + } + }, { + key: 'formatLine', + value: function formatLine(index, length) { + var _this2 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + this.scroll.update(); + Object.keys(formats).forEach(function (format) { + var lines = _this2.scroll.lines(index, Math.max(length, 1)); + var lengthRemaining = length; + lines.forEach(function (line) { + var lineLength = line.length(); + if (!(line instanceof _code2.default)) { + line.format(format, formats[format]); + } else { + var codeIndex = index - line.offset(_this2.scroll); + var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; + line.formatAt(codeIndex, codeLength, format, formats[format]); + } + lengthRemaining -= lineLength; + }); + }); + this.scroll.optimize(); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'formatText', + value: function formatText(index, length) { + var _this3 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + Object.keys(formats).forEach(function (format) { + _this3.scroll.formatAt(index, length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'getContents', + value: function getContents(index, length) { + return this.delta.slice(index, index + length); + } + }, { + key: 'getDelta', + value: function getDelta() { + return this.scroll.lines().reduce(function (delta, line) { + return delta.concat(line.delta()); + }, new _quillDelta2.default()); + } + }, { + key: 'getFormat', + value: function getFormat(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var lines = [], + leaves = []; + if (length === 0) { + this.scroll.path(index).forEach(function (path) { + var _path = _slicedToArray(path, 1), + blot = _path[0]; + + if (blot instanceof _block2.default) { + lines.push(blot); + } else if (blot instanceof _parchment2.default.Leaf) { + leaves.push(blot); + } + }); + } else { + lines = this.scroll.lines(index, length); + leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); + } + var formatsArr = [lines, leaves].map(function (blots) { + if (blots.length === 0) return {}; + var formats = (0, _block.bubbleFormats)(blots.shift()); + while (Object.keys(formats).length > 0) { + var blot = blots.shift(); + if (blot == null) return formats; + formats = combineFormats((0, _block.bubbleFormats)(blot), formats); + } + return formats; + }); + return _extend2.default.apply(_extend2.default, formatsArr); + } + }, { + key: 'getText', + value: function getText(index, length) { + return this.getContents(index, length).filter(function (op) { + return typeof op.insert === 'string'; + }).map(function (op) { + return op.insert; + }).join(''); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + this.scroll.insertAt(index, embed, value); + return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); + } + }, { + key: 'insertText', + value: function insertText(index, text) { + var _this4 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + this.scroll.insertAt(index, text); + Object.keys(formats).forEach(function (format) { + _this4.scroll.formatAt(index, text.length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); + } + }, { + key: 'isBlank', + value: function isBlank() { + if (this.scroll.children.length == 0) return true; + if (this.scroll.children.length > 1) return false; + var child = this.scroll.children.head; + return child.length() <= 1 && Object.keys(child.formats()).length == 0; + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length) { + var text = this.getText(index, length); + + var _scroll$line3 = this.scroll.line(index + length), + _scroll$line4 = _slicedToArray(_scroll$line3, 2), + line = _scroll$line4[0], + offset = _scroll$line4[1]; + + var suffixLength = 0, + suffix = new _quillDelta2.default(); + if (line != null) { + if (!(line instanceof _code2.default)) { + suffixLength = line.length() - offset; + } else { + suffixLength = line.newlineIndex(offset) - offset + 1; + } + suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); + } + var contents = this.getContents(index, length + suffixLength); + var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); + var delta = new _quillDelta2.default().retain(index).concat(diff); + return this.applyDelta(delta); + } + }, { + key: 'update', + value: function update(change) { + var _this5 = this; + + var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + + var oldDelta = this.delta; + if (mutations.length === 1 && mutations[0].type === 'characterData' && _parchment2.default.find(mutations[0].target)) { + (function () { + // Optimization for character changes + var textBlot = _parchment2.default.find(mutations[0].target); + var formats = (0, _block.bubbleFormats)(textBlot); + var index = textBlot.offset(_this5.scroll); + var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); + var oldText = new _quillDelta2.default().insert(oldValue); + var newText = new _quillDelta2.default().insert(textBlot.value()); + var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); + change = diffDelta.reduce(function (delta, op) { + if (op.insert) { + return delta.insert(op.insert, formats); + } else { + return delta.push(op); + } + }, new _quillDelta2.default()); + _this5.delta = oldDelta.compose(change); + })(); + } else { + this.delta = this.getDelta(); + if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { + change = oldDelta.diff(this.delta, cursorIndex); + } + } + return change; + } + }]); + + return Editor; + }(); + + function combineFormats(formats, combined) { + return Object.keys(combined).reduce(function (merged, name) { + if (formats[name] == null) return merged; + if (combined[name] === formats[name]) { + merged[name] = combined[name]; + } else if (Array.isArray(combined[name])) { + if (combined[name].indexOf(formats[name]) < 0) { + merged[name] = combined[name].concat([formats[name]]); + } + } else { + merged[name] = [combined[name], formats[name]]; + } + return merged; + }, {}); + } + + function normalizeDelta(delta) { + return delta.reduce(function (delta, op) { + if (op.insert === 1) { + var attributes = (0, _clone2.default)(op.attributes); + delete attributes['image']; + return delta.insert({ image: op.attributes.image }, attributes); + } + if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { + op = (0, _clone2.default)(op); + if (op.attributes.list) { + op.attributes.list = 'ordered'; + } else { + op.attributes.list = 'bullet'; + delete op.attributes.bullet; + } + } + if (typeof op.insert === 'string') { + var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + return delta.insert(text, op.attributes); + } + return delta.push(op); + }, new _quillDelta2.default()); + } + + exports.default = Editor; + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Code = undefined; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _quillDelta = __webpack_require__(20); + + var _quillDelta2 = _interopRequireDefault(_quillDelta); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + var _inline = __webpack_require__(33); + + var _inline2 = _interopRequireDefault(_inline); + + var _text = __webpack_require__(34); + + var _text2 = _interopRequireDefault(_text); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Code = function (_Inline) { + _inherits(Code, _Inline); + + function Code() { + _classCallCheck(this, Code); + + return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); + } + + return Code; + }(_inline2.default); + + Code.blotName = 'code'; + Code.tagName = 'CODE'; + + var CodeBlock = function (_Block) { + _inherits(CodeBlock, _Block); + + function CodeBlock() { + _classCallCheck(this, CodeBlock); + + return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); + } + + _createClass(CodeBlock, [{ + key: 'delta', + value: function delta() { + var _this3 = this; + + var text = this.domNode.textContent; + if (text.endsWith('\n')) { + // Should always be true + text = text.slice(0, -1); + } + return text.split('\n').reduce(function (delta, frag) { + return delta.insert(frag).insert('\n', _this3.formats()); + }, new _quillDelta2.default()); + } + }, { + key: 'format', + value: function format(name, value) { + if (name === this.statics.blotName && value) return; + + var _descendant = this.descendant(_text2.default, this.length() - 1), + _descendant2 = _slicedToArray(_descendant, 1), + text = _descendant2[0]; + + if (text != null) { + text.deleteAt(text.length() - 1, 1); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length === 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { + return; + } + var nextNewline = this.newlineIndex(index); + if (nextNewline < 0 || nextNewline >= index + length) return; + var prevNewline = this.newlineIndex(index, true) + 1; + var isolateLength = nextNewline - prevNewline + 1; + var blot = this.isolate(prevNewline, isolateLength); + var next = blot.next; + blot.format(name, value); + if (next instanceof CodeBlock) { + next.formatAt(0, index - prevNewline + length - isolateLength, name, value); + } + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return; + + var _descendant3 = this.descendant(_text2.default, index), + _descendant4 = _slicedToArray(_descendant3, 2), + text = _descendant4[0], + offset = _descendant4[1]; + + text.insertAt(offset, value); + } + }, { + key: 'length', + value: function length() { + var length = this.domNode.textContent.length; + if (!this.domNode.textContent.endsWith('\n')) { + return length + 1; + } + return length; + } + }, { + key: 'newlineIndex', + value: function newlineIndex(searchIndex) { + var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (!reverse) { + var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); + return offset > -1 ? searchIndex + offset : -1; + } else { + return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); + } + } + }, { + key: 'optimize', + value: function optimize() { + if (!this.domNode.textContent.endsWith('\n')) { + this.appendChild(_parchment2.default.create('text', '\n')); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { + next.optimize(); + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); + [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { + var blot = _parchment2.default.find(node); + if (blot == null) { + node.parentNode.removeChild(node); + } else if (blot instanceof _parchment2.default.Embed) { + blot.remove(); + } else { + blot.unwrap(); + } + }); + } + }], [{ + key: 'create', + value: function create(value) { + var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); + domNode.setAttribute('spellcheck', false); + return domNode; + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return CodeBlock; + }(_block2.default); + + CodeBlock.blotName = 'code-block'; + CodeBlock.tagName = 'PRE'; + CodeBlock.TAB = ' '; + + exports.Code = Code; + exports.default = CodeBlock; + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _extend = __webpack_require__(30); + + var _extend2 = _interopRequireDefault(_extend); + + var _quillDelta = __webpack_require__(20); + + var _quillDelta2 = _interopRequireDefault(_quillDelta); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _break = __webpack_require__(31); + + var _break2 = _interopRequireDefault(_break); + + var _embed = __webpack_require__(32); + + var _embed2 = _interopRequireDefault(_embed); + + var _inline = __webpack_require__(33); + + var _inline2 = _interopRequireDefault(_inline); + + var _text = __webpack_require__(34); + + var _text2 = _interopRequireDefault(_text); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var NEWLINE_LENGTH = 1; + + var BlockEmbed = function (_Embed) { + _inherits(BlockEmbed, _Embed); + + function BlockEmbed() { + _classCallCheck(this, BlockEmbed); + + return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); + } + + _createClass(BlockEmbed, [{ + key: 'attach', + value: function attach() { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); + this.attributes = new _parchment2.default.Attributor.Store(this.domNode); + } + }, { + key: 'delta', + value: function delta() { + return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); + } + }, { + key: 'format', + value: function format(name, value) { + var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); + if (attribute != null) { + this.attributes.attribute(attribute, value); + } + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + this.format(name, value); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (typeof value === 'string' && value.endsWith('\n')) { + var block = _parchment2.default.create(Block.blotName); + this.parent.insertBefore(block, index === 0 ? this : this.next); + block.insertAt(0, value.slice(0, -1)); + } else { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); + } + } + }]); + + return BlockEmbed; + }(_embed2.default); + + BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; + // It is important for cursor behavior BlockEmbeds use tags that are block level elements + + + var Block = function (_Parchment$Block) { + _inherits(Block, _Parchment$Block); + + function Block(domNode) { + _classCallCheck(this, Block); + + var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); + + _this2.cache = {}; + return _this2; + } + + _createClass(Block, [{ + key: 'delta', + value: function delta() { + if (this.cache.delta == null) { + this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { + if (leaf.length() === 0) { + return delta; + } else { + return delta.insert(leaf.value(), bubbleFormats(leaf)); + } + }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); + } + return this.cache.delta; + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); + this.cache = {}; + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length <= 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + if (index + length === this.length()) { + this.format(name, value); + } + } else { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); + } + this.cache = {}; + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); + if (value.length === 0) return; + var lines = value.split('\n'); + var text = lines.shift(); + if (text.length > 0) { + if (index < this.length() - 1 || this.children.tail == null) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); + } else { + this.children.tail.insertAt(this.children.tail.length(), text); + } + this.cache = {}; + } + var block = this; + lines.reduce(function (index, line) { + block = block.split(index, true); + block.insertAt(0, line); + return line.length; + }, index + text.length); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + var head = this.children.head; + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); + if (head instanceof _break2.default) { + head.remove(); + } + this.cache = {}; + } + }, { + key: 'length', + value: function length() { + if (this.cache.length == null) { + this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; + } + return this.cache.length; + } + }, { + key: 'moveChildren', + value: function moveChildren(target, ref) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); + this.cache = {}; + } + }, { + key: 'optimize', + value: function optimize() { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this); + this.cache = {}; + } + }, { + key: 'path', + value: function path(index) { + return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); + } + }, { + key: 'removeChild', + value: function removeChild(child) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); + this.cache = {}; + } + }, { + key: 'split', + value: function split(index) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { + var clone = this.clone(); + if (index === 0) { + this.parent.insertBefore(clone, this); + return this; + } else { + this.parent.insertBefore(clone, this.next); + return clone; + } + } else { + var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); + this.cache = {}; + return next; + } + } + }]); + + return Block; + }(_parchment2.default.Block); + + Block.blotName = 'block'; + Block.tagName = 'P'; + Block.defaultChild = 'break'; + Block.allowedChildren = [_inline2.default, _embed2.default, _text2.default]; + + function bubbleFormats(blot) { + var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (blot == null) return formats; + if (typeof blot.formats === 'function') { + formats = (0, _extend2.default)(formats, blot.formats()); + } + if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { + return formats; + } + return bubbleFormats(blot.parent, formats); + } + + exports.bubbleFormats = bubbleFormats; + exports.BlockEmbed = BlockEmbed; + exports.default = Block; + +/***/ }, +/* 30 */ +/***/ function(module, exports) { + + 'use strict'; + + var hasOwn = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + + var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; + }; + + var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) {/**/} + + return typeof key === 'undefined' || hasOwn.call(obj, key); + }; + + module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0], + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; + }; + + + +/***/ }, +/* 31 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _embed = __webpack_require__(32); + + var _embed2 = _interopRequireDefault(_embed); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Break = function (_Embed) { + _inherits(Break, _Embed); + + function Break() { + _classCallCheck(this, Break); + + return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); + } + + _createClass(Break, [{ + key: 'insertInto', + value: function insertInto(parent, ref) { + if (parent.children.length === 0) { + _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); + } else { + this.remove(); + } + } + }, { + key: 'length', + value: function length() { + return 0; + } + }, { + key: 'value', + value: function value() { + return ''; + } + }], [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + return Break; + }(_embed2.default); + + Break.blotName = 'break'; + Break.tagName = 'BR'; + + exports.default = Break; + +/***/ }, +/* 32 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Embed = function (_Parchment$Embed) { + _inherits(Embed, _Parchment$Embed); + + function Embed() { + _classCallCheck(this, Embed); + + return _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).apply(this, arguments)); + } + + return Embed; + }(_parchment2.default.Embed); + + exports.default = Embed; + +/***/ }, +/* 33 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _embed = __webpack_require__(32); + + var _embed2 = _interopRequireDefault(_embed); + + var _text = __webpack_require__(34); + + var _text2 = _interopRequireDefault(_text); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Inline = function (_Parchment$Inline) { + _inherits(Inline, _Parchment$Inline); + + function Inline() { + _classCallCheck(this, Inline); + + return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); + } + + _createClass(Inline, [{ + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { + var blot = this.isolate(index, length); + if (value) { + blot.wrap(name, value); + } + } else { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); + } + } + }, { + key: 'optimize', + value: function optimize() { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this); + if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { + var parent = this.parent.isolate(this.offset(), this.length()); + this.moveChildren(parent); + parent.wrap(this); + } + } + }], [{ + key: 'compare', + value: function compare(self, other) { + var selfIndex = Inline.order.indexOf(self); + var otherIndex = Inline.order.indexOf(other); + if (selfIndex >= 0 || otherIndex >= 0) { + return selfIndex - otherIndex; + } else if (self === other) { + return 0; + } else if (self < other) { + return -1; + } else { + return 1; + } + } + }]); + + return Inline; + }(_parchment2.default.Inline); + + Inline.allowedChildren = [Inline, _embed2.default, _text2.default]; + // Lower index means deeper in the DOM tree, since not found (-1) is for embeds + Inline.order = ['cursor', 'inline', // Must be lower + 'code', 'underline', 'strike', 'italic', 'bold', 'script', 'link' // Must be higher + ]; + + exports.default = Inline; + +/***/ }, +/* 34 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var TextBlot = function (_Parchment$Text) { + _inherits(TextBlot, _Parchment$Text); + + function TextBlot() { + _classCallCheck(this, TextBlot); + + return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); + } + + return TextBlot; + }(_parchment2.default.Text); + + exports.default = TextBlot; + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _embed = __webpack_require__(32); + + var _embed2 = _interopRequireDefault(_embed); + + var _text = __webpack_require__(34); + + var _text2 = _interopRequireDefault(_text); + + var _emitter = __webpack_require__(36); + + var _emitter2 = _interopRequireDefault(_emitter); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Cursor = function (_Embed) { + _inherits(Cursor, _Embed); + + _createClass(Cursor, null, [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + function Cursor(domNode, selection) { + _classCallCheck(this, Cursor); + + var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); + + _this.selection = selection; + _this.textNode = document.createTextNode(Cursor.CONTENTS); + _this.domNode.appendChild(_this.textNode); + _this._length = 0; + return _this; + } + + _createClass(Cursor, [{ + key: 'detach', + value: function detach() { + // super.detach() will also clear domNode.__blot + if (this.parent != null) this.parent.removeChild(this); + } + }, { + key: 'format', + value: function format(name, value) { + if (this._length !== 0) { + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); + } + var target = this, + index = 0; + while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { + index += target.offset(target.parent); + target = target.parent; + } + if (target != null) { + this._length = Cursor.CONTENTS.length; + target.optimize(); + target.formatAt(index, Cursor.CONTENTS.length, name, value); + this._length = 0; + } + } + }, { + key: 'index', + value: function index(node, offset) { + if (node === this.textNode) return 0; + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'length', + value: function length() { + return this._length; + } + }, { + key: 'position', + value: function position() { + return [this.textNode, this.textNode.data.length]; + } + }, { + key: 'remove', + value: function remove() { + _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); + this.parent = null; + } + }, { + key: 'restore', + value: function restore() { + var _this2 = this; + + if (this.selection.composing) return; + if (this.parent == null) return; + var textNode = this.textNode; + var range = this.selection.getNativeRange(); + var restoreText = void 0, + start = void 0, + end = void 0; + if (range != null && range.start.node === textNode && range.end.node === textNode) { + var _ref = [textNode, range.start.offset, range.end.offset]; + restoreText = _ref[0]; + start = _ref[1]; + end = _ref[2]; + } + // Link format will insert text outside of anchor tag + while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { + this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); + } + if (this.textNode.data !== Cursor.CONTENTS) { + var text = this.textNode.data.split(Cursor.CONTENTS).join(''); + if (this.next instanceof _text2.default) { + restoreText = this.next.domNode; + this.next.insertAt(0, text); + this.textNode.data = Cursor.CONTENTS; + } else { + this.textNode.data = text; + this.parent.insertBefore(_parchment2.default.create(this.textNode), this); + this.textNode = document.createTextNode(Cursor.CONTENTS); + this.domNode.appendChild(this.textNode); + } + } + this.remove(); + if (start == null) return; + this.selection.emitter.once(_emitter2.default.events.SCROLL_OPTIMIZE, function () { + var _map = [start, end].map(function (offset) { + return Math.max(0, Math.min(restoreText.data.length, offset - 1)); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + + _this2.selection.setNativeRange(restoreText, start, restoreText, end); + }); + } + }, { + key: 'update', + value: function update(mutations) { + var _this3 = this; + + mutations.forEach(function (mutation) { + if (mutation.type === 'characterData' && mutation.target === _this3.textNode) { + _this3.restore(); + } + }); + } + }, { + key: 'value', + value: function value() { + return ''; + } + }]); + + return Cursor; + }(_embed2.default); + + Cursor.blotName = 'cursor'; + Cursor.className = 'ql-cursor'; + Cursor.tagName = 'span'; + Cursor.CONTENTS = '\uFEFF'; // Zero width no break space + + + exports.default = Cursor; + +/***/ }, +/* 36 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _eventemitter = __webpack_require__(37); + + var _eventemitter2 = _interopRequireDefault(_eventemitter); + + var _logger = __webpack_require__(38); + + var _logger2 = _interopRequireDefault(_logger); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var debug = (0, _logger2.default)('quill:events'); + + var Emitter = function (_EventEmitter) { + _inherits(Emitter, _EventEmitter); + + function Emitter() { + _classCallCheck(this, Emitter); + + var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); + + _this.on('error', debug.error); + return _this; + } + + _createClass(Emitter, [{ + key: 'emit', + value: function emit() { + debug.log.apply(debug, arguments); + _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); + } + }]); + + return Emitter; + }(_eventemitter2.default); + + Emitter.events = { + EDITOR_CHANGE: 'editor-change', + SCROLL_BEFORE_UPDATE: 'scroll-before-update', + SCROLL_OPTIMIZE: 'scroll-optimize', + SCROLL_UPDATE: 'scroll-update', + SELECTION_CHANGE: 'selection-change', + TEXT_CHANGE: 'text-change' + }; + Emitter.sources = { + API: 'api', + SILENT: 'silent', + USER: 'user' + }; + + exports.default = Emitter; + +/***/ }, +/* 37 */ +/***/ function(module, exports) { + + 'use strict'; + + var has = Object.prototype.hasOwnProperty + , prefix = '~'; + + /** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @api private + */ + function Events() {} + + // + // We try to not inherit from `Object.prototype`. In some engines creating an + // instance in this way is faster than calling `Object.create(null)` directly. + // If `Object.create(null)` is not supported we prefix the event names with a + // character to make sure that the built-in object properties are not + // overridden or used as an attack vector. + // + if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; + } + + /** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {Mixed} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @api private + */ + function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; + } + + /** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @api public + */ + function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; + } + + /** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ + EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; + }; + + /** + * Return the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Boolean} exists Only check if there are listeners. + * @returns {Array|Boolean} + * @api public + */ + EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; + }; + + /** + * Calls each of the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @api public + */ + EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + 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++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (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 true; + }; + + /** + * Add a listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; + }; + + /** + * Add a one-time listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; + }; + + /** + * Remove the listeners of a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {Mixed} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn + && (!once || listeners.once) + && (!context || listeners.context === context) + ) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + + return this; + }; + + /** + * Remove all listeners, or those of the specified event. + * + * @param {String|Symbol} [event] The event name. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; + }; + + // + // Alias methods names because people roll like that. + // + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + EventEmitter.prototype.addListener = EventEmitter.prototype.on; + + // + // This function doesn't apply anymore. + // + EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; + }; + + // + // Expose the prefix. + // + EventEmitter.prefixed = prefix; + + // + // Allow `EventEmitter` to be imported as module namespace. + // + EventEmitter.EventEmitter = EventEmitter; + + // + // Expose the module. + // + if ('undefined' !== typeof module) { + module.exports = EventEmitter; + } + + +/***/ }, +/* 38 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + var levels = ['error', 'warn', 'log', 'info']; + var level = 'warn'; + + function debug(method) { + if (levels.indexOf(method) <= levels.indexOf(level)) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + console[method].apply(console, args); // eslint-disable-line no-console + } + } + + function namespace(ns) { + return levels.reduce(function (logger, method) { + logger[method] = debug.bind(console, method, ns); + return logger; + }, {}); + } + + debug.level = namespace.level = function (newLevel) { + level = newLevel; + }; + + exports.default = namespace; + +/***/ }, +/* 39 */ +/***/ function(module, exports) { + + var clone = (function() { + 'use strict'; + + var nativeMap; + try { + nativeMap = Map; + } catch(_) { + // maybe a reference error because no `Map`. Give it a dummy value that no + // value will ever be an instanceof. + nativeMap = function() {}; + } + + var nativeSet; + try { + nativeSet = Set; + } catch(_) { + nativeSet = function() {}; + } + + var nativePromise; + try { + nativePromise = Promise; + } catch(_) { + nativePromise = function() {}; + } + + /** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). + */ + function clone(parent, circular, depth, prototype) { + var filter; + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + filter = circular.filter; + circular = circular.circular; + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth === 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (parent instanceof nativeMap) { + child = new nativeMap(); + } else if (parent instanceof nativeSet) { + child = new nativeSet(); + } else if (parent instanceof nativePromise) { + child = new nativePromise(function (resolve, reject) { + parent.then(function(value) { + resolve(_clone(value, depth - 1)); + }, function(err) { + reject(_clone(err, depth - 1)); + }); + }); + } else if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + child = new Buffer(parent.length); + parent.copy(child); + return child; + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + if (parent instanceof nativeMap) { + var keyIterator = parent.keys(); + while(true) { + var next = keyIterator.next(); + if (next.done) { + break; + } + var keyChild = _clone(next.value, depth - 1); + var valueChild = _clone(parent.get(next.value), depth - 1); + child.set(keyChild, valueChild); + } + } + if (parent instanceof nativeSet) { + var iterator = parent.keys(); + while(true) { + var next = iterator.next(); + if (next.done) { + break; + } + var entryChild = _clone(next.value, depth - 1); + child.add(entryChild); + } + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(parent); + for (var i = 0; i < symbols.length; i++) { + // Don't need to worry about cloning a symbol because it is a primitive, + // like a number or string. + var symbol = symbols[i]; + child[symbol] = _clone(parent[symbol], depth - 1); + } + } + + return child; + } + + return _clone(parent, depth); + } + + /** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ + clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); + }; + + // private utility functions + + function __objToStr(o) { + return Object.prototype.toString.call(o); + } + clone.__objToStr = __objToStr; + + function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; + } + clone.__isDate = __isDate; + + function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; + } + clone.__isArray = __isArray; + + function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; + } + clone.__isRegExp = __isRegExp; + + function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; + } + clone.__getRegExpFlags = __getRegExpFlags; + + return clone; + })(); + + if (typeof module === 'object' && module.exports) { + module.exports = clone; + } + + +/***/ }, +/* 40 */ +/***/ function(module, exports, __webpack_require__) { + + var pSlice = Array.prototype.slice; + var objectKeys = __webpack_require__(41); + var isArguments = __webpack_require__(42); + + var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } + } + + function isUndefinedOrNull(value) { + return value === null || value === undefined; + } + + function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; + } + + function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; + } + + +/***/ }, +/* 41 */ +/***/ function(module, exports) { + + exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + + exports.shim = shim; + function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; + } + + +/***/ }, +/* 42 */ +/***/ function(module, exports) { + + var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) + })() == '[object Arguments]'; + + exports = module.exports = supportsArgumentsClass ? supported : unsupported; + + exports.supported = supported; + function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; + }; + + exports.unsupported = unsupported; + function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; + }; + + +/***/ }, +/* 43 */ +/***/ function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var Module = function Module(quill) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Module); + + this.quill = quill; + this.options = options; + }; + + Module.DEFAULTS = {}; + + exports.default = Module; + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Range = undefined; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _clone = __webpack_require__(39); + + var _clone2 = _interopRequireDefault(_clone); + + var _deepEqual = __webpack_require__(40); + + var _deepEqual2 = _interopRequireDefault(_deepEqual); + + var _emitter3 = __webpack_require__(36); + + var _emitter4 = _interopRequireDefault(_emitter3); + + var _logger = __webpack_require__(38); + + var _logger2 = _interopRequireDefault(_logger); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var debug = (0, _logger2.default)('quill:selection'); + + var Range = function Range(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + _classCallCheck(this, Range); + + this.index = index; + this.length = length; + }; + + var Selection = function () { + function Selection(scroll, emitter) { + var _this = this; + + _classCallCheck(this, Selection); + + this.emitter = emitter; + this.scroll = scroll; + this.composing = false; + this.root = this.scroll.domNode; + this.root.addEventListener('compositionstart', function () { + _this.composing = true; + }); + this.root.addEventListener('compositionend', function () { + _this.composing = false; + }); + this.cursor = _parchment2.default.create('cursor', this); + // savedRange is last non-null range + this.lastRange = this.savedRange = new Range(0, 0); + ['keyup', 'mouseup', 'mouseleave', 'touchend', 'touchleave', 'focus', 'blur'].forEach(function (eventName) { + _this.root.addEventListener(eventName, function () { + // When range used to be a selection and user click within the selection, + // the range now being a cursor has not updated yet without setTimeout + setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 100); + }); + }); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { + if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { + _this.update(_emitter4.default.sources.SILENT); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { + var native = _this.getNativeRange(); + if (native == null) return; + if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle + // TODO unclear if this has negative side effects + _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { + try { + _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); + } catch (ignored) {} + }); + }); + this.update(_emitter4.default.sources.SILENT); + } + + _createClass(Selection, [{ + key: 'focus', + value: function focus() { + if (this.hasFocus()) return; + var bodyTop = document.body.scrollTop; + this.root.focus(); + document.body.scrollTop = bodyTop; + this.setRange(this.savedRange); + } + }, { + key: 'format', + value: function format(_format, value) { + this.scroll.update(); + var nativeRange = this.getNativeRange(); + if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; + if (nativeRange.start.node !== this.cursor.textNode) { + var blot = _parchment2.default.find(nativeRange.start.node, false); + if (blot == null) return; + // TODO Give blot ability to not split + if (blot instanceof _parchment2.default.Leaf) { + var after = blot.split(nativeRange.start.offset); + blot.parent.insertBefore(this.cursor, after); + } else { + blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen + } + this.cursor.attach(); + } + this.cursor.format(_format, value); + this.scroll.optimize(); + this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); + this.update(); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var scrollLength = this.scroll.length(); + index = Math.min(index, scrollLength - 1); + length = Math.min(index + length, scrollLength - 1) - index; + var bounds = void 0, + node = void 0, + _scroll$leaf = this.scroll.leaf(index), + _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), + leaf = _scroll$leaf2[0], + offset = _scroll$leaf2[1]; + if (leaf == null) return null; + + var _leaf$position = leaf.position(offset, true); + + var _leaf$position2 = _slicedToArray(_leaf$position, 2); + + node = _leaf$position2[0]; + offset = _leaf$position2[1]; + + var range = document.createRange(); + if (length > 0) { + range.setStart(node, offset); + + var _scroll$leaf3 = this.scroll.leaf(index + length); + + var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); + + leaf = _scroll$leaf4[0]; + offset = _scroll$leaf4[1]; + + if (leaf == null) return null; + + var _leaf$position3 = leaf.position(offset, true); + + var _leaf$position4 = _slicedToArray(_leaf$position3, 2); + + node = _leaf$position4[0]; + offset = _leaf$position4[1]; + + range.setEnd(node, offset); + bounds = range.getBoundingClientRect(); + } else { + var side = 'left'; + var rect = void 0; + if (node instanceof Text) { + if (offset < node.data.length) { + range.setStart(node, offset); + range.setEnd(node, offset + 1); + } else { + range.setStart(node, offset - 1); + range.setEnd(node, offset); + side = 'right'; + } + rect = range.getBoundingClientRect(); + } else { + rect = leaf.domNode.getBoundingClientRect(); + if (offset > 0) side = 'right'; + } + bounds = { + height: rect.height, + left: rect[side], + width: 0, + top: rect.top + }; + } + var containerBounds = this.root.parentNode.getBoundingClientRect(); + return { + left: bounds.left - containerBounds.left, + right: bounds.left + bounds.width - containerBounds.left, + top: bounds.top - containerBounds.top, + bottom: bounds.top + bounds.height - containerBounds.top, + height: bounds.height, + width: bounds.width + }; + } + }, { + key: 'getNativeRange', + value: function getNativeRange() { + var selection = document.getSelection(); + if (selection == null || selection.rangeCount <= 0) return null; + var nativeRange = selection.getRangeAt(0); + if (nativeRange == null) return null; + if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { + return null; + } + var range = { + start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, + end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, + native: nativeRange + }; + [range.start, range.end].forEach(function (position) { + var node = position.node, + offset = position.offset; + while (!(node instanceof Text) && node.childNodes.length > 0) { + if (node.childNodes.length > offset) { + node = node.childNodes[offset]; + offset = 0; + } else if (node.childNodes.length === offset) { + node = node.lastChild; + offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; + } else { + break; + } + } + position.node = node, position.offset = offset; + }); + debug.info('getNativeRange', range); + return range; + } + }, { + key: 'getRange', + value: function getRange() { + var _this2 = this; + + var range = this.getNativeRange(); + if (range == null) return [null, null]; + var positions = [[range.start.node, range.start.offset]]; + if (!range.native.collapsed) { + positions.push([range.end.node, range.end.offset]); + } + var indexes = positions.map(function (position) { + var _position = _slicedToArray(position, 2), + node = _position[0], + offset = _position[1]; + + var blot = _parchment2.default.find(node, true); + var index = blot.offset(_this2.scroll); + if (offset === 0) { + return index; + } else if (blot instanceof _parchment2.default.Container) { + return index + blot.length(); + } else { + return index + blot.index(node, offset); + } + }); + var start = Math.min.apply(Math, _toConsumableArray(indexes)), + end = Math.max.apply(Math, _toConsumableArray(indexes)); + return [new Range(start, end - start), range]; + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return document.activeElement === this.root; + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView() { + var range = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.lastRange; + + if (range == null) return; + var bounds = this.getBounds(range.index, range.length); + if (bounds == null) return; + if (this.root.offsetHeight < bounds.bottom) { + var _scroll$line = this.scroll.line(Math.min(range.index + range.length, this.scroll.length() - 1)), + _scroll$line2 = _slicedToArray(_scroll$line, 1), + line = _scroll$line2[0]; + + this.root.scrollTop = line.domNode.offsetTop + line.domNode.offsetHeight - this.root.offsetHeight; + } else if (bounds.top < 0) { + var _scroll$line3 = this.scroll.line(Math.min(range.index, this.scroll.length() - 1)), + _scroll$line4 = _slicedToArray(_scroll$line3, 1), + _line = _scroll$line4[0]; + + this.root.scrollTop = _line.domNode.offsetTop; + } + } + }, { + key: 'setNativeRange', + value: function setNativeRange(startNode, startOffset) { + var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; + var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; + var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); + if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { + return; + } + var selection = document.getSelection(); + if (selection == null) return; + if (startNode != null) { + if (!this.hasFocus()) this.root.focus(); + var nativeRange = this.getNativeRange(); + if (nativeRange == null || force || startNode !== nativeRange.start.node || startOffset !== nativeRange.start.offset || endNode !== nativeRange.end.node || endOffset !== nativeRange.end.offset) { + var range = document.createRange(); + range.setStart(startNode, startOffset); + range.setEnd(endNode, endOffset); + selection.removeAllRanges(); + selection.addRange(range); + } + } else { + selection.removeAllRanges(); + this.root.blur(); + document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) + } + } + }, { + key: 'setRange', + value: function setRange(range) { + var _this3 = this; + + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + if (typeof force === 'string') { + source = force; + force = false; + } + debug.info('setRange', range); + if (range != null) { + (function () { + var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; + var args = []; + var scrollLength = _this3.scroll.length(); + indexes.forEach(function (index, i) { + index = Math.min(scrollLength - 1, index); + var node = void 0, + _scroll$leaf5 = _this3.scroll.leaf(index), + _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), + leaf = _scroll$leaf6[0], + offset = _scroll$leaf6[1]; + var _leaf$position5 = leaf.position(offset, i !== 0); + + var _leaf$position6 = _slicedToArray(_leaf$position5, 2); + + node = _leaf$position6[0]; + offset = _leaf$position6[1]; + + args.push(node, offset); + }); + if (args.length < 2) { + args = args.concat(args); + } + _this3.setNativeRange.apply(_this3, _toConsumableArray(args).concat([force])); + })(); + } else { + this.setNativeRange(null); + } + this.update(source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var nativeRange = void 0, + oldRange = this.lastRange; + + var _getRange = this.getRange(); + + var _getRange2 = _slicedToArray(_getRange, 2); + + this.lastRange = _getRange2[0]; + nativeRange = _getRange2[1]; + + if (this.lastRange != null) { + this.savedRange = this.lastRange; + } + if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { + var _emitter; + + if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { + this.cursor.restore(); + } + var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + } + }]); + + return Selection; + }(); + + function contains(parent, descendant) { + try { + // Firefox inserts inaccessible nodes around video elements + descendant.parentNode; + } catch (e) { + return false; + } + // IE11 has bug with Text nodes + // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect + if (descendant instanceof Text) { + descendant = descendant.parentNode; + } + return parent.contains(descendant); + } + + exports.Range = Range; + exports.default = Selection; + +/***/ }, +/* 45 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var Theme = function () { + function Theme(quill, options) { + _classCallCheck(this, Theme); + + this.quill = quill; + this.options = options; + this.modules = {}; + } + + _createClass(Theme, [{ + key: 'init', + value: function init() { + var _this = this; + + Object.keys(this.options.modules).forEach(function (name) { + if (_this.modules[name] == null) { + _this.addModule(name); + } + }); + } + }, { + key: 'addModule', + value: function addModule(name) { + var moduleClass = this.quill.constructor.import('modules/' + name); + this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); + return this.modules[name]; + } + }]); + + return Theme; + }(); + + Theme.DEFAULTS = { + modules: {} + }; + Theme.themes = { + 'default': Theme + }; + + exports.default = Theme; + +/***/ }, +/* 46 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Container = function (_Parchment$Container) { + _inherits(Container, _Parchment$Container); + + function Container() { + _classCallCheck(this, Container); + + return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); + } + + return Container; + }(_parchment2.default.Container); + + Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; + + exports.default = Container; + +/***/ }, +/* 47 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _emitter = __webpack_require__(36); + + var _emitter2 = _interopRequireDefault(_emitter); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + var _break = __webpack_require__(31); + + var _break2 = _interopRequireDefault(_break); + + var _container = __webpack_require__(46); + + var _container2 = _interopRequireDefault(_container); + + var _code = __webpack_require__(28); + + var _code2 = _interopRequireDefault(_code); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + function isLine(blot) { + return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; + } + + var Scroll = function (_Parchment$Scroll) { + _inherits(Scroll, _Parchment$Scroll); + + function Scroll(domNode, config) { + _classCallCheck(this, Scroll); + + var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); + + _this.emitter = config.emitter; + if (Array.isArray(config.whitelist)) { + _this.whitelist = config.whitelist.reduce(function (whitelist, format) { + whitelist[format] = true; + return whitelist; + }, {}); + } + _this.optimize(); + _this.enable(); + return _this; + } + + _createClass(Scroll, [{ + key: 'deleteAt', + value: function deleteAt(index, length) { + var _line = this.line(index), + _line2 = _slicedToArray(_line, 2), + first = _line2[0], + offset = _line2[1]; + + var _line3 = this.line(index + length), + _line4 = _slicedToArray(_line3, 1), + last = _line4[0]; + + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); + if (last != null && first !== last && offset > 0 && !(first instanceof _block.BlockEmbed) && !(last instanceof _block.BlockEmbed)) { + if (last instanceof _code2.default) { + last.deleteAt(last.length() - 1, 1); + } + var ref = last.children.head instanceof _break2.default ? null : last.children.head; + first.moveChildren(last, ref); + first.remove(); + } + this.optimize(); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.domNode.setAttribute('contenteditable', enabled); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, format, value) { + if (this.whitelist != null && !this.whitelist[format]) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); + this.optimize(); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null && this.whitelist != null && !this.whitelist[value]) return; + if (index >= this.length()) { + if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { + var blot = _parchment2.default.create(this.statics.defaultChild); + this.appendChild(blot); + if (def == null && value.endsWith('\n')) { + value = value.slice(0, -1); + } + blot.insertAt(0, value, def); + } else { + var embed = _parchment2.default.create(value, def); + this.appendChild(embed); + } + } else { + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); + } + this.optimize(); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { + var wrapper = _parchment2.default.create(this.statics.defaultChild); + wrapper.appendChild(blot); + blot = wrapper; + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); + } + }, { + key: 'leaf', + value: function leaf(index) { + return this.path(index).pop() || [null, -1]; + } + }, { + key: 'line', + value: function line(index) { + if (index === this.length()) { + return this.line(index - 1); + } + return this.descendant(isLine, index); + } + }, { + key: 'lines', + value: function lines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + var getLines = function getLines(blot, index, length) { + var lines = [], + lengthLeft = length; + blot.children.forEachAt(index, length, function (child, index, length) { + if (isLine(child)) { + lines.push(child); + } else if (child instanceof _parchment2.default.Container) { + lines = lines.concat(getLines(child, index, lengthLeft)); + } + lengthLeft -= length; + }); + return lines; + }; + return getLines(this, index, length); + } + }, { + key: 'optimize', + value: function optimize() { + var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + if (this.batch === true) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations); + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations); + } + } + }, { + key: 'path', + value: function path(index) { + return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self + } + }, { + key: 'update', + value: function update(mutations) { + if (this.batch === true) return; + var source = _emitter2.default.sources.USER; + if (typeof mutations === 'string') { + source = mutations; + } + if (!Array.isArray(mutations)) { + mutations = this.observer.takeRecords(); + } + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); + } + } + }]); + + return Scroll; + }(_parchment2.default.Scroll); + + Scroll.blotName = 'scroll'; + Scroll.className = 'ql-editor'; + Scroll.tagName = 'DIV'; + Scroll.defaultChild = 'block'; + Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; + + exports.default = Scroll; + +/***/ }, +/* 48 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _quillDelta = __webpack_require__(20); + + var _quillDelta2 = _interopRequireDefault(_quillDelta); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _quill = __webpack_require__(18); + + var _quill2 = _interopRequireDefault(_quill); + + var _logger = __webpack_require__(38); + + var _logger2 = _interopRequireDefault(_logger); + + var _module = __webpack_require__(43); + + var _module2 = _interopRequireDefault(_module); + + var _align = __webpack_require__(49); + + var _background = __webpack_require__(50); + + var _color = __webpack_require__(51); + + var _direction = __webpack_require__(52); + + var _font = __webpack_require__(53); + + var _size = __webpack_require__(54); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var debug = (0, _logger2.default)('quill:clipboard'); + + var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; + + var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; + }, {}); + + var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; + }, {}); + + var Clipboard = function (_Module) { + _inherits(Clipboard, _Module); + + function Clipboard(quill, options) { + _classCallCheck(this, Clipboard); + + var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); + + _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); + _this.container = _this.quill.addContainer('ql-clipboard'); + _this.container.setAttribute('contenteditable', true); + _this.container.setAttribute('tabindex', -1); + _this.matchers = []; + CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (pair) { + _this.addMatcher.apply(_this, _toConsumableArray(pair)); + }); + return _this; + } + + _createClass(Clipboard, [{ + key: 'addMatcher', + value: function addMatcher(selector, matcher) { + this.matchers.push([selector, matcher]); + } + }, { + key: 'convert', + value: function convert(html) { + var _this2 = this; + + var DOM_KEY = '__ql-matcher'; + if (typeof html === 'string') { + this.container.innerHTML = html; + } + var textMatchers = [], + elementMatchers = []; + this.matchers.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + selector = _pair[0], + matcher = _pair[1]; + + switch (selector) { + case Node.TEXT_NODE: + textMatchers.push(matcher); + break; + case Node.ELEMENT_NODE: + elementMatchers.push(matcher); + break; + default: + [].forEach.call(_this2.container.querySelectorAll(selector), function (node) { + // TODO use weakmap + node[DOM_KEY] = node[DOM_KEY] || []; + node[DOM_KEY].push(matcher); + }); + break; + } + }); + var traverse = function traverse(node) { + // Post-order + if (node.nodeType === node.TEXT_NODE) { + return textMatchers.reduce(function (delta, matcher) { + return matcher(node, delta); + }, new _quillDelta2.default()); + } else if (node.nodeType === node.ELEMENT_NODE) { + return [].reduce.call(node.childNodes || [], function (delta, childNode) { + var childrenDelta = traverse(childNode); + if (childNode.nodeType === node.ELEMENT_NODE) { + childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + } + return delta.concat(childrenDelta); + }, new _quillDelta2.default()); + } else { + return new _quillDelta2.default(); + } + }; + var delta = traverse(this.container); + // Remove trailing newline + if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); + } + debug.log('convert', this.container.innerHTML, delta); + this.container.innerHTML = ''; + return delta; + } + }, { + key: 'dangerouslyPasteHTML', + value: function dangerouslyPasteHTML(index, html) { + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; + + if (typeof index === 'string') { + return this.quill.setContents(this.convert(index), html); + } else { + var paste = this.convert(html); + return this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); + } + } + }, { + key: 'onPaste', + value: function onPaste(e) { + var _this3 = this; + + if (e.defaultPrevented || !this.quill.isEnabled()) return; + var range = this.quill.getSelection(); + var delta = new _quillDelta2.default().retain(range.index).delete(range.length); + var bodyTop = document.body.scrollTop; + this.container.focus(); + setTimeout(function () { + _this3.quill.selection.update(_quill2.default.sources.SILENT); + delta = delta.concat(_this3.convert()); + _this3.quill.updateContents(delta, _quill2.default.sources.USER); + // range.length contributes to delta.length() + _this3.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); + document.body.scrollTop = bodyTop; + _this3.quill.selection.scrollIntoView(); + }, 1); + } + }]); + + return Clipboard; + }(_module2.default); + + Clipboard.DEFAULTS = { + matchers: [] + }; + + function computeStyle(node) { + if (node.nodeType !== Node.ELEMENT_NODE) return {}; + var DOM_KEY = '__ql-computed-style'; + return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); + } + + function deltaEndsWith(delta, text) { + var endText = ""; + for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { + var op = delta.ops[i]; + if (typeof op.insert !== 'string') break; + endText = op.insert + endText; + } + return endText.slice(-1 * text.length) === text; + } + + function isLine(node) { + if (node.childNodes.length === 0) return false; // Exclude embed blocks + var style = computeStyle(node); + return ['block', 'list-item'].indexOf(style.display) > -1; + } + + function matchAlias(format, node, delta) { + return delta.compose(new _quillDelta2.default().retain(delta.length(), _defineProperty({}, format, true))); + } + + function matchAttributor(node, delta) { + var attributes = _parchment2.default.Attributor.Attribute.keys(node); + var classes = _parchment2.default.Attributor.Class.keys(node); + var styles = _parchment2.default.Attributor.Style.keys(node); + var formats = {}; + attributes.concat(classes).concat(styles).forEach(function (name) { + var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); + if (attr != null) { + formats[attr.attrName] = attr.value(node); + if (formats[attr.attrName]) return; + } + if (ATTRIBUTE_ATTRIBUTORS[name] != null) { + attr = ATTRIBUTE_ATTRIBUTORS[name]; + formats[attr.attrName] = attr.value(node); + } + if (STYLE_ATTRIBUTORS[name] != null) { + attr = STYLE_ATTRIBUTORS[name]; + formats[attr.attrName] = attr.value(node); + } + }); + if (Object.keys(formats).length > 0) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats)); + } + return delta; + } + + function matchBlot(node, delta) { + var match = _parchment2.default.query(node); + if (match == null) return delta; + if (match.prototype instanceof _parchment2.default.Embed) { + var embed = {}; + var value = match.value(node); + if (value != null) { + embed[match.blotName] = value; + delta = new _quillDelta2.default().insert(embed, match.formats(node)); + } + } else if (typeof match.formats === 'function') { + var formats = _defineProperty({}, match.blotName, match.formats(node)); + delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats)); + } + return delta; + } + + function matchBreak(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + delta.insert('\n'); + } + return delta; + } + + function matchIgnore() { + return new _quillDelta2.default(); + } + + function matchNewline(node, delta) { + if (isLine(node) && !deltaEndsWith(delta, '\n')) { + delta.insert('\n'); + } + return delta; + } + + function matchSpacing(node, delta) { + if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { + var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); + if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { + delta.insert('\n'); + } + } + return delta; + } + + function matchStyles(node, delta) { + var formats = {}; + var style = node.style || {}; + if (style.fontWeight && computeStyle(node).fontWeight === 'bold') { + formats.bold = true; + } + if (Object.keys(formats).length > 0) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats)); + } + if (parseFloat(style.textIndent || 0) > 0) { + // Could be 0.5in + delta = new _quillDelta2.default().insert('\t').concat(delta); + } + return delta; + } + + function matchText(node, delta) { + var text = node.data; + // Word represents empty line with   + if (node.parentNode.tagName === 'O:P') { + return delta.insert(text.trim()); + } + if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { + // eslint-disable-next-line func-style + var replacer = function replacer(collapse, match) { + match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; + return match.length < 1 && collapse ? ' ' : match; + }; + text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); + text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace + if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { + text = text.replace(/^\s+/, replacer.bind(replacer, false)); + } + if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { + text = text.replace(/\s+$/, replacer.bind(replacer, false)); + } + } + return delta.insert(text); + } + + exports.default = Clipboard; + exports.matchAttributor = matchAttributor; + exports.matchBlot = matchBlot; + exports.matchNewline = matchNewline; + exports.matchSpacing = matchSpacing; + exports.matchText = matchText; + +/***/ }, +/* 49 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['right', 'center', 'justify'] + }; + + var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); + var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); + var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); + + exports.AlignAttribute = AlignAttribute; + exports.AlignClass = AlignClass; + exports.AlignStyle = AlignStyle; + +/***/ }, +/* 50 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.BackgroundStyle = exports.BackgroundClass = undefined; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _color = __webpack_require__(51); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { + scope: _parchment2.default.Scope.INLINE + }); + var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { + scope: _parchment2.default.Scope.INLINE + }); + + exports.BackgroundClass = BackgroundClass; + exports.BackgroundStyle = BackgroundStyle; + +/***/ }, +/* 51 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var ColorAttributor = function (_Parchment$Attributor) { + _inherits(ColorAttributor, _Parchment$Attributor); + + function ColorAttributor() { + _classCallCheck(this, ColorAttributor); + + return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); + } + + _createClass(ColorAttributor, [{ + key: 'value', + value: function value(domNode) { + var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); + if (!value.startsWith('rgb(')) return value; + value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); + return '#' + value.split(',').map(function (component) { + return ('00' + parseInt(component).toString(16)).slice(-2); + }).join(''); + } + }]); + + return ColorAttributor; + }(_parchment2.default.Attributor.Style); + + var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { + scope: _parchment2.default.Scope.INLINE + }); + var ColorStyle = new ColorAttributor('color', 'color', { + scope: _parchment2.default.Scope.INLINE + }); + + exports.ColorAttributor = ColorAttributor; + exports.ColorClass = ColorClass; + exports.ColorStyle = ColorStyle; + +/***/ }, +/* 52 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['rtl'] + }; + + var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); + var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); + var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); + + exports.DirectionAttribute = DirectionAttribute; + exports.DirectionClass = DirectionClass; + exports.DirectionStyle = DirectionStyle; + +/***/ }, +/* 53 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FontClass = exports.FontStyle = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var config = { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['serif', 'monospace'] + }; + + var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); + + var FontStyleAttributor = function (_Parchment$Attributor) { + _inherits(FontStyleAttributor, _Parchment$Attributor); + + function FontStyleAttributor() { + _classCallCheck(this, FontStyleAttributor); + + return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); + } + + _createClass(FontStyleAttributor, [{ + key: 'value', + value: function value(node) { + return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); + } + }]); + + return FontStyleAttributor; + }(_parchment2.default.Attributor.Style); + + var FontStyle = new FontStyleAttributor('font', 'font-family', config); + + exports.FontStyle = FontStyle; + exports.FontClass = FontClass; + +/***/ }, +/* 54 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.SizeStyle = exports.SizeClass = undefined; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['small', 'large', 'huge'] + }); + var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['10px', '18px', '32px'] + }); + + exports.SizeClass = SizeClass; + exports.SizeStyle = SizeStyle; + +/***/ }, +/* 55 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getLastChangeIndex = exports.default = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _quill = __webpack_require__(18); + + var _quill2 = _interopRequireDefault(_quill); + + var _module = __webpack_require__(43); + + var _module2 = _interopRequireDefault(_module); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var History = function (_Module) { + _inherits(History, _Module); + + function History(quill, options) { + _classCallCheck(this, History); + + var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); + + _this.lastRecorded = 0; + _this.ignoreChange = false; + _this.clear(); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { + if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; + if (!_this.options.userOnly || source === _quill2.default.sources.USER) { + _this.record(delta, oldDelta); + } else { + _this.transform(delta); + } + }); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); + if (/Win/i.test(navigator.platform)) { + _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); + } + return _this; + } + + _createClass(History, [{ + key: 'change', + value: function change(source, dest) { + if (this.stack[source].length === 0) return; + var delta = this.stack[source].pop(); + this.lastRecorded = 0; + this.ignoreChange = true; + this.quill.updateContents(delta[source], _quill2.default.sources.USER); + this.ignoreChange = false; + var index = getLastChangeIndex(delta[source]); + this.quill.setSelection(index); + this.quill.selection.scrollIntoView(); + this.stack[dest].push(delta); + } + }, { + key: 'clear', + value: function clear() { + this.stack = { undo: [], redo: [] }; + } + }, { + key: 'record', + value: function record(changeDelta, oldDelta) { + if (changeDelta.ops.length === 0) return; + this.stack.redo = []; + var undoDelta = this.quill.getContents().diff(oldDelta); + var timestamp = Date.now(); + if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { + var delta = this.stack.undo.pop(); + undoDelta = undoDelta.compose(delta.undo); + changeDelta = delta.redo.compose(changeDelta); + } else { + this.lastRecorded = timestamp; + } + this.stack.undo.push({ + redo: changeDelta, + undo: undoDelta + }); + if (this.stack.undo.length > this.options.maxStack) { + this.stack.undo.shift(); + } + } + }, { + key: 'redo', + value: function redo() { + this.change('redo', 'undo'); + } + }, { + key: 'transform', + value: function transform(delta) { + this.stack.undo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + this.stack.redo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + } + }, { + key: 'undo', + value: function undo() { + this.change('undo', 'redo'); + } + }]); + + return History; + }(_module2.default); + + History.DEFAULTS = { + delay: 1000, + maxStack: 100, + userOnly: false + }; + + function endsWithNewlineChange(delta) { + var lastOp = delta.ops[delta.ops.length - 1]; + if (lastOp == null) return false; + if (lastOp.insert != null) { + return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); + } + if (lastOp.attributes != null) { + return Object.keys(lastOp.attributes).some(function (attr) { + return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; + }); + } + return false; + } + + function getLastChangeIndex(delta) { + var deleteLength = delta.reduce(function (length, op) { + length += op.delete || 0; + return length; + }, 0); + var changeIndex = delta.length() - deleteLength; + if (endsWithNewlineChange(delta)) { + changeIndex -= 1; + } + return changeIndex; + } + + exports.default = History; + exports.getLastChangeIndex = getLastChangeIndex; + +/***/ }, +/* 56 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _clone = __webpack_require__(39); + + var _clone2 = _interopRequireDefault(_clone); + + var _deepEqual = __webpack_require__(40); + + var _deepEqual2 = _interopRequireDefault(_deepEqual); + + var _extend = __webpack_require__(30); + + var _extend2 = _interopRequireDefault(_extend); + + var _op = __webpack_require__(26); + + var _op2 = _interopRequireDefault(_op); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _quill = __webpack_require__(18); + + var _quill2 = _interopRequireDefault(_quill); + + var _logger = __webpack_require__(38); + + var _logger2 = _interopRequireDefault(_logger); + + var _module = __webpack_require__(43); + + var _module2 = _interopRequireDefault(_module); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var debug = (0, _logger2.default)('quill:keyboard'); + + var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; + + var Keyboard = function (_Module) { + _inherits(Keyboard, _Module); + + _createClass(Keyboard, null, [{ + key: 'match', + value: function match(evt, binding) { + binding = normalize(binding); + if (!!binding.shortKey !== evt[SHORTKEY] && binding.shortKey !== null) return false; + if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { + return key != SHORTKEY && !!binding[key] !== evt[key] && binding[key] !== null; + })) { + return false; + } + return binding.key === (evt.which || evt.keyCode); + } + }]); + + function Keyboard(quill, options) { + _classCallCheck(this, Keyboard); + + var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); + + _this.bindings = {}; + Object.keys(_this.options.bindings).forEach(function (name) { + if (_this.options.bindings[name]) { + _this.addBinding(_this.options.bindings[name]); + } + }); + _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); + _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^$/ }, handleDelete); + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); + if (/Trident/i.test(navigator.userAgent)) { + _this.addBinding({ key: Keyboard.keys.BACKSPACE, shortKey: true }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE, shortKey: true }, handleDelete); + } + _this.listen(); + return _this; + } + + _createClass(Keyboard, [{ + key: 'addBinding', + value: function addBinding(key) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var binding = normalize(key); + if (binding == null || binding.key == null) { + return debug.warn('Attempted to add invalid keyboard binding', binding); + } + if (typeof context === 'function') { + context = { handler: context }; + } + if (typeof handler === 'function') { + handler = { handler: handler }; + } + binding = (0, _extend2.default)(binding, context, handler); + this.bindings[binding.key] = this.bindings[binding.key] || []; + this.bindings[binding.key].push(binding); + } + }, { + key: 'listen', + value: function listen() { + var _this2 = this; + + this.quill.root.addEventListener('keydown', function (evt) { + if (evt.defaultPrevented) return; + var which = evt.which || evt.keyCode; + var bindings = (_this2.bindings[which] || []).filter(function (binding) { + return Keyboard.match(evt, binding); + }); + if (bindings.length === 0) return; + var range = _this2.quill.getSelection(); + if (range == null || !_this2.quill.hasFocus()) return; + + var _quill$scroll$line = _this2.quill.scroll.line(range.index), + _quill$scroll$line2 = _slicedToArray(_quill$scroll$line, 2), + line = _quill$scroll$line2[0], + offset = _quill$scroll$line2[1]; + + var _quill$scroll$leaf = _this2.quill.scroll.leaf(range.index), + _quill$scroll$leaf2 = _slicedToArray(_quill$scroll$leaf, 2), + leafStart = _quill$scroll$leaf2[0], + offsetStart = _quill$scroll$leaf2[1]; + + var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.scroll.leaf(range.index + range.length), + _ref2 = _slicedToArray(_ref, 2), + leafEnd = _ref2[0], + offsetEnd = _ref2[1]; + + var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; + var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; + var curContext = { + collapsed: range.length === 0, + empty: range.length === 0 && line.length() <= 1, + format: _this2.quill.getFormat(range), + offset: offset, + prefix: prefixText, + suffix: suffixText + }; + var prevented = bindings.some(function (binding) { + if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; + if (binding.empty != null && binding.empty !== curContext.empty) return false; + if (binding.offset != null && binding.offset !== curContext.offset) return false; + if (Array.isArray(binding.format)) { + // any format is present + if (binding.format.every(function (name) { + return curContext.format[name] == null; + })) { + return false; + } + } else if (_typeof(binding.format) === 'object') { + // all formats must match + if (!Object.keys(binding.format).every(function (name) { + if (binding.format[name] === true) return curContext.format[name] != null; + if (binding.format[name] === false) return curContext.format[name] == null; + return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); + })) { + return false; + } + } + if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; + if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; + return binding.handler.call(_this2, range, curContext) !== true; + }); + if (prevented) { + evt.preventDefault(); + } + }); + } + }]); + + return Keyboard; + }(_module2.default); + + Keyboard.keys = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + ESCAPE: 27, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46 + }; + + Keyboard.DEFAULTS = { + bindings: { + 'bold': makeFormatHandler('bold'), + 'italic': makeFormatHandler('italic'), + 'underline': makeFormatHandler('underline'), + 'indent': { + // highlight tab or tab at beginning of list, indent or blockquote + key: Keyboard.keys.TAB, + format: ['blockquote', 'indent', 'list'], + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '+1', _quill2.default.sources.USER); + } + }, + 'outdent': { + key: Keyboard.keys.TAB, + shiftKey: true, + format: ['blockquote', 'indent', 'list'], + // highlight tab or tab at beginning of list, indent or blockquote + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } + }, + 'outdent backspace': { + key: Keyboard.keys.BACKSPACE, + collapsed: true, + format: ['blockquote', 'indent', 'list'], + offset: 0, + handler: function handler(range, context) { + if (context.format.indent != null) { + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } else if (context.format.blockquote != null) { + this.quill.format('blockquote', false, _quill2.default.sources.USER); + } else if (context.format.list != null) { + this.quill.format('list', false, _quill2.default.sources.USER); + } + } + }, + 'indent code-block': makeCodeBlockHandler(true), + 'outdent code-block': makeCodeBlockHandler(false), + 'remove tab': { + key: Keyboard.keys.TAB, + shiftKey: true, + collapsed: true, + prefix: /\t$/, + handler: function handler(range) { + this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); + } + }, + 'tab': { + key: Keyboard.keys.TAB, + handler: function handler(range, context) { + if (!context.collapsed) { + this.quill.scroll.deleteAt(range.index, range.length); + } + this.quill.insertText(range.index, '\t', _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + } + }, + 'list empty enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['list'], + empty: true, + handler: function handler(range, context) { + this.quill.format('list', false, _quill2.default.sources.USER); + if (context.format.indent) { + this.quill.format('indent', false, _quill2.default.sources.USER); + } + } + }, + 'header enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['header'], + suffix: /^$/, + handler: function handler(range) { + this.quill.scroll.insertAt(range.index, '\n'); + this.quill.formatText(range.index + 1, 1, 'header', false, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.selection.scrollIntoView(); + } + }, + 'list autofill': { + key: ' ', + collapsed: true, + format: { list: false }, + prefix: /^(1\.|-)$/, + handler: function handler(range, context) { + var length = context.prefix.length; + this.quill.scroll.deleteAt(range.index - length, length); + this.quill.formatLine(range.index - length, 1, 'list', length === 1 ? 'bullet' : 'ordered', _quill2.default.sources.USER); + this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); + } + } + } + }; + + function handleBackspace(range, context) { + if (range.index === 0) return; + + var _quill$scroll$line3 = this.quill.scroll.line(range.index), + _quill$scroll$line4 = _slicedToArray(_quill$scroll$line3, 1), + line = _quill$scroll$line4[0]; + + var formats = {}; + if (context.offset === 0) { + var curFormats = line.formats(); + var prevFormats = this.quill.getFormat(range.index - 1, 1); + formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; + } + this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index - 1, 1, formats, _quill2.default.sources.USER); + } + this.quill.selection.scrollIntoView(); + } + + function handleDelete(range) { + if (range.index >= this.quill.getLength() - 1) return; + this.quill.deleteText(range.index, 1, _quill2.default.sources.USER); + } + + function handleDeleteRange(range) { + this.quill.deleteText(range, _quill2.default.sources.USER); + this.quill.setSelection(range.index, _quill2.default.sources.SILENT); + this.quill.selection.scrollIntoView(); + } + + function handleEnter(range, context) { + var _this3 = this; + + if (range.length > 0) { + this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change + } + var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { + if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { + lineFormats[format] = context.format[format]; + } + return lineFormats; + }, {}); + this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); + this.quill.selection.scrollIntoView(); + Object.keys(context.format).forEach(function (name) { + if (lineFormats[name] != null) return; + if (Array.isArray(context.format[name])) return; + if (name === 'link') return; + _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); + }); + } + + function makeCodeBlockHandler(indent) { + return { + key: Keyboard.keys.TAB, + shiftKey: !indent, + format: { 'code-block': true }, + handler: function handler(range) { + var CodeBlock = _parchment2.default.query('code-block'); + var index = range.index, + length = range.length; + + var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + block = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (block == null) return; + var scrollOffset = this.quill.scroll.offset(block); + var start = block.newlineIndex(offset, true) + 1; + var end = block.newlineIndex(scrollOffset + offset + length); + var lines = block.domNode.textContent.slice(start, end).split('\n'); + offset = 0; + lines.forEach(function (line, i) { + if (indent) { + block.insertAt(start + offset, CodeBlock.TAB); + offset += CodeBlock.TAB.length; + if (i === 0) { + index += CodeBlock.TAB.length; + } else { + length += CodeBlock.TAB.length; + } + } else if (line.startsWith(CodeBlock.TAB)) { + block.deleteAt(start + offset, CodeBlock.TAB.length); + offset -= CodeBlock.TAB.length; + if (i === 0) { + index -= CodeBlock.TAB.length; + } else { + length -= CodeBlock.TAB.length; + } + } + offset += line.length + 1; + }); + this.quill.update(_quill2.default.sources.USER); + this.quill.setSelection(index, length, _quill2.default.sources.SILENT); + } + }; + } + + function makeFormatHandler(format) { + return { + key: format[0].toUpperCase(), + shortKey: true, + handler: function handler(range, context) { + this.quill.format(format, !context.format[format], _quill2.default.sources.USER); + } + }; + } + + function normalize(binding) { + if (typeof binding === 'string' || typeof binding === 'number') { + return normalize({ key: binding }); + } + if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { + binding = (0, _clone2.default)(binding, false); + } + if (typeof binding.key === 'string') { + if (Keyboard.keys[binding.key.toUpperCase()] != null) { + binding.key = Keyboard.keys[binding.key.toUpperCase()]; + } else if (binding.key.length === 1) { + binding.key = binding.key.toUpperCase().charCodeAt(0); + } else { + return null; + } + } + return binding; + } + + exports.default = Keyboard; + +/***/ }, +/* 57 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _core = __webpack_require__(1); + + var _core2 = _interopRequireDefault(_core); + + var _align = __webpack_require__(49); + + var _direction = __webpack_require__(52); + + var _indent = __webpack_require__(58); + + var _blockquote = __webpack_require__(59); + + var _blockquote2 = _interopRequireDefault(_blockquote); + + var _header = __webpack_require__(60); + + var _header2 = _interopRequireDefault(_header); + + var _list = __webpack_require__(61); + + var _list2 = _interopRequireDefault(_list); + + var _background = __webpack_require__(50); + + var _color = __webpack_require__(51); + + var _font = __webpack_require__(53); + + var _size = __webpack_require__(54); + + var _bold = __webpack_require__(62); + + var _bold2 = _interopRequireDefault(_bold); + + var _italic = __webpack_require__(63); + + var _italic2 = _interopRequireDefault(_italic); + + var _link = __webpack_require__(64); + + var _link2 = _interopRequireDefault(_link); + + var _script = __webpack_require__(65); + + var _script2 = _interopRequireDefault(_script); + + var _strike = __webpack_require__(66); + + var _strike2 = _interopRequireDefault(_strike); + + var _underline = __webpack_require__(67); + + var _underline2 = _interopRequireDefault(_underline); + + var _image = __webpack_require__(68); + + var _image2 = _interopRequireDefault(_image); + + var _video = __webpack_require__(69); + + var _video2 = _interopRequireDefault(_video); + + var _code = __webpack_require__(28); + + var _code2 = _interopRequireDefault(_code); + + var _formula = __webpack_require__(70); + + var _formula2 = _interopRequireDefault(_formula); + + var _syntax = __webpack_require__(71); + + var _syntax2 = _interopRequireDefault(_syntax); + + var _toolbar = __webpack_require__(72); + + var _toolbar2 = _interopRequireDefault(_toolbar); + + var _icons = __webpack_require__(73); + + var _icons2 = _interopRequireDefault(_icons); + + var _picker = __webpack_require__(105); + + var _picker2 = _interopRequireDefault(_picker); + + var _colorPicker = __webpack_require__(107); + + var _colorPicker2 = _interopRequireDefault(_colorPicker); + + var _iconPicker = __webpack_require__(108); + + var _iconPicker2 = _interopRequireDefault(_iconPicker); + + var _tooltip = __webpack_require__(109); + + var _tooltip2 = _interopRequireDefault(_tooltip); + + var _bubble = __webpack_require__(110); + + var _bubble2 = _interopRequireDefault(_bubble); + + var _snow = __webpack_require__(112); + + var _snow2 = _interopRequireDefault(_snow); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + _core2.default.register({ + 'attributors/attribute/direction': _direction.DirectionAttribute, + + 'attributors/class/align': _align.AlignClass, + 'attributors/class/background': _background.BackgroundClass, + 'attributors/class/color': _color.ColorClass, + 'attributors/class/direction': _direction.DirectionClass, + 'attributors/class/font': _font.FontClass, + 'attributors/class/size': _size.SizeClass, + + 'attributors/style/align': _align.AlignStyle, + 'attributors/style/background': _background.BackgroundStyle, + 'attributors/style/color': _color.ColorStyle, + 'attributors/style/direction': _direction.DirectionStyle, + 'attributors/style/font': _font.FontStyle, + 'attributors/style/size': _size.SizeStyle + }, true); + + _core2.default.register({ + 'formats/align': _align.AlignClass, + 'formats/direction': _direction.DirectionClass, + 'formats/indent': _indent.IndentClass, + + 'formats/background': _background.BackgroundStyle, + 'formats/color': _color.ColorStyle, + 'formats/font': _font.FontClass, + 'formats/size': _size.SizeClass, + + 'formats/blockquote': _blockquote2.default, + 'formats/code-block': _code2.default, + 'formats/header': _header2.default, + 'formats/list': _list2.default, + + 'formats/bold': _bold2.default, + 'formats/code': _code.Code, + 'formats/italic': _italic2.default, + 'formats/link': _link2.default, + 'formats/script': _script2.default, + 'formats/strike': _strike2.default, + 'formats/underline': _underline2.default, + + 'formats/image': _image2.default, + 'formats/video': _video2.default, + + 'formats/list/item': _list.ListItem, + + 'modules/formula': _formula2.default, + 'modules/syntax': _syntax2.default, + 'modules/toolbar': _toolbar2.default, + + 'themes/bubble': _bubble2.default, + 'themes/snow': _snow2.default, + + 'ui/icons': _icons2.default, + 'ui/picker': _picker2.default, + 'ui/icon-picker': _iconPicker2.default, + 'ui/color-picker': _colorPicker2.default, + 'ui/tooltip': _tooltip2.default + }, true); + + module.exports = _core2.default; + +/***/ }, +/* 58 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.IndentClass = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var IdentAttributor = function (_Parchment$Attributor) { + _inherits(IdentAttributor, _Parchment$Attributor); + + function IdentAttributor() { + _classCallCheck(this, IdentAttributor); + + return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments)); + } + + _createClass(IdentAttributor, [{ + key: 'add', + value: function add(node, value) { + if (value === '+1' || value === '-1') { + var indent = this.value(node) || 0; + value = value === '+1' ? indent + 1 : indent - 1; + } + if (value === 0) { + this.remove(node); + return true; + } else { + return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value); + } + } + }, { + key: 'value', + value: function value(node) { + return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN + } + }]); + + return IdentAttributor; + }(_parchment2.default.Attributor.Class); + + var IndentClass = new IdentAttributor('indent', 'ql-indent', { + scope: _parchment2.default.Scope.BLOCK, + whitelist: [1, 2, 3, 4, 5, 6, 7, 8] + }); + + exports.IndentClass = IndentClass; + +/***/ }, +/* 59 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Blockquote = function (_Block) { + _inherits(Blockquote, _Block); + + function Blockquote() { + _classCallCheck(this, Blockquote); + + return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments)); + } + + return Blockquote; + }(_block2.default); + + Blockquote.blotName = 'blockquote'; + Blockquote.tagName = 'blockquote'; + + exports.default = Blockquote; + +/***/ }, +/* 60 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Header = function (_Block) { + _inherits(Header, _Block); + + function Header() { + _classCallCheck(this, Header); + + return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments)); + } + + _createClass(Header, null, [{ + key: 'formats', + value: function formats(domNode) { + return this.tagName.indexOf(domNode.tagName) + 1; + } + }]); + + return Header; + }(_block2.default); + + Header.blotName = 'header'; + Header.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6']; + + exports.default = Header; + +/***/ }, +/* 61 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.ListItem = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _block = __webpack_require__(29); + + var _block2 = _interopRequireDefault(_block); + + var _container = __webpack_require__(46); + + var _container2 = _interopRequireDefault(_container); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var ListItem = function (_Block) { + _inherits(ListItem, _Block); + + function ListItem() { + _classCallCheck(this, ListItem); + + return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments)); + } + + _createClass(ListItem, [{ + key: 'format', + value: function format(name, value) { + if (name === List.blotName && !value) { + this.replaceWith(_parchment2.default.create(this.statics.scope)); + } else { + _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value); + } + } + }, { + key: 'remove', + value: function remove() { + if (this.prev == null && this.next == null) { + this.parent.remove(); + } else { + _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this); + } + } + }, { + key: 'replaceWith', + value: function replaceWith(name, value) { + this.parent.isolate(this.offset(this.parent), this.length()); + if (name === this.parent.statics.blotName) { + this.parent.replaceWith(name, value); + return this; + } else { + this.parent.unwrap(); + return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value); + } + } + }], [{ + key: 'formats', + value: function formats(domNode) { + return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode); + } + }]); + + return ListItem; + }(_block2.default); + + ListItem.blotName = 'list-item'; + ListItem.tagName = 'LI'; + + var List = function (_Container) { + _inherits(List, _Container); + + function List() { + _classCallCheck(this, List); + + return _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).apply(this, arguments)); + } + + _createClass(List, [{ + key: 'format', + value: function format(name, value) { + if (this.children.length > 0) { + this.children.tail.format(name, value); + } + } + }, { + key: 'formats', + value: function formats() { + // We don't inherit from FormatBlot + return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode)); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot instanceof ListItem) { + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref); + } else { + var index = ref == null ? this.length() : ref.offset(this); + var after = this.split(index); + after.parent.insertBefore(blot, after); + } + } + }, { + key: 'optimize', + value: function optimize() { + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName) { + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + if (target.statics.blotName !== this.statics.blotName) { + var item = _parchment2.default.create(this.statics.defaultChild); + target.moveChildren(item); + this.appendChild(item); + } + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target); + } + }], [{ + key: 'create', + value: function create(value) { + if (value === 'ordered') { + value = 'OL'; + } else if (value === 'bullet') { + value = 'UL'; + } + return _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, value); + } + }, { + key: 'formats', + value: function formats(domNode) { + if (domNode.tagName === 'OL') return 'ordered'; + if (domNode.tagName === 'UL') return 'bullet'; + return undefined; + } + }]); + + return List; + }(_container2.default); + + List.blotName = 'list'; + List.scope = _parchment2.default.Scope.BLOCK_BLOT; + List.tagName = ['OL', 'UL']; + List.defaultChild = 'list-item'; + List.allowedChildren = [ListItem]; + + exports.ListItem = ListItem; + exports.default = List; + +/***/ }, +/* 62 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _inline = __webpack_require__(33); + + var _inline2 = _interopRequireDefault(_inline); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Bold = function (_Inline) { + _inherits(Bold, _Inline); + + function Bold() { + _classCallCheck(this, Bold); + + return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments)); + } + + _createClass(Bold, [{ + key: 'optimize', + value: function optimize() { + _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this); + if (this.domNode.tagName !== this.statics.tagName[0]) { + this.replaceWith(this.statics.blotName); + } + } + }], [{ + key: 'create', + value: function create() { + return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this); + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return Bold; + }(_inline2.default); + + Bold.blotName = 'bold'; + Bold.tagName = ['STRONG', 'B']; + + exports.default = Bold; + +/***/ }, +/* 63 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _bold = __webpack_require__(62); + + var _bold2 = _interopRequireDefault(_bold); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Italic = function (_Bold) { + _inherits(Italic, _Bold); + + function Italic() { + _classCallCheck(this, Italic); + + return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments)); + } + + return Italic; + }(_bold2.default); + + Italic.blotName = 'italic'; + Italic.tagName = ['EM', 'I']; + + exports.default = Italic; + +/***/ }, +/* 64 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.sanitize = exports.default = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _inline = __webpack_require__(33); + + var _inline2 = _interopRequireDefault(_inline); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Link = function (_Inline) { + _inherits(Link, _Inline); + + function Link() { + _classCallCheck(this, Link); + + return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments)); + } + + _createClass(Link, [{ + key: 'format', + value: function format(name, value) { + if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value); + value = this.constructor.sanitize(value); + this.domNode.setAttribute('href', value); + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value); + value = this.sanitize(value); + node.setAttribute('href', value); + node.setAttribute('target', '_blank'); + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return domNode.getAttribute('href'); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return _sanitize(url, ['http', 'https', 'mailto']) ? url : this.SANITIZED_URL; + } + }]); + + return Link; + }(_inline2.default); + + Link.blotName = 'link'; + Link.tagName = 'A'; + Link.SANITIZED_URL = 'about:blank'; + + function _sanitize(url, protocols) { + var anchor = document.createElement('a'); + anchor.href = url; + var protocol = anchor.href.slice(0, anchor.href.indexOf(':')); + return protocols.indexOf(protocol) > -1; + } + + exports.default = Link; + exports.sanitize = _sanitize; + +/***/ }, +/* 65 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _inline = __webpack_require__(33); + + var _inline2 = _interopRequireDefault(_inline); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Script = function (_Inline) { + _inherits(Script, _Inline); + + function Script() { + _classCallCheck(this, Script); + + return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments)); + } + + _createClass(Script, null, [{ + key: 'create', + value: function create(value) { + if (value === 'super') { + return document.createElement('sup'); + } else if (value === 'sub') { + return document.createElement('sub'); + } else { + return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value); + } + } + }, { + key: 'formats', + value: function formats(domNode) { + if (domNode.tagName === 'SUB') return 'sub'; + if (domNode.tagName === 'SUP') return 'super'; + return undefined; + } + }]); + + return Script; + }(_inline2.default); + + Script.blotName = 'script'; + Script.tagName = ['SUB', 'SUP']; + + exports.default = Script; + +/***/ }, +/* 66 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _inline = __webpack_require__(33); + + var _inline2 = _interopRequireDefault(_inline); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Strike = function (_Inline) { + _inherits(Strike, _Inline); + + function Strike() { + _classCallCheck(this, Strike); + + return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments)); + } + + return Strike; + }(_inline2.default); + + Strike.blotName = 'strike'; + Strike.tagName = 'S'; + + exports.default = Strike; + +/***/ }, +/* 67 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _inline = __webpack_require__(33); + + var _inline2 = _interopRequireDefault(_inline); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var Underline = function (_Inline) { + _inherits(Underline, _Inline); + + function Underline() { + _classCallCheck(this, Underline); + + return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments)); + } + + return Underline; + }(_inline2.default); + + Underline.blotName = 'underline'; + Underline.tagName = 'U'; + + exports.default = Underline; + +/***/ }, +/* 68 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _embed = __webpack_require__(32); + + var _embed2 = _interopRequireDefault(_embed); + + var _link = __webpack_require__(64); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var ATTRIBUTES = ['alt', 'height', 'width']; + + var Image = function (_Embed) { + _inherits(Image, _Embed); + + function Image() { + _classCallCheck(this, Image); + + return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments)); + } + + _createClass(Image, [{ + key: 'format', + value: function format(name, value) { + if (ATTRIBUTES.indexOf(name) > -1) { + if (value) { + this.domNode.setAttribute(name, value); + } else { + this.domNode.removeAttribute(name); + } + } else { + _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value); + } + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value); + if (typeof value === 'string') { + node.setAttribute('src', this.sanitize(value)); + } + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return ATTRIBUTES.reduce(function (formats, attribute) { + if (domNode.hasAttribute(attribute)) { + formats[attribute] = domNode.getAttribute(attribute); + } + return formats; + }, {}); + } + }, { + key: 'match', + value: function match(url) { + return (/\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url) + ); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0'; + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('src'); + } + }]); + + return Image; + }(_embed2.default); + + Image.blotName = 'image'; + Image.tagName = 'IMG'; + + exports.default = Image; + +/***/ }, +/* 69 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _block = __webpack_require__(29); + + var _link = __webpack_require__(64); + + var _link2 = _interopRequireDefault(_link); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var ATTRIBUTES = ['height', 'width']; + + var Video = function (_BlockEmbed) { + _inherits(Video, _BlockEmbed); + + function Video() { + _classCallCheck(this, Video); + + return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments)); + } + + _createClass(Video, [{ + key: 'format', + value: function format(name, value) { + if (ATTRIBUTES.indexOf(name) > -1) { + if (value) { + this.domNode.setAttribute(name, value); + } else { + this.domNode.removeAttribute(name); + } + } else { + _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value); + } + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value); + node.setAttribute('frameborder', '0'); + node.setAttribute('allowfullscreen', true); + node.setAttribute('src', this.sanitize(value)); + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return ATTRIBUTES.reduce(function (formats, attribute) { + if (domNode.hasAttribute(attribute)) { + formats[attribute] = domNode.getAttribute(attribute); + } + return formats; + }, {}); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return _link2.default.sanitize(url); + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('src'); + } + }]); + + return Video; + }(_block.BlockEmbed); + + Video.blotName = 'video'; + Video.className = 'ql-video'; + Video.tagName = 'IFRAME'; + + exports.default = Video; + +/***/ }, +/* 70 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.FormulaBlot = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _embed = __webpack_require__(32); + + var _embed2 = _interopRequireDefault(_embed); + + var _quill = __webpack_require__(18); + + var _quill2 = _interopRequireDefault(_quill); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var FormulaBlot = function (_Embed) { + _inherits(FormulaBlot, _Embed); + + function FormulaBlot() { + _classCallCheck(this, FormulaBlot); + + return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments)); + } + + _createClass(FormulaBlot, [{ + key: 'index', + value: function index() { + return 1; + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value); + if (typeof value === 'string') { + window.katex.render(value, node); + node.setAttribute('data-value', value); + } + node.setAttribute('contenteditable', false); + return node; + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('data-value'); + } + }]); + + return FormulaBlot; + }(_embed2.default); + + FormulaBlot.blotName = 'formula'; + FormulaBlot.className = 'ql-formula'; + FormulaBlot.tagName = 'SPAN'; + + function Formula() { + if (window.katex == null) { + throw new Error('Formula module requires KaTeX.'); + } + _quill2.default.register(FormulaBlot, true); + } + + exports.FormulaBlot = FormulaBlot; + exports.default = Formula; + +/***/ }, +/* 71 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.CodeToken = exports.CodeBlock = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _quill = __webpack_require__(18); + + var _quill2 = _interopRequireDefault(_quill); + + var _module = __webpack_require__(43); + + var _module2 = _interopRequireDefault(_module); + + var _code = __webpack_require__(28); + + var _code2 = _interopRequireDefault(_code); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var SyntaxCodeBlock = function (_CodeBlock) { + _inherits(SyntaxCodeBlock, _CodeBlock); + + function SyntaxCodeBlock() { + _classCallCheck(this, SyntaxCodeBlock); + + return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments)); + } + + _createClass(SyntaxCodeBlock, [{ + key: 'replaceWith', + value: function replaceWith(block) { + this.domNode.textContent = this.domNode.textContent; + this.attach(); + _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block); + } + }, { + key: 'highlight', + value: function highlight(_highlight) { + if (this.cachedHTML !== this.domNode.innerHTML) { + var text = this.domNode.textContent; + if (text.trim().length > 0 || this.cachedHTML == null) { + this.domNode.innerHTML = _highlight(text); + this.attach(); + } + this.cachedHTML = this.domNode.innerHTML; + } + } + }]); + + return SyntaxCodeBlock; + }(_code2.default); + + SyntaxCodeBlock.className = 'ql-syntax'; + + var CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', { + scope: _parchment2.default.Scope.INLINE + }); + + var Syntax = function (_Module) { + _inherits(Syntax, _Module); + + function Syntax(quill, options) { + _classCallCheck(this, Syntax); + + var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options)); + + if (typeof _this2.options.highlight !== 'function') { + throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.'); + } + _quill2.default.register(CodeToken, true); + _quill2.default.register(SyntaxCodeBlock, true); + var timer = null; + _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { + if (timer != null) return; + timer = setTimeout(function () { + _this2.highlight(); + timer = null; + }, 100); + }); + _this2.highlight(); + return _this2; + } + + _createClass(Syntax, [{ + key: 'highlight', + value: function highlight() { + var _this3 = this; + + if (this.quill.selection.composing) return; + var range = this.quill.getSelection(); + this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) { + code.highlight(_this3.options.highlight); + }); + this.quill.update(_quill2.default.sources.SILENT); + if (range != null) { + this.quill.setSelection(range, _quill2.default.sources.SILENT); + } + } + }]); + + return Syntax; + }(_module2.default); + + Syntax.DEFAULTS = { + highlight: function () { + if (window.hljs == null) return null; + return function (text) { + var result = window.hljs.highlightAuto(text); + return result.value; + }; + }() + }; + + exports.CodeBlock = SyntaxCodeBlock; + exports.CodeToken = CodeToken; + exports.default = Syntax; + +/***/ }, +/* 72 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.addControls = exports.default = undefined; + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _quillDelta = __webpack_require__(20); + + var _quillDelta2 = _interopRequireDefault(_quillDelta); + + var _parchment = __webpack_require__(2); + + var _parchment2 = _interopRequireDefault(_parchment); + + var _quill = __webpack_require__(18); + + var _quill2 = _interopRequireDefault(_quill); + + var _logger = __webpack_require__(38); + + var _logger2 = _interopRequireDefault(_logger); + + var _module = __webpack_require__(43); + + var _module2 = _interopRequireDefault(_module); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var debug = (0, _logger2.default)('quill:toolbar'); + + var Toolbar = function (_Module) { + _inherits(Toolbar, _Module); + + function Toolbar(quill, options) { + _classCallCheck(this, Toolbar); + + var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options)); + + if (Array.isArray(_this.options.container)) { + var container = document.createElement('div'); + addControls(container, _this.options.container); + quill.container.parentNode.insertBefore(container, quill.container); + _this.container = container; + } else if (typeof _this.options.container === 'string') { + _this.container = document.querySelector(_this.options.container); + } else { + _this.container = _this.options.container; + } + if (!(_this.container instanceof HTMLElement)) { + var _ret; + + return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret); + } + _this.container.classList.add('ql-toolbar'); + _this.controls = []; + _this.handlers = {}; + Object.keys(_this.options.handlers).forEach(function (format) { + _this.addHandler(format, _this.options.handlers[format]); + }); + [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) { + _this.attach(input); + }); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) { + if (type === _quill2.default.events.SELECTION_CHANGE) { + _this.update(range); + } + }); + _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { + var _this$quill$selection = _this.quill.selection.getRange(), + _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), + range = _this$quill$selection2[0]; // quill.getSelection triggers update + + + _this.update(range); + }); + return _this; + } + + _createClass(Toolbar, [{ + key: 'addHandler', + value: function addHandler(format, handler) { + this.handlers[format] = handler; + } + }, { + key: 'attach', + value: function attach(input) { + var _this2 = this; + + var format = [].find.call(input.classList, function (className) { + return className.indexOf('ql-') === 0; + }); + if (!format) return; + format = format.slice('ql-'.length); + if (input.tagName === 'BUTTON') { + input.setAttribute('type', 'button'); + } + if (this.handlers[format] == null) { + if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) { + debug.warn('ignoring attaching to disabled format', format, input); + return; + } + if (_parchment2.default.query(format) == null) { + debug.warn('ignoring attaching to nonexistent format', format, input); + return; + } + } + var eventName = input.tagName === 'SELECT' ? 'change' : 'click'; + input.addEventListener(eventName, function (e) { + var value = void 0; + if (input.tagName === 'SELECT') { + if (input.selectedIndex < 0) return; + var selected = input.options[input.selectedIndex]; + if (selected.hasAttribute('selected')) { + value = false; + } else { + value = selected.value || false; + } + } else { + if (input.classList.contains('ql-active')) { + value = false; + } else { + value = input.value || !input.hasAttribute('value'); + } + e.preventDefault(); + } + _this2.quill.focus(); + + var _quill$selection$getR = _this2.quill.selection.getRange(), + _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), + range = _quill$selection$getR2[0]; + + if (_this2.handlers[format] != null) { + _this2.handlers[format].call(_this2, value); + } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) { + value = prompt('Enter ' + format); + if (!value) return; + _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER); + } else { + _this2.quill.format(format, value, _quill2.default.sources.USER); + } + _this2.update(range); + }); + // TODO use weakmap + this.controls.push([format, input]); + } + }, { + key: 'update', + value: function update(range) { + var formats = range == null ? {} : this.quill.getFormat(range); + this.controls.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + format = _pair[0], + input = _pair[1]; + + if (input.tagName === 'SELECT') { + var option = void 0; + if (range == null) { + option = null; + } else if (formats[format] == null) { + option = input.querySelector('option[selected]'); + } else if (!Array.isArray(formats[format])) { + var value = formats[format]; + if (typeof value === 'string') { + value = value.replace(/\"/g, '\\"'); + } + option = input.querySelector('option[value="' + value + '"]'); + } + if (option == null) { + input.value = ''; // TODO make configurable? + input.selectedIndex = -1; + } else { + option.selected = true; + } + } else { + if (range == null) { + input.classList.remove('ql-active'); + } else if (input.hasAttribute('value')) { + // both being null should match (default values) + // '1' should match with 1 (headers) + var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value'); + input.classList.toggle('ql-active', isActive); + } else { + input.classList.toggle('ql-active', formats[format] != null); + } + } + }); + } + }]); + + return Toolbar; + }(_module2.default); + + Toolbar.DEFAULTS = {}; + + function addButton(container, format, value) { + var input = document.createElement('button'); + input.setAttribute('type', 'button'); + input.classList.add('ql-' + format); + if (value != null) { + input.value = value; + } + container.appendChild(input); + } + + function addControls(container, groups) { + if (!Array.isArray(groups[0])) { + groups = [groups]; + } + groups.forEach(function (controls) { + var group = document.createElement('span'); + group.classList.add('ql-formats'); + controls.forEach(function (control) { + if (typeof control === 'string') { + addButton(group, control); + } else { + var format = Object.keys(control)[0]; + var value = control[format]; + if (Array.isArray(value)) { + addSelect(group, format, value); + } else { + addButton(group, format, value); + } + } + }); + container.appendChild(group); + }); + } + + function addSelect(container, format, values) { + var input = document.createElement('select'); + input.classList.add('ql-' + format); + values.forEach(function (value) { + var option = document.createElement('option'); + if (value !== false) { + option.setAttribute('value', value); + } else { + option.setAttribute('selected', 'selected'); + } + input.appendChild(option); + }); + container.appendChild(input); + } + + Toolbar.DEFAULTS = { + container: null, + handlers: { + clean: function clean() { + var _this3 = this; + + var range = this.quill.getSelection(); + if (range == null) return; + if (range.length == 0) { + var formats = this.quill.getFormat(); + Object.keys(formats).forEach(function (name) { + // Clean functionality in existing apps only clean inline formats + if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) { + _this3.quill.format(name, false); + } + }); + } else { + this.quill.removeFormat(range, _quill2.default.sources.USER); + } + }, + direction: function direction(value) { + var align = this.quill.getFormat()['align']; + if (value === 'rtl' && align == null) { + this.quill.format('align', 'right', _quill2.default.sources.USER); + } else if (!value && align === 'right') { + this.quill.format('align', false, _quill2.default.sources.USER); + } + this.quill.format('direction', value, _quill2.default.sources.USER); + }, + link: function link(value) { + if (value === true) { + value = prompt('Enter link URL:'); + } + this.quill.format('link', value, _quill2.default.sources.USER); + }, + indent: function indent(value) { + var range = this.quill.getSelection(); + var formats = this.quill.getFormat(range); + var indent = parseInt(formats.indent || 0); + if (value === '+1' || value === '-1') { + var modifier = value === '+1' ? 1 : -1; + if (formats.direction === 'rtl') modifier *= -1; + this.quill.format('indent', indent + modifier, _quill2.default.sources.USER); + } + } + } + }; + + exports.default = Toolbar; + exports.addControls = addControls; + +/***/ }, +/* 73 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = { + 'align': { + '': __webpack_require__(74), + 'center': __webpack_require__(75), + 'right': __webpack_require__(76), + 'justify': __webpack_require__(77) + }, + 'background': __webpack_require__(78), + 'blockquote': __webpack_require__(79), + 'bold': __webpack_require__(80), + 'clean': __webpack_require__(81), + 'code': __webpack_require__(82), + 'code-block': __webpack_require__(82), + 'color': __webpack_require__(83), + 'direction': { + '': __webpack_require__(84), + 'rtl': __webpack_require__(85) + }, + 'float': { + 'center': __webpack_require__(86), + 'full': __webpack_require__(87), + 'left': __webpack_require__(88), + 'right': __webpack_require__(89) + }, + 'formula': __webpack_require__(90), + 'header': { + '1': __webpack_require__(91), + '2': __webpack_require__(92) + }, + 'italic': __webpack_require__(93), + 'image': __webpack_require__(94), + 'indent': { + '+1': __webpack_require__(95), + '-1': __webpack_require__(96) + }, + 'link': __webpack_require__(97), + 'list': { + 'ordered': __webpack_require__(98), + 'bullet': __webpack_require__(99) + }, + 'script': { + 'sub': __webpack_require__(100), + 'super': __webpack_require__(101) + }, + 'strike': __webpack_require__(102), + 'underline': __webpack_require__(103), + 'video': __webpack_require__(104) + }; + +/***/ }, +/* 74 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 75 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 76 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 77 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 78 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 79 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 80 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 81 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 82 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 83 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 84 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 85 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 86 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 87 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 88 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 89 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 90 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 91 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 92 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 93 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 94 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 95 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 96 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 97 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 98 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 99 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 100 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 101 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 102 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 103 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 104 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 105 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _dropdown = __webpack_require__(106); + + var _dropdown2 = _interopRequireDefault(_dropdown); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var Picker = function () { + function Picker(select) { + var _this = this; + + _classCallCheck(this, Picker); + + 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('click', function () { + _this.container.classList.toggle('ql-expanded'); + }); + this.select.addEventListener('change', this.update.bind(this)); + } + + _createClass(Picker, [{ + key: 'buildItem', + value: function buildItem(option) { + var _this2 = this; + + var item = document.createElement('span'); + item.classList.add('ql-picker-item'); + if (option.hasAttribute('value')) { + item.setAttribute('data-value', option.getAttribute('value')); + } + if (option.textContent) { + item.setAttribute('data-label', option.textContent); + } + item.addEventListener('click', function () { + _this2.selectItem(item, true); + }); + return item; + } + }, { + key: 'buildLabel', + value: function buildLabel() { + var label = document.createElement('span'); + label.classList.add('ql-picker-label'); + label.innerHTML = _dropdown2.default; + this.container.appendChild(label); + return label; + } + }, { + key: 'buildOptions', + value: function buildOptions() { + var _this3 = this; + + var options = document.createElement('span'); + options.classList.add('ql-picker-options'); + [].slice.call(this.select.options).forEach(function (option) { + var item = _this3.buildItem(option); + options.appendChild(item); + if (option.hasAttribute('selected')) { + _this3.selectItem(item); + } + }); + this.container.appendChild(options); + } + }, { + key: 'buildPicker', + value: function buildPicker() { + var _this4 = this; + + [].slice.call(this.select.attributes).forEach(function (item) { + _this4.container.setAttribute(item.name, item.value); + }); + this.container.classList.add('ql-picker'); + this.label = this.buildLabel(); + this.buildOptions(); + } + }, { + key: 'close', + value: function close() { + this.container.classList.remove('ql-expanded'); + } + }, { + key: 'selectItem', + value: function selectItem(item) { + var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var selected = this.container.querySelector('.ql-selected'); + if (item === selected) return; + if (selected != null) { + selected.classList.remove('ql-selected'); + } + if (item != null) { + item.classList.add('ql-selected'); + this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item); + if (item.hasAttribute('data-value')) { + this.label.setAttribute('data-value', item.getAttribute('data-value')); + } else { + this.label.removeAttribute('data-value'); + } + if (item.hasAttribute('data-label')) { + this.label.setAttribute('data-label', item.getAttribute('data-label')); + } else { + this.label.removeAttribute('data-label'); + } + if (trigger) { + if (typeof Event === 'function') { + this.select.dispatchEvent(new Event('change')); + } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') { + // IE11 + var event = document.createEvent('Event'); + event.initEvent('change', true, true); + this.select.dispatchEvent(event); + } + this.close(); + } + } else { + this.label.removeAttribute('data-value'); + this.label.removeAttribute('data-label'); + } + } + }, { + key: 'update', + value: function update() { + var option = void 0; + if (this.select.selectedIndex > -1) { + var 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); + } + var isActive = option != null && option !== this.select.querySelector('option[selected]'); + this.label.classList.toggle('ql-active', isActive); + } + }]); + + return Picker; + }(); + + exports.default = Picker; + +/***/ }, +/* 106 */ +/***/ function(module, exports) { + + module.exports = " "; + +/***/ }, +/* 107 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _picker = __webpack_require__(105); + + var _picker2 = _interopRequireDefault(_picker); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var ColorPicker = function (_Picker) { + _inherits(ColorPicker, _Picker); + + function ColorPicker(select, label) { + _classCallCheck(this, ColorPicker); + + var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select)); + + _this.label.innerHTML = label; + _this.container.classList.add('ql-color-picker'); + [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) { + item.classList.add('ql-primary'); + }); + return _this; + } + + _createClass(ColorPicker, [{ + key: 'buildItem', + value: function buildItem(option) { + var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option); + item.style.backgroundColor = option.getAttribute('value') || ''; + return item; + } + }, { + key: 'selectItem', + value: function selectItem(item, trigger) { + _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger); + var colorLabel = this.label.querySelector('.ql-color-label'); + var value = item ? item.getAttribute('data-value') || '' : ''; + if (colorLabel) { + if (colorLabel.tagName === 'line') { + colorLabel.style.stroke = value; + } else { + colorLabel.style.fill = value; + } + } + } + }]); + + return ColorPicker; + }(_picker2.default); + + exports.default = ColorPicker; + +/***/ }, +/* 108 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _picker = __webpack_require__(105); + + var _picker2 = _interopRequireDefault(_picker); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var IconPicker = function (_Picker) { + _inherits(IconPicker, _Picker); + + function IconPicker(select, icons) { + _classCallCheck(this, IconPicker); + + var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select)); + + _this.container.classList.add('ql-icon-picker'); + [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) { + item.innerHTML = icons[item.getAttribute('data-value') || '']; + }); + _this.defaultItem = _this.container.querySelector('.ql-selected'); + _this.selectItem(_this.defaultItem); + return _this; + } + + _createClass(IconPicker, [{ + key: 'selectItem', + value: function selectItem(item, trigger) { + _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger); + item = item || this.defaultItem; + this.label.innerHTML = item.innerHTML; + } + }]); + + return IconPicker; + }(_picker2.default); + + exports.default = IconPicker; + +/***/ }, +/* 109 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var Tooltip = function () { + function Tooltip(quill, boundsContainer) { + var _this = this; + + _classCallCheck(this, Tooltip); + + this.quill = quill; + this.boundsContainer = boundsContainer || document.body; + this.root = quill.addContainer('ql-tooltip'); + this.root.innerHTML = this.constructor.TEMPLATE; + var offset = parseInt(window.getComputedStyle(this.root).marginTop); + this.quill.root.addEventListener('scroll', function () { + _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + offset + 'px'; + _this.checkBounds(); + }); + this.hide(); + } + + _createClass(Tooltip, [{ + key: 'checkBounds', + value: function checkBounds() { + this.root.classList.toggle('ql-out-top', this.root.offsetTop <= 0); + this.root.classList.remove('ql-out-bottom'); + this.root.classList.toggle('ql-out-bottom', this.root.offsetTop + this.root.offsetHeight >= this.quill.root.offsetHeight); + } + }, { + key: 'hide', + value: function hide() { + this.root.classList.add('ql-hidden'); + } + }, { + key: 'position', + value: function position(reference) { + var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2; + var top = reference.bottom + this.quill.root.scrollTop; + this.root.style.left = left + 'px'; + this.root.style.top = top + 'px'; + var containerBounds = this.boundsContainer.getBoundingClientRect(); + var rootBounds = this.root.getBoundingClientRect(); + var shift = 0; + if (rootBounds.right > containerBounds.right) { + shift = containerBounds.right - rootBounds.right; + this.root.style.left = left + shift + 'px'; + } + if (rootBounds.left < containerBounds.left) { + shift = containerBounds.left - rootBounds.left; + this.root.style.left = left + shift + 'px'; + } + this.checkBounds(); + return shift; + } + }, { + key: 'show', + value: function show() { + this.root.classList.remove('ql-editing'); + this.root.classList.remove('ql-hidden'); + } + }]); + + return Tooltip; + }(); + + exports.default = Tooltip; + +/***/ }, +/* 110 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.BubbleTooltip = undefined; + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _extend = __webpack_require__(30); + + var _extend2 = _interopRequireDefault(_extend); + + var _emitter = __webpack_require__(36); + + var _emitter2 = _interopRequireDefault(_emitter); + + var _base = __webpack_require__(111); + + var _base2 = _interopRequireDefault(_base); + + var _selection = __webpack_require__(44); + + var _icons = __webpack_require__(73); + + var _icons2 = _interopRequireDefault(_icons); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']]; + + var BubbleTheme = function (_BaseTheme) { + _inherits(BubbleTheme, _BaseTheme); + + function BubbleTheme(quill, options) { + _classCallCheck(this, BubbleTheme); + + if (options.modules.toolbar != null && options.modules.toolbar.container == null) { + options.modules.toolbar.container = TOOLBAR_CONFIG; + } + + var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options)); + + _this.quill.container.classList.add('ql-bubble'); + return _this; + } + + _createClass(BubbleTheme, [{ + key: 'extendToolbar', + value: function extendToolbar(toolbar) { + this.tooltip = new BubbleTooltip(this.quill, this.options.bounds); + this.tooltip.root.appendChild(toolbar.container); + this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); + this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); + } + }]); + + return BubbleTheme; + }(_base2.default); + + BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + link: function link(value) { + if (!value) { + this.quill.format('link', false); + } else { + this.quill.theme.tooltip.edit(); + } + } + } + } + } + }); + + var BubbleTooltip = function (_BaseTooltip) { + _inherits(BubbleTooltip, _BaseTooltip); + + function BubbleTooltip(quill, bounds) { + _classCallCheck(this, BubbleTooltip); + + var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds)); + + _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range) { + if (type !== _emitter2.default.events.SELECTION_CHANGE) return; + if (range != null && range.length > 0) { + _this2.show(); + // Lock our width so we will expand beyond our offsetParent boundaries + _this2.root.style.left = '0px'; + _this2.root.style.width = ''; + _this2.root.style.width = _this2.root.offsetWidth + 'px'; + var lines = _this2.quill.scroll.lines(range.index, range.length); + if (lines.length === 1) { + _this2.position(_this2.quill.getBounds(range)); + } else { + var lastLine = lines[lines.length - 1]; + var index = lastLine.offset(_this2.quill.scroll); + var length = Math.min(lastLine.length() - 1, range.index + range.length - index); + var _bounds = _this2.quill.getBounds(new _selection.Range(index, length)); + _this2.position(_bounds); + } + } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) { + _this2.hide(); + } + }); + return _this2; + } + + _createClass(BubbleTooltip, [{ + key: 'listen', + value: function listen() { + var _this3 = this; + + _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this); + this.root.querySelector('.ql-close').addEventListener('click', function () { + _this3.root.classList.remove('ql-editing'); + }); + this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () { + // Let selection be restored by toolbar handlers before repositioning + setTimeout(function () { + if (_this3.root.classList.contains('ql-hidden')) return; + var range = _this3.quill.getSelection(); + if (range != null) { + _this3.position(_this3.quill.getBounds(range)); + } + }, 1); + }); + } + }, { + key: 'cancel', + value: function cancel() { + this.show(); + } + }, { + key: 'position', + value: function position(reference) { + var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference); + var arrow = this.root.querySelector('.ql-tooltip-arrow'); + arrow.style.marginLeft = ''; + if (shift === 0) return shift; + arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px'; + } + }]); + + return BubbleTooltip; + }(_base.BaseTooltip); + + BubbleTooltip.TEMPLATE = ['', '
    ', '', '', '
    '].join(''); + + exports.BubbleTooltip = BubbleTooltip; + exports.default = BubbleTheme; + +/***/ }, +/* 111 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.BaseTooltip = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _extend = __webpack_require__(30); + + var _extend2 = _interopRequireDefault(_extend); + + var _quillDelta = __webpack_require__(20); + + var _quillDelta2 = _interopRequireDefault(_quillDelta); + + var _emitter = __webpack_require__(36); + + var _emitter2 = _interopRequireDefault(_emitter); + + var _keyboard = __webpack_require__(56); + + var _keyboard2 = _interopRequireDefault(_keyboard); + + var _theme = __webpack_require__(45); + + var _theme2 = _interopRequireDefault(_theme); + + var _colorPicker = __webpack_require__(107); + + var _colorPicker2 = _interopRequireDefault(_colorPicker); + + var _iconPicker = __webpack_require__(108); + + var _iconPicker2 = _interopRequireDefault(_iconPicker); + + var _picker = __webpack_require__(105); + + var _picker2 = _interopRequireDefault(_picker); + + var _tooltip = __webpack_require__(109); + + var _tooltip2 = _interopRequireDefault(_tooltip); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var ALIGNS = [false, 'center', 'right', 'justify']; + + var 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"]; + + var FONTS = [false, 'serif', 'monospace']; + + var HEADERS = ['1', '2', '3', false]; + + var SIZES = ['small', false, 'large', 'huge']; + + var BaseTheme = function (_Theme) { + _inherits(BaseTheme, _Theme); + + function BaseTheme(quill, options) { + _classCallCheck(this, BaseTheme); + + var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options)); + + var listener = function listener(e) { + if (!document.body.contains(quill.root)) { + return document.body.removeEventListener('click', listener); + } + if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) { + _this.tooltip.hide(); + } + if (_this.pickers != null) { + _this.pickers.forEach(function (picker) { + if (!picker.container.contains(e.target)) { + picker.close(); + } + }); + } + }; + document.body.addEventListener('click', listener); + return _this; + } + + _createClass(BaseTheme, [{ + key: 'addModule', + value: function addModule(name) { + var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name); + if (name === 'toolbar') { + this.extendToolbar(module); + } + return module; + } + }, { + key: 'buildButtons', + value: function buildButtons(buttons, icons) { + buttons.forEach(function (button) { + var className = button.getAttribute('class') || ''; + className.split(/\s+/).forEach(function (name) { + if (!name.startsWith('ql-')) return; + name = name.slice('ql-'.length); + if (icons[name] == null) return; + if (name === 'direction') { + button.innerHTML = icons[name][''] + icons[name]['rtl']; + } else if (typeof icons[name] === 'string') { + button.innerHTML = icons[name]; + } else { + var value = button.value || ''; + if (value != null && icons[name][value]) { + button.innerHTML = icons[name][value]; + } + } + }); + }); + } + }, { + key: 'buildPickers', + value: function buildPickers(selects, icons) { + var _this2 = this; + + this.pickers = selects.map(function (select) { + if (select.classList.contains('ql-align')) { + if (select.querySelector('option') == null) { + fillSelect(select, ALIGNS); + } + return new _iconPicker2.default(select, icons.align); + } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) { + var format = select.classList.contains('ql-background') ? 'background' : 'color'; + if (select.querySelector('option') == null) { + fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000'); + } + return new _colorPicker2.default(select, icons[format]); + } else { + if (select.querySelector('option') == null) { + if (select.classList.contains('ql-font')) { + fillSelect(select, FONTS); + } else if (select.classList.contains('ql-header')) { + fillSelect(select, HEADERS); + } else if (select.classList.contains('ql-size')) { + fillSelect(select, SIZES); + } + } + return new _picker2.default(select); + } + }); + var update = function update() { + _this2.pickers.forEach(function (picker) { + picker.update(); + }); + }; + this.quill.on(_emitter2.default.events.SELECTION_CHANGE, update).on(_emitter2.default.events.SCROLL_OPTIMIZE, update); + } + }]); + + return BaseTheme; + }(_theme2.default); + + BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + formula: function formula() { + this.quill.theme.tooltip.edit('formula'); + }, + image: function image() { + var _this3 = this; + + var fileInput = this.container.querySelector('input.ql-image[type=file]'); + if (fileInput == null) { + fileInput = document.createElement('input'); + fileInput.setAttribute('type', 'file'); + fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon, image/svg+xml'); + fileInput.classList.add('ql-image'); + fileInput.addEventListener('change', function () { + if (fileInput.files != null && fileInput.files[0] != null) { + var reader = new FileReader(); + reader.onload = function (e) { + var range = _this3.quill.getSelection(true); + _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER); + fileInput.value = ""; + }; + reader.readAsDataURL(fileInput.files[0]); + } + }); + this.container.appendChild(fileInput); + } + fileInput.click(); + }, + video: function video() { + this.quill.theme.tooltip.edit('video'); + } + } + } + } + }); + + var BaseTooltip = function (_Tooltip) { + _inherits(BaseTooltip, _Tooltip); + + function BaseTooltip(quill, boundsContainer) { + _classCallCheck(this, BaseTooltip); + + var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer)); + + _this4.textbox = _this4.root.querySelector('input[type="text"]'); + _this4.listen(); + return _this4; + } + + _createClass(BaseTooltip, [{ + key: 'listen', + value: function listen() { + var _this5 = this; + + this.textbox.addEventListener('keydown', function (event) { + if (_keyboard2.default.match(event, 'enter')) { + _this5.save(); + event.preventDefault(); + } else if (_keyboard2.default.match(event, 'escape')) { + _this5.cancel(); + event.preventDefault(); + } + }); + } + }, { + key: 'cancel', + value: function cancel() { + this.hide(); + } + }, { + key: 'edit', + value: function edit() { + var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link'; + var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + this.root.classList.remove('ql-hidden'); + this.root.classList.add('ql-editing'); + if (preview != null) { + this.textbox.value = preview; + } else if (mode !== this.root.getAttribute('data-mode')) { + this.textbox.value = ''; + } + this.position(this.quill.getBounds(this.quill.selection.savedRange)); + this.textbox.select(); + this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || ''); + this.root.setAttribute('data-mode', mode); + } + }, { + key: 'restoreFocus', + value: function restoreFocus() { + var scrollTop = this.quill.root.scrollTop; + this.quill.focus(); + this.quill.root.scrollTop = scrollTop; + } + }, { + key: 'save', + value: function save() { + var value = this.textbox.value; + switch (this.root.getAttribute('data-mode')) { + case 'link': + { + var scrollTop = this.quill.root.scrollTop; + if (this.linkRange) { + this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER); + delete this.linkRange; + } else { + this.restoreFocus(); + this.quill.format('link', value, _emitter2.default.sources.USER); + } + this.quill.root.scrollTop = scrollTop; + break; + } + case 'video': + { + var match = value.match(/^(https?):\/\/(www\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || value.match(/^(https?):\/\/(www\.)?youtu\.be\/([a-zA-Z0-9_-]+)/); + if (match) { + value = match[1] + '://www.youtube.com/embed/' + match[3] + '?showinfo=0'; + } else if (match = value.match(/^(https?):\/\/(www\.)?vimeo\.com\/(\d+)/)) { + // eslint-disable-line no-cond-assign + value = match[1] + '://player.vimeo.com/video/' + match[3] + '/'; + } + } // eslint-disable-next-line no-fallthrough + case 'formula': + { + var range = this.quill.getSelection(true); + var index = range.index + range.length; + if (range != null) { + this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER); + if (this.root.getAttribute('data-mode') === 'formula') { + this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER); + } + this.quill.setSelection(index + 2, _emitter2.default.sources.USER); + } + break; + } + default: + } + this.textbox.value = ''; + this.hide(); + } + }]); + + return BaseTooltip; + }(_tooltip2.default); + + function fillSelect(select, values) { + var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + values.forEach(function (value) { + var option = document.createElement('option'); + if (value === defaultValue) { + option.setAttribute('selected', 'selected'); + } else { + option.setAttribute('value', value); + } + select.appendChild(option); + }); + } + + exports.BaseTooltip = BaseTooltip; + exports.default = BaseTheme; + +/***/ }, +/* 112 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _extend = __webpack_require__(30); + + var _extend2 = _interopRequireDefault(_extend); + + var _emitter = __webpack_require__(36); + + var _emitter2 = _interopRequireDefault(_emitter); + + var _base = __webpack_require__(111); + + var _base2 = _interopRequireDefault(_base); + + var _link = __webpack_require__(64); + + var _link2 = _interopRequireDefault(_link); + + var _selection = __webpack_require__(44); + + var _icons = __webpack_require__(73); + + var _icons2 = _interopRequireDefault(_icons); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']]; + + var SnowTheme = function (_BaseTheme) { + _inherits(SnowTheme, _BaseTheme); + + function SnowTheme(quill, options) { + _classCallCheck(this, SnowTheme); + + if (options.modules.toolbar != null && options.modules.toolbar.container == null) { + options.modules.toolbar.container = TOOLBAR_CONFIG; + } + + var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options)); + + _this.quill.container.classList.add('ql-snow'); + return _this; + } + + _createClass(SnowTheme, [{ + key: 'extendToolbar', + value: function extendToolbar(toolbar) { + toolbar.container.classList.add('ql-snow'); + this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); + this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); + this.tooltip = new SnowTooltip(this.quill, this.options.bounds); + if (toolbar.container.querySelector('.ql-link')) { + this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) { + toolbar.handlers['link'].call(toolbar, !context.format.link); + }); + } + } + }]); + + return SnowTheme; + }(_base2.default); + + SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + link: function link(value) { + if (value) { + var range = this.quill.getSelection(); + if (range == null || range.length == 0) return; + var preview = this.quill.getText(range); + if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) { + preview = 'mailto:' + preview; + } + var tooltip = this.quill.theme.tooltip; + tooltip.edit('link', preview); + } else { + this.quill.format('link', false); + } + } + } + } + } + }); + + var SnowTooltip = function (_BaseTooltip) { + _inherits(SnowTooltip, _BaseTooltip); + + function SnowTooltip(quill, bounds) { + _classCallCheck(this, SnowTooltip); + + var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds)); + + _this2.preview = _this2.root.querySelector('a.ql-preview'); + return _this2; + } + + _createClass(SnowTooltip, [{ + key: 'listen', + value: function listen() { + var _this3 = this; + + _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this); + this.root.querySelector('a.ql-action').addEventListener('click', function (event) { + if (_this3.root.classList.contains('ql-editing')) { + _this3.save(); + } else { + _this3.edit('link', _this3.preview.textContent); + } + event.preventDefault(); + }); + this.root.querySelector('a.ql-remove').addEventListener('click', function (event) { + if (_this3.linkRange != null) { + _this3.restoreFocus(); + _this3.quill.formatText(_this3.linkRange, 'link', false, _emitter2.default.sources.USER); + delete _this3.linkRange; + } + event.preventDefault(); + _this3.hide(); + }); + this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range) { + if (range == null) return; + if (range.length === 0) { + var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + link = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (link != null) { + _this3.linkRange = new _selection.Range(range.index - offset, link.length()); + var preview = _link2.default.formats(link.domNode); + _this3.preview.textContent = preview; + _this3.preview.setAttribute('href', preview); + _this3.show(); + _this3.position(_this3.quill.getBounds(_this3.linkRange)); + return; + } + } else { + delete _this3.linkRange; + } + _this3.hide(); + }); + } + }, { + key: 'show', + value: function show() { + _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this); + this.root.removeAttribute('data-mode'); + } + }]); + + return SnowTooltip; + }(_base.BaseTooltip); + + SnowTooltip.TEMPLATE = ['', '', '', ''].join(''); + + exports.default = SnowTheme; + +/***/ } +/******/ ]) +}); +; \ No newline at end of file diff -Nru bibledit-5.0.912/quill/1.1.5/quill.min.js bibledit-5.0.922/quill/1.1.5/quill.min.js --- bibledit-5.0.912/quill/1.1.5/quill.min.js 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.1.5/quill.min.js 2017-03-03 13:35:57.000000000 +0000 @@ -0,0 +1,41 @@ +/*! + * Quill Editor v1.1.5 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Quill=e():t.Quill=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}(function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))switch(typeof t[e]){case"function":break;case"object":t[e]=function(e){var n=e.slice(1),r=t[e[0]];return function(t,e,o){r.apply(this,[t,e,o].concat(n))}}(t[e]);break;default:t[e]=t[t[e]]}return t}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var o=n(1),i=r(o),l=n(49),a=n(52),s=n(57),u=n(58),c=r(u),f=n(59),p=r(f),h=n(60),d=r(h),y=n(50),v=n(51),b=n(53),g=n(54),m=n(61),_=r(m),O=n(62),w=r(O),x=n(63),k=r(x),E=n(64),j=r(E),A=n(65),N=r(A),q=n(66),T=r(q),P=n(67),S=r(P),L=n(68),C=r(L),M=n(28),R=r(M),I=n(69),B=r(I),D=n(70),U=r(D),H=n(71),F=r(H),K=n(72),z=r(K),Z=n(104),W=r(Z),V=n(106),Y=r(V),G=n(107),X=r(G),Q=n(108),$=r(Q),J=n(109),tt=r(J),et=n(111),nt=r(et);i.default.register({"attributors/attribute/direction":a.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":y.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":a.DirectionClass,"attributors/class/font":b.FontClass,"attributors/class/size":g.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":y.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":a.DirectionStyle,"attributors/style/font":b.FontStyle,"attributors/style/size":g.SizeStyle},!0),i.default.register({"formats/align":l.AlignClass,"formats/direction":a.DirectionClass,"formats/indent":s.IndentClass,"formats/background":y.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":b.FontClass,"formats/size":g.SizeClass,"formats/blockquote":c.default,"formats/code-block":R.default,"formats/header":p.default,"formats/list":d.default,"formats/bold":_.default,"formats/code":M.Code,"formats/italic":w.default,"formats/link":k.default,"formats/script":j.default,"formats/strike":N.default,"formats/underline":T.default,"formats/image":S.default,"formats/video":C.default,"formats/list/item":h.ListItem,"modules/formula":B.default,"modules/syntax":U.default,"modules/toolbar":F.default,"themes/bubble":tt.default,"themes/snow":nt.default,"ui/icons":z.default,"ui/picker":W.default,"ui/icon-picker":X.default,"ui/color-picker":Y.default,"ui/tooltip":$.default},!0),t.exports=i.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var o=n(2),i=r(o),l=n(18),a=r(l),s=n(29),u=r(s),c=n(31),f=r(c),p=n(46),h=r(p),d=n(35),y=r(d),v=n(32),b=r(v),g=n(33),m=r(g),_=n(47),O=r(_),w=n(34),x=r(w),k=n(48),E=r(k),j=n(55),A=r(j),N=n(56),q=r(N);a.default.register({"blots/block":u.default,"blots/block/embed":s.BlockEmbed,"blots/break":f.default,"blots/container":h.default,"blots/cursor":y.default,"blots/embed":b.default,"blots/inline":m.default,"blots/scroll":O.default,"blots/text":x.default,"modules/clipboard":E.default,"modules/history":A.default,"modules/keyboard":q.default}),i.default.register(u.default,f.default,y.default,m.default,O.default,x.default),t.exports=a.default},function(t,e,n){"use strict";var r=n(3),o=n(7),i=n(12),l=n(13),a=n(14),s=n(15),u=n(16),c=n(17),f=n(8),p=n(10),h=n(11),d=n(9),y=n(6),v={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:r.default,Format:o.default,Leaf:i.default,Embed:u.default,Scroll:l.default,Block:s.default,Inline:a.default,Text:c.default,Attributor:{Attribute:f.default,Class:p.default,Style:h.default,Store:d.default}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=v},function(t,e,n){"use strict";function r(t){var e=a.find(t);if(null==e)try{e=a.create(t)}catch(n){e=a.create(a.Scope.INLINE),[].slice.call(t.childNodes).forEach(function(t){e.domNode.appendChild(t)}),t.parentNode.replaceChild(e.domNode,t),e.attach()}return e}var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(4),l=n(5),a=n(6),s=function(t){function e(){t.apply(this,arguments)}return o(e,t),e.prototype.appendChild=function(t){this.insertBefore(t)},e.prototype.attach=function(){var e=this;t.prototype.attach.call(this),this.children=new i.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(t){try{var n=r(t);e.insertBefore(n,e.children.head)}catch(t){if(t instanceof a.ParchmentError)return;throw t}})},e.prototype.deleteAt=function(t,e){return 0===t&&e===this.length()?this.remove():void this.children.forEachAt(t,e,function(t,e,n){t.deleteAt(e,n)})},e.prototype.descendant=function(t,n){var r=this.children.find(n),o=r[0],i=r[1];return null==t.blotName&&t(o)||null!=t.blotName&&o instanceof t?[o,i]:o instanceof e?o.descendant(t,i):[null,-1]},e.prototype.descendants=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE);var o=[],i=r;return this.children.forEachAt(n,r,function(n,r,l){(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&o.push(n),n instanceof e&&(o=o.concat(n.descendants(t,r,i))),i-=l}),o},e.prototype.detach=function(){this.children.forEach(function(t){t.detach()}),t.prototype.detach.call(this)},e.prototype.formatAt=function(t,e,n,r){this.children.forEachAt(t,e,function(t,e,o){t.formatAt(e,o,n,r)})},e.prototype.insertAt=function(t,e,n){var r=this.children.find(t),o=r[0],i=r[1];if(o)o.insertAt(i,e,n);else{var l=null==n?a.create("text",e):a.create(e,n);this.appendChild(l)}},e.prototype.insertBefore=function(t,e){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(e){return t instanceof e}))throw new a.ParchmentError("Cannot insert "+t.statics.blotName+" into "+this.statics.blotName);t.insertInto(this,e)},e.prototype.length=function(){return this.children.reduce(function(t,e){return t+e.length()},0)},e.prototype.moveChildren=function(t,e){this.children.forEach(function(n){t.insertBefore(n,e)})},e.prototype.optimize=function(){if(t.prototype.optimize.call(this),0===this.children.length)if(null!=this.statics.defaultChild){var e=a.create(this.statics.defaultChild);this.appendChild(e),e.optimize()}else this.remove()},e.prototype.path=function(t,n){void 0===n&&(n=!1);var r=this.children.find(t,n),o=r[0],i=r[1],l=[[this,t]];return o instanceof e?l.concat(o.path(i,n)):(null!=o&&l.push([o,i]),l)},e.prototype.removeChild=function(t){this.children.remove(t)},e.prototype.replace=function(n){n instanceof e&&n.moveChildren(this),t.prototype.replace.call(this,n)},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(t,this.length(),function(t,r,o){t=t.split(r,e),n.appendChild(t)}),n},e.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},e.prototype.update=function(t){var e=this,n=[],o=[];t.forEach(function(t){t.target===e.domNode&&"childList"===t.type&&(n.push.apply(n,t.addedNodes),o.push.apply(o,t.removedNodes))}),o.forEach(function(t){if(!(null!=t.parentNode&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var n=a.find(t);null!=n&&(null!=n.domNode.parentNode&&n.domNode.parentNode!==e.domNode||n.detach())}}),n.filter(function(t){return t.parentNode==e.domNode}).sort(function(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(t){var n=null;null!=t.nextSibling&&(n=a.find(t.nextSibling));var o=r(t);o.next==n&&null!=o.next||(null!=o.parent&&o.parent.removeChild(e),e.insertBefore(o,n))})},e}(l.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=s},function(t,e){"use strict";var n=function(){function t(){this.head=this.tail=void 0,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=void 0,this.head=this.tail=t),this.length+=1},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var o=n.length();if(ta?n(r,t-a,Math.min(e,a+u-t)):n(r,0,Math.min(u,t+e-a)),a+=u}},t.prototype.map=function(t){return this.reduce(function(e,n){return e.push(t(n)),e},[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,n){"use strict";var r=n(6),o=function(){function t(t){this.domNode=t,this.attach()}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){this.domNode[r.DATA_KEY]={blot:this}},t.prototype.clone=function(){var t=this.domNode.cloneNode();return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){var n=this.isolate(t,e);n.remove()},t.prototype.formatAt=function(t,e,n,o){var i=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&o)i.wrap(n,o);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var l=r.create(this.statics.scope);i.wrap(l),l.format(n,o)}},t.prototype.insertAt=function(t,e,n){var o=null==n?r.create("text",e):r.create(e,n),i=this.split(t);this.parent.insertBefore(o,i)},t.prototype.insertInto=function(t,e){if(null!=this.parent&&this.parent.children.remove(this),t.children.insertBefore(this,e),null!=e)var n=e.domNode;null!=this.next&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t){void 0===t&&(t=[])},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=o},function(t,e){"use strict";function n(t,e){var n=o(t);if(null==n)throw new a("Unable to create "+t+" blot");var r=n,i=t instanceof Node?t:r.create(e);return new r(i,e)}function r(t,n){return void 0===n&&(n=!1),null==t?null:null!=t[e.DATA_KEY]?t[e.DATA_KEY].blot:n?r(t.parentNode,n):null}function o(t,e){void 0===e&&(e=p.ANY);var n;if("string"==typeof t)n=f[t]||s[t];else if(t instanceof Text)n=f.text;else if("number"==typeof t)t&p.LEVEL&p.BLOCK?n=f.block:t&p.LEVEL&p.INLINE&&(n=f.inline);else if(t instanceof HTMLElement){var r=(t.getAttribute("class")||"").split(/\s+/);for(var o in r)if(n=u[r[o]])break;n=n||c[t.tagName]}return null==n&&t instanceof Node&&console.log(t.nodeType),null==n?null:e&p.LEVEL&n.scope&&e&p.TYPE&n.scope?n:null}function i(){for(var t=[],e=0;e1)return t.map(function(t){return i(t)});var n=t[0];if("string"!=typeof n.blotName&&"string"!=typeof n.attrName)throw new a("Invalid definition");if("abstract"===n.blotName)throw new a("Cannot register abstract class");if(f[n.blotName||n.attrName]=n,"string"==typeof n.keyName)s[n.keyName]=n;else if(null!=n.className&&(u[n.className]=n),null!=n.tagName){Array.isArray(n.tagName)?n.tagName=n.tagName.map(function(t){return t.toUpperCase()}):n.tagName=n.tagName.toUpperCase();var r=Array.isArray(n.tagName)?n.tagName:[n.tagName];r.forEach(function(t){null!=c[t]&&null!=n.className||(c[t]=n)})}return n}var l=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},a=function(t){function e(e){e="[Parchment] "+e,t.call(this,e),this.message=e,this.name=this.constructor.name}return l(e,t),e}(Error);e.ParchmentError=a;var s={},u={},c={},f={};e.DATA_KEY="__blot",function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(e.Scope||(e.Scope={}));var p=e.Scope;e.create=n,e.find=r,e.query=o,e.register=i},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(8),i=n(9),l=n(3),a=n(6),s=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.formats=function(t){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)},e.prototype.attach=function(){t.prototype.attach.call(this),this.attributes=new i.default(this.domNode)},e.prototype.format=function(t,e){var n=a.query(t);n instanceof o.default?this.attributes.attribute(n,e):e&&(null==n||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e))},e.prototype.formats=function(){var t=this.attributes.values(),e=this.statics.formats(this.domNode);return null!=e&&(t[this.statics.blotName]=e),t},e.prototype.replaceWith=function(e,n){var r=t.prototype.replaceWith.call(this,e,n);return this.attributes.copy(r),r},e.prototype.update=function(e){var n=this;t.prototype.update.call(this,e),e.some(function(t){return t.target===n.domNode&&"attributes"===t.type})&&this.attributes.build()},e.prototype.wrap=function(n,r){var o=t.prototype.wrap.call(this,n,r);return o instanceof e&&o.statics.scope===this.statics.scope&&this.attributes.move(o),o},e}(l.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=s},function(t,e,n){"use strict";var r=n(6),o=function(){function t(t,e,n){void 0===n&&(n={}),this.attrName=t,this.keyName=e;var o=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|o:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return t.keys=function(t){return[].map.call(t.attributes,function(t){return t.name})},t.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)},t.prototype.canAdd=function(t,e){var n=r.query(t,r.Scope.BLOT&(this.scope|r.Scope.TYPE));return null!=n&&(null==this.whitelist||this.whitelist.indexOf(e)>-1)},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){return t.getAttribute(this.keyName)},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=o},function(t,e,n){"use strict";var r=n(8),o=n(10),i=n(11),l=n(6),a=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=o.default.keys(this.domNode),a=i.default.keys(this.domNode);e.concat(n).concat(a).forEach(function(e){var n=l.query(e,l.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)})},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach(function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)})},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach(function(t){e.attributes[t].remove(e.domNode)}),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce(function(e,n){return e[n]=t.attributes[n].value(t.domNode),e},{})},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=a},function(t,e,n){"use strict";function r(t,e){var n=t.getAttribute("class")||"";return n.split(/\s+/).filter(function(t){return 0===t.indexOf(e+"-")})}var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(8),l=function(t){function e(){t.apply(this,arguments)}return o(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){var e=r(t,this.keyName);e.forEach(function(e){t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=r(t,this.keyName)[0]||"";return e.slice(this.keyName.length+1)},e}(i.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},function(t,e,n){"use strict";function r(t){var e=t.split("-"),n=e.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return e[0]+n}var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(8),l=function(t){function e(){t.apply(this,arguments)}return o(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map(function(t){var e=t.split(":");return e[0].trim()})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[r(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[r(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){return t.style[r(this.keyName)]},e}(i.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(5),i=n(6),l=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.value=function(t){return!0},e.prototype.index=function(t,e){return t!==this.domNode?-1:Math.min(e,1)},e.prototype.position=function(t,e){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){return t={},t[this.statics.blotName]=this.statics.value(this.domNode)||!0,t;var t},e.scope=i.Scope.INLINE_BLOT,e}(o.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(3),i=n(6),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},a=100,s=function(t){function e(e){var n=this;t.call(this,e),this.parent=null,this.observer=new MutationObserver(function(t){n.update(t)}),this.observer.observe(this.domNode,l)}return r(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach(function(t){t.remove()}):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,o){this.update(),t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e){var n=this;void 0===e&&(e=[]),t.prototype.optimize.call(this),e.push.apply(e,this.observer.takeRecords());for(var r=function(t,e){void 0===e&&(e=!0),null!=t&&t!==n&&null!=t.domNode.parentNode&&(null==t.domNode[i.DATA_KEY].mutations&&(t.domNode[i.DATA_KEY].mutations=[]),e&&r(t.parent))},l=function(t){null!=t.domNode[i.DATA_KEY]&&null!=t.domNode[i.DATA_KEY].mutations&&(t instanceof o.default&&t.children.forEach(l),t.optimize())},s=e,u=0;s.length>0;u+=1){if(u>=a)throw new Error("[Parchment] Maximum optimize iterations reached");s.forEach(function(t){var e=i.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(r(i.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,function(t){var e=i.find(t,!1);r(e,!1),e instanceof o.default&&e.children.forEach(function(t){r(t,!1)})})):"attributes"===t.type&&r(e.prev)),r(e))}),this.children.forEach(l),s=this.observer.takeRecords(),e.push.apply(e,s)}},e.prototype.update=function(e){var n=this;e=e||this.observer.takeRecords(),e.map(function(t){var e=i.find(t.target,!0);if(null!=e)return null==e.domNode[i.DATA_KEY].mutations?(e.domNode[i.DATA_KEY].mutations=[t],e):(e.domNode[i.DATA_KEY].mutations.push(t),null)}).forEach(function(t){null!=t&&t!==n&&null!=t.domNode[i.DATA_KEY]&&t.update(t.domNode[i.DATA_KEY].mutations||[])}),null!=this.domNode[i.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[i.DATA_KEY].mutations),this.optimize(e)},e.blotName="scroll",e.defaultChild="block",e.scope=i.Scope.BLOCK_BLOT,e.tagName="DIV",e}(o.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=s},function(t,e,n){"use strict";function r(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(7),l=n(6),a=function(t){function e(){t.apply(this,arguments)}return o(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach(function(t){t instanceof i.default||(t=t.wrap(e.blotName,!0)),o.attributes.copy(t)}),this.unwrap())},e.prototype.formatAt=function(e,n,r,o){if(null!=this.formats()[r]||l.query(r,l.Scope.ATTRIBUTE)){var i=this.isolate(e,n);i.format(r,o)}else t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.optimize=function(){t.prototype.optimize.call(this);var n=this.formats();if(0===Object.keys(n).length)return this.unwrap();var o=this.next;o instanceof e&&o.prev===this&&r(n,o.formats())&&(o.moveChildren(this),o.remove())},e.blotName="inline",e.scope=l.Scope.INLINE_BLOT,e.tagName="SPAN",e}(i.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=a},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(7),i=n(6),l=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.formats=function(n){var r=i.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=i.query(n,i.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,o){null!=i.query(r,i.Scope.BLOCK)?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=i.query(n,i.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var o=this.split(e),l=i.create(n,r);o.parent.insertBefore(l,o)}},e.blotName="block",e.scope=i.Scope.BLOCK_BLOT,e.tagName="P",e}(o.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(12),i=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,o){0===e&&n===this.length()?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(o.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(12),i=n(6),l=function(t){function e(e){t.call(this,e),this.text=this.statics.value(this.domNode)}return r(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){return t.data},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(){t.prototype.optimize.call(this),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=i.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t){var e=this;t.some(function(t){return"characterData"===t.type&&t.target===e.domNode})&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=i.Scope.INLINE_BLOT,e}(o.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(e=(0,j.default)(!0,{container:t,modules:{clipboard:!0,keyboard:!0,history:!0}},e),e.theme&&e.theme!==S.DEFAULTS.theme){if(e.theme=S.import("themes/"+e.theme),null==e.theme)throw new Error("Invalid theme "+e.theme+". Did you register it?")}else e.theme=T.default;var n=(0,j.default)(!0,{},e.theme.DEFAULTS);[n,e].forEach(function(t){t.modules=t.modules||{},Object.keys(t.modules).forEach(function(e){t.modules[e]===!0&&(t.modules[e]={})})});var r=Object.keys(n.modules).concat(Object.keys(e.modules)),o=r.reduce(function(t,e){var n=S.import("modules/"+e);return null==n?P.error("Cannot load "+e+" module. Are you sure you registered it?"):t[e]=n.DEFAULTS||{},t},{});return null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar}),e=(0,j.default)(!0,{},S.DEFAULTS,{modules:o},n,e),["bounds","container"].forEach(function(t){"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),e.modules=Object.keys(e.modules).reduce(function(t,n){return e.modules[n]&&(t[n]=e.modules[n]),t},{}),e}function a(t,e,n,r){if(!this.options.strict&&!this.isEnabled()&&e===g.default.sources.USER)return new d.default;var o=null==n?null:this.getSelection(),i=this.editor.delta,l=t();if(null!=o&&(n===!0&&(n=o.index),null==r?o=u(o,l,e):0!==r&&(o=u(o,n,r,e)),this.setSelection(o,g.default.sources.SILENT)),l.length()>0){var a,s=[g.default.events.TEXT_CHANGE,l,i,e];if((a=this.emitter).emit.apply(a,[g.default.events.EDITOR_CHANGE].concat(s)),e!==g.default.sources.SILENT){var c;(c=this.emitter).emit.apply(c,s)}}return l}function s(t,e,n,r,o){var i={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(o=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(o=r,r=n,n=e,e=0),"object"===("undefined"==typeof n?"undefined":c(n))?(i=n,o=r):"string"==typeof n&&(null!=r?i[n]=r:o=n),o=o||g.default.sources.API,[t,e,i,o]}function u(t,e,n,r){if(null==t)return null;var o=void 0,i=void 0;if(e instanceof d.default){var l=[t.index,t.index+t.length].map(function(t){return e.transformPosition(t,r===g.default.sources.USER)}),a=f(l,2);o=a[0],i=a[1]}else{var s=[t.index,t.index+t.length].map(function(t){return t=0?t+n:Math.max(e,t+n)}),u=f(s,2);o=u[0],i=u[1]}return new x.Range(o,i-o)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=void 0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(i(this,t),this.options=l(e,r),this.container=this.options.container,null==this.container)return P.error("Invalid Quill container",e);this.options.debug&&t.debug(this.options.debug);var o=this.container.innerHTML.trim(); +this.container.classList.add("ql-container"),this.container.innerHTML="",this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new g.default,this.scroll=w.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new v.default(this.scroll),this.selection=new k.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(g.default.events.EDITOR_CHANGE,function(t){t===g.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(g.default.events.SCROLL_UPDATE,function(t,e){var r=n.selection.lastRange,o=r&&0===r.length?r.index:void 0;a.call(n,function(){return n.editor.update(null,e,o)},t)});var s=this.clipboard.convert("
    "+o+"


    ");this.setContents(s),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return p(t,null,[{key:"debug",value:function(t){t===!0&&(t="log"),N.default.level(t)}},{key:"import",value:function(t){return null==this.imports[t]&&P.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){var o=t.attrName||t.blotName;"string"==typeof o?this.register("formats/"+o,t,e):Object.keys(t).forEach(function(r){n.register(r,t[r],e)})}else null==this.imports[t]||r||P.warn("Overwriting "+t+" with",e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName&&w.default.register(e)}}]),p(t,[{key:"addContainer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){var n=t;t=document.createElement("div"),t.classList.add(n)}return this.container.insertBefore(t,e),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,n){var r=this,o=s(t,e,n),i=f(o,4);return t=i[0],e=i[1],n=i[3],a.call(this,function(){return r.editor.deleteText(t,e)},n,t,-1*e)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t),t||this.blur()}},{key:"focus",value:function(){this.selection.focus(),this.selection.scrollIntoView()}},{key:"format",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g.default.sources.API;return a.call(this,function(){var r=n.getSelection(!0),i=new d.default;if(null==r)return i;if(w.default.query(t,w.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,o({},t,e));else{if(0===r.length)return n.selection.format(t,e),i;i=n.editor.formatText(r.index,r.length,o({},t,e))}return n.setSelection(r,g.default.sources.SILENT),i},r)}},{key:"formatLine",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,e,n,r,o),c=f(u,4);return t=c[0],e=c[1],l=c[2],o=c[3],a.call(this,function(){return i.editor.formatLine(t,e,l)},o,t,0)}},{key:"formatText",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,e,n,r,o),c=f(u,4);return t=c[0],e=c[1],l=c[2],o=c[3],a.call(this,function(){return i.editor.formatText(t,e,l)},o,t,0)}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length)}},{key:"getContents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=s(t,e),r=f(n,2);return t=r[0],e=r[1],this.editor.getContents(t,e)}},{key:"getFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=s(t,e),r=f(n,2);return t=r[0],e=r[1],this.editor.getText(t,e)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.sources.API;return a.call(this,function(){return o.editor.insertEmbed(e,n,r)},i,e)}},{key:"insertText",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,0,n,r,o),c=f(u,4);return t=c[0],l=c[2],o=c[3],a.call(this,function(){return i.editor.insertText(t,e,l)},o,t,e.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}},{key:"removeFormat",value:function(t,e,n){var r=this,o=s(t,e,n),i=f(o,4);return t=i[0],e=i[1],n=i[3],a.call(this,function(){return r.editor.removeFormat(t,e)},n,t)}},{key:"setContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API;return a.call(this,function(){t=new d.default(t);var n=e.getLength(),r=e.editor.deleteText(0,n),o=e.editor.applyDelta(t),i=o.ops[o.ops.length-1];null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(e.editor.deleteText(e.getLength()-1,1),o.delete(1));var l=r.compose(o);return l},n)}},{key:"setSelection",value:function(e,n,r){if(null==e)this.selection.setRange(null,n||t.sources.API);else{var o=s(e,n,r),i=f(o,4);e=i[0],n=i[1],r=i[3],this.selection.setRange(new x.Range(e,n),r)}this.selection.scrollIntoView()}},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API,n=(new d.default).insert(t);return this.setContents(n,e)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.default.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}},{key:"updateContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API;return a.call(this,function(){return t=new d.default(t),e.editor.applyDelta(t,n)},n,!0)}}]),t}();S.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,strict:!0,theme:"default"},S.events=g.default.events,S.sources=g.default.sources,S.version="1.1.5",S.imports={delta:d.default,parchment:w.default,"core/module":_.default,"core/theme":T.default},e.expandConfig=l,e.overload=s,e.default=S},function(t,e){"use strict";var n=document.createElement("div");n.classList.toggle("test-class",!1),n.classList.contains("test-class")&&!function(){var t=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,n){return arguments.length>1&&!this.contains(e)==!n?n:t.call(this,e)}}(),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return r!==-1&&r===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function t(e){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var t,n=Object(this),r=n.length>>>0,o=arguments[1],i=0;i0&&(n.attributes=e),this.push(n))},s.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},s.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},s.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=i(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,n=this.ops[e-1],"object"!=typeof n))return this.ops.unshift(t),this;if(o(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},s.prototype.filter=function(t){return this.ops.filter(t)},s.prototype.forEach=function(t){this.ops.forEach(t)},s.prototype.map=function(t){return this.ops.map(t)},s.prototype.partition=function(t){var e=[],n=[];return this.forEach(function(r){var o=t(r)?e:n;o.push(r)}),[e,n]},s.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},s.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},s.prototype.length=function(){return this.reduce(function(t,e){return t+l.length(e)},0)},s.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var n=[],r=l.iterator(this.ops),o=0;o0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},s.prototype.diff=function(t,e){if(this.ops===t.ops)return new s;var n=[this,t].map(function(e){return e.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:a;var r=e===t?"on":"with";throw new Error("diff() called "+r+" non-document")}).join("")}),i=new s,u=r(n[0],n[1],e),c=l.iterator(this.ops),f=l.iterator(t.ops);return u.forEach(function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case r.INSERT:n=Math.min(f.peekLength(),e),i.push(f.next(n));break;case r.DELETE:n=Math.min(e,c.peekLength()),c.next(n),i.delete(n);break;case r.EQUAL:n=Math.min(c.peekLength(),f.peekLength(),e);var a=c.next(n),s=f.next(n);o(a.insert,s.insert)?i.retain(n,l.attributes.diff(a.attributes,s.attributes)):i.push(s).delete(n)}e-=n}}),i.chop()},s.prototype.eachLine=function(t,e){e=e||"\n";for(var n=l.iterator(this.ops),r=new s;n.hasNext();){if("insert"!==n.peekType())return;var o=n.peek(),i=l.length(o)-n.peekLength(),a="string"==typeof o.insert?o.insert.indexOf(e,i)-i:-1;a<0?r.push(n.next()):a>0?r.push(n.next(a)):(t(r,n.next(1).attributes||{}),r=new s)}r.length()>0&&t(r,{})},s.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=l.iterator(this.ops),r=l.iterator(t.ops),o=new s;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())o.push(r.next());else{var i=Math.min(n.peekLength(),r.peekLength()),a=n.next(i),u=r.next(i);if(a.delete)continue;u.delete?o.push(u):o.retain(i,l.attributes.transform(a.attributes,u.attributes,e))}else o.retain(l.length(n.next()));return o.chop()},s.prototype.transformPosition=function(t,e){e=!!e;for(var n=l.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(re.length?t:e,l=t.length>e.length?e:t,a=i.indexOf(l);if(a!=-1)return r=[[d,i.substring(0,a)],[y,l],[d,i.substring(a+l.length)]],t.length>e.length&&(r[0][0]=r[2][0]=h),r;if(1==l.length)return[[h,t],[d,e]];var u=s(t,e);if(u){var c=u[0],f=u[1],p=u[2],v=u[3],b=u[4],g=n(c,p),m=n(f,v);return g.concat([[y,b]],m)}return o(t,e)}function o(t,e){for(var n=t.length,r=e.length,o=Math.ceil((n+r)/2),l=o,a=2*o,s=new Array(a),u=new Array(a),c=0;cn)v+=2;else if(x>r)y+=2;else if(p){var k=l+f-_;if(k>=0&&k=E)return i(t,e,O,x)}}}for(var j=-m+b;j<=m-g;j+=2){var E,k=l+j;E=j==-m||j!=m&&u[k-1]n)g+=2;else if(A>r)b+=2;else if(!p){var w=l+f-j;if(w>=0&&w=E)return i(t,e,O,x)}}}}return[[h,t],[d,e]]}function i(t,e,r,o){var i=t.substring(0,r),l=e.substring(0,o),a=t.substring(r),s=e.substring(o),u=n(i,l),c=n(a,s);return u.concat(c)}function l(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),o=r,i=0;n=t.length?[r,o,i,s,f]:null}var r=t.length>e.length?t:e,o=t.length>e.length?e:t;if(r.length<4||2*o.lengthu[4].length?s:u:s;var c,f,p,h;t.length>e.length?(c=i[0],f=i[1],p=i[2],h=i[3]):(p=i[0],h=i[1],c=i[2],f=i[3]);var d=i[4];return[c,f,p,h,d]}function u(t){t.push([y,""]);for(var e,n=0,r=0,o=0,i="",s="";n1?(0!==r&&0!==o&&(e=l(s,i),0!==e&&(n-r-o>0&&t[n-r-o-1][0]==y?t[n-r-o-1][1]+=s.substring(0,e):(t.splice(0,0,[y,s.substring(0,e)]),n++),s=s.substring(e),i=i.substring(e)),e=a(s,i),0!==e&&(t[n][1]=s.substring(s.length-e)+t[n][1],s=s.substring(0,s.length-e),i=i.substring(0,i.length-e))),0===r?t.splice(n-o,r+o,[d,s]):0===o?t.splice(n-r,r+o,[h,i]):t.splice(n-r-o,r+o,[h,i],[d,s]),n=n-r-o+(r?1:0)+(o?1:0)+1):0!==n&&t[n-1][0]==y?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,o=0,r=0,i="",s=""}""===t[t.length-1][1]&&t.pop();var c=!1;for(n=1;n0&&r.splice(o+2,0,[l[0],a]),p(r,o,3)}return t}function p(t,e,n){for(var r=e+n-1;r>=0&&r>=e-1;r--)if(r+10?r:void 0},diff:function(t,e){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce(function(n,r){return o(t[r],e[r])||(n[r]=void 0===e[r]?null:e[r]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce(function(n,r){return void 0===t[r]&&(n[r]=e[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(t){return new r(t)},length:function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}};r.prototype.hasNext=function(){return this.peekLength()<1/0},r.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=l.length(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(n,t):o.insert=e.insert,o}return{retain:1/0}},r.prototype.peek=function(){return this.ops[this.index]},r.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},r.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.exports=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){return Object.keys(e).reduce(function(n,r){return null==t[r]?n:(e[r]===t[r]?n[r]=e[r]:Array.isArray(e[r])?e[r].indexOf(t[r])<0&&(n[r]=e[r].concat([t[r]])):n[r]=[e[r],t[r]],n)},{})}function a(t){return t.reduce(function(t,e){if(1===e.insert){var n=(0,k.default)(e.attributes);return delete n.image,t.insert({image:e.attributes.image},n)}if(null==e.attributes||e.attributes.list!==!0&&e.attributes.bullet!==!0||(e=(0,k.default)(e),e.attributes.list?e.attributes.list="ordered":(e.attributes.list="bullet",delete e.attributes.bullet)),"string"==typeof e.insert){var r=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(r,e.attributes)}return t.push(e)},new p.default)}Object.defineProperty(e,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function t(t,e){for(var n=0;n=r&&!a.endsWith("\n")&&(n=!0),e.scroll.insertAt(t,a);var c=e.scroll.line(t),f=u(c,2),p=f[0],h=f[1],y=(0,N.default)({},(0,O.bubbleFormats)(p));if(p instanceof w.default){var b=p.descendant(v.default.Leaf,h),g=u(b,1),m=g[0];y=(0,N.default)(y,(0,O.bubbleFormats)(m))}l=d.default.attributes.diff(y,l)||{}}else if("object"===s(o.insert)){var _=Object.keys(o.insert)[0];if(null==_)return t;e.scroll.insertAt(t,_,o.insert[_])}r+=i}return Object.keys(l).forEach(function(n){e.scroll.formatAt(t,i,n,l[n])}),t+i},0),t.reduce(function(t,n){return"number"==typeof n.delete?(e.scroll.deleteAt(t,n.delete),t):t+(n.retain||n.insert.length||1)},0),this.scroll.batch=!1,this.scroll.optimize(),this.update(t)}},{key:"deleteText",value:function(t,e){return this.scroll.deleteAt(t,e),this.update((new p.default).retain(t).delete(e))}},{key:"formatLine",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(o){var i=n.scroll.lines(t,Math.max(e,1)),l=e;i.forEach(function(e){var i=e.length();if(e instanceof g.default){var a=t-e.offset(n.scroll),s=e.newlineIndex(a+l)-a+1;e.formatAt(a,s,o,r[o])}else e.format(o,r[o]);l-=i})}),this.scroll.optimize(),this.update((new p.default).retain(t).retain(e,(0,k.default)(r)))}},{key:"formatText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e,o,r[o])}),this.update((new p.default).retain(t).retain(e,(0,k.default)(r)))}},{key:"getContents",value:function(t,e){return this.delta.slice(t,t+e)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(t,e){return t.concat(e.delta())},new p.default)}},{key:"getFormat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===e?this.scroll.path(t).forEach(function(t){var e=u(t,1),o=e[0];o instanceof w.default?n.push(o):o instanceof v.default.Leaf&&r.push(o)}):(n=this.scroll.lines(t,e),r=this.scroll.descendants(v.default.Leaf,t,e));var o=[n,r].map(function(t){if(0===t.length)return{};for(var e=(0,O.bubbleFormats)(t.shift());Object.keys(e).length>0;){var n=t.shift();if(null==n)return e;e=l((0,O.bubbleFormats)(n),e)}return e});return N.default.apply(N.default,o)}},{key:"getText",value:function(t,e){return this.getContents(t,e).filter(function(t){return"string"==typeof t.insert}).map(function(t){return t.insert}).join("")}},{key:"insertEmbed",value:function(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new p.default).retain(t).insert(o({},e,n)))}},{key:"insertText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e.length,o,r[o])}),this.update((new p.default).retain(t).insert(e,(0,k.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var t=this.scroll.children.head;return t.length()<=1&&0==Object.keys(t.formats()).length}},{key:"removeFormat",value:function(t,e){var n=this.getText(t,e),r=this.scroll.line(t+e),o=u(r,2),i=o[0],l=o[1],a=0,s=new p.default;null!=i&&(a=i instanceof g.default?i.newlineIndex(l)-l+1:i.length()-l,s=i.delta().slice(l,l+a-1).insert("\n"));var c=this.getContents(t,e+a),f=c.diff((new p.default).insert(n).concat(s)),h=(new p.default).retain(t).concat(f);return this.applyDelta(h)}},{key:"update",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=this.delta;return 1===n.length&&"characterData"===n[0].type&&v.default.find(n[0].target)?!function(){var i=v.default.find(n[0].target),l=(0,O.bubbleFormats)(i),a=i.offset(e.scroll),s=n[0].oldValue.replace(_.default.CONTENTS,""),u=(new p.default).insert(s),c=(new p.default).insert(i.value()),f=(new p.default).retain(a).concat(u.diff(c,r));t=f.reduce(function(t,e){return e.insert?t.insert(e.insert,l):t.push(e)},new p.default),e.delta=o.compose(t)}():(this.delta=this.getDelta(),t&&(0,j.default)(o.compose(t),this.delta)||(t=o.diff(this.delta,r))),t}}]),t}();e.default=q},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function t(t,e){for(var n=0;n=t+n)){var l=this.newlineIndex(t,!0)+1,a=i-l+1,s=this.isolate(l,a),u=s.next;s.format(r,o),u instanceof e&&u.formatAt(0,t-l+n-a,r,o)}}}},{key:"insertAt",value:function(t,e,n){if(null==n){var r=this.descendant(m.default,t),o=a(r,2),i=o[0],l=o[1];i.insertAt(l,e)}}},{key:"length",value:function t(){var t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}},{key:"newlineIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var n=this.domNode.textContent.slice(t).indexOf("\n");return n>-1?t+n:-1}},{key:"optimize",value:function(){this.domNode.textContent.endsWith("\n")||this.appendChild(h.default.create("text","\n")),u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this);var t=this.next;null!=t&&t.prev===this&&t.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===t.statics.formats(t.domNode)&&(t.optimize(),t.moveChildren(this),t.remove())}},{key:"replace",value:function(t){u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(t){var e=h.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof h.default.Embed?e.remove():e.unwrap()})}}],[{key:"create",value:function(t){var n=u(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t); +return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),e}(y.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",e.Code=_,e.default=O},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=(0,f.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:a(t.parent,e))}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BlockEmbed=e.bubbleFormats=void 0;var s=function(){function t(t,e){for(var n=0;n0&&(t1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-k)){var r=this.clone();return 0===t?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"split",this).call(this,t,n);return this.cache={},o}}]),e}(y.default.Block);j.blotName="block",j.tagName="P",j.defaultChild="break",j.allowedChildren=[O.default,m.default,x.default],e.bubbleFormats=a,e.BlockEmbed=E,e.default=j},25,function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n0){var t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}],[{key:"compare",value:function(t,n){var r=e.order.indexOf(t),o=e.order.indexOf(n);return r>=0||o>=0?r-o:t===n?0:t1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};n(this,t),this.quill=e,this.options=r};r.DEFAULTS={},e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:0;i(this,t),this.index=e,this.length=n},O=function(){function t(e,n){var r=this;i(this,t),this.emitter=n,this.scroll=e,this.composing=!1,this.root=this.scroll.domNode,this.root.addEventListener("compositionstart",function(){r.composing=!0}),this.root.addEventListener("compositionend",function(){r.composing=!1}),this.cursor=c.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),["keyup","mouseup","mouseleave","touchend","touchleave","focus","blur"].forEach(function(t){r.root.addEventListener(t,function(){setTimeout(r.update.bind(r,v.default.sources.USER),100)})}),this.emitter.on(v.default.events.EDITOR_CHANGE,function(t,e){t===v.default.events.TEXT_CHANGE&&e.length()>0&&r.update(v.default.sources.SILENT)}),this.emitter.on(v.default.events.SCROLL_BEFORE_UPDATE,function(){var t=r.getNativeRange();null!=t&&t.start.node!==r.cursor.textNode&&r.emitter.once(v.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(t){}})}),this.update(v.default.sources.SILENT)}return s(t,[{key:"focus",value:function(){if(!this.hasFocus()){var t=document.body.scrollTop;this.root.focus(),document.body.scrollTop=t,this.setRange(this.savedRange)}}},{key:"format",value:function(t,e){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!c.default.query(t,c.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=c.default.find(n.start.node,!1);if(null==r)return;if(r instanceof c.default.Leaf){var o=r.split(n.start.offset);r.parent.insertBefore(this.cursor,o)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;var r=void 0,o=void 0,i=this.scroll.leaf(t),l=a(i,2),s=l[0],u=l[1];if(null==s)return null;var c=s.position(u,!0),f=a(c,2);o=f[0],u=f[1];var p=document.createRange();if(e>0){p.setStart(o,u);var h=this.scroll.leaf(t+e),d=a(h,2);if(s=d[0],u=d[1],null==s)return null;var y=s.position(u,!0),v=a(y,2);o=v[0],u=v[1],p.setEnd(o,u),r=p.getBoundingClientRect()}else{var b="left",g=void 0;o instanceof Text?(u0&&(b="right")),r={height:g.height,left:g[b],width:0,top:g.top}}var m=this.root.parentNode.getBoundingClientRect();return{left:r.left-m.left,right:r.left+r.width-m.left,top:r.top-m.top,bottom:r.top+r.height-m.top,height:r.height,width:r.width}}},{key:"getNativeRange",value:function(){var t=document.getSelection();if(null==t||t.rangeCount<=0)return null;var e=t.getRangeAt(0);if(null==e)return null;if(!l(this.root,e.startContainer)||!e.collapsed&&!l(this.root,e.endContainer))return null;var n={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[n.start,n.end].forEach(function(t){for(var e=t.node,n=t.offset;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;e=e.lastChild,n=e instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n}),m.info("getNativeRange",n),n}},{key:"getRange",value:function(){var t=this,e=this.getNativeRange();if(null==e)return[null,null];var n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);var r=n.map(function(e){var n=a(e,2),r=n[0],o=n[1],i=c.default.find(r,!0),l=i.offset(t.scroll);return 0===o?l:i instanceof c.default.Container?l+i.length():l+i.index(r,o)}),i=Math.min.apply(Math,o(r)),l=Math.max.apply(Math,o(r));return[new _(i,l-i),e]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"scrollIntoView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.lastRange;if(null!=t){var e=this.getBounds(t.index,t.length);if(null!=e)if(this.root.offsetHeight2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(m.info("setNativeRange",t,e,n,r),null==t||null!=this.root.parentNode&&null!=t.parentNode&&null!=n.parentNode){var i=document.getSelection();if(null!=i)if(null!=t){this.hasFocus()||this.root.focus();var l=this.getNativeRange();if(null==l||o||t!==l.start.node||e!==l.start.offset||n!==l.end.node||r!==l.end.offset){var a=document.createRange();a.setStart(t,e),a.setEnd(n,r),i.removeAllRanges(),i.addRange(a)}}else i.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v.default.sources.API;"string"==typeof n&&(r=n,n=!1),m.info("setRange",t),null!=t?!function(){var r=t.collapsed?[t.index]:[t.index,t.index+t.length],i=[],l=e.scroll.length();r.forEach(function(t,n){t=Math.min(l-1,t);var r=void 0,o=e.scroll.leaf(t),s=a(o,2),u=s[0],c=s[1],f=u.position(c,0!==n),p=a(f,2);r=p[0],c=p[1],i.push(r,c)}),i.length<2&&(i=i.concat(i)),e.setNativeRange.apply(e,o(i).concat([n]))}():this.setNativeRange(null),this.update(r)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.default.sources.USER,e=void 0,n=this.lastRange,r=this.getRange(),o=a(r,2);if(this.lastRange=o[0],e=o[1],null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,d.default)(n,this.lastRange)){var i;!this.composing&&null!=e&&e.native.collapsed&&e.start.node!==this.cursor.textNode&&this.cursor.restore();var l=[v.default.events.SELECTION_CHANGE,(0,p.default)(this.lastRange),(0,p.default)(n),t];if((i=this.emitter).emit.apply(i,[v.default.events.EDITOR_CHANGE].concat(l)),t!==v.default.sources.SILENT){var s;(s=this.emitter).emit.apply(s,l)}}}}]),t}();e.Range=_,e.default=O},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0&&!(i instanceof y.BlockEmbed)&&!(f instanceof y.BlockEmbed)){f instanceof w.default&&f.deleteAt(f.length()-1,1);var p=f.children.head instanceof g.default?null:f.children.head;i.moveChildren(f,p),i.remove()}this.optimize()}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function(t,n,r,o){(null==this.whitelist||this.whitelist[r])&&(c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,r,o),this.optimize())}},{key:"insertAt",value:function(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==p.default.query(n,p.default.Scope.BLOCK)){var o=p.default.create(this.statics.defaultChild);this.appendChild(o),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),o.insertAt(0,n,r)}else{var i=p.default.create(n,r);this.appendChild(i)}else c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r);this.optimize()}}},{key:"insertBefore",value:function(t,n){if(t.statics.scope===p.default.Scope.INLINE_BLOT){var r=p.default.create(this.statics.defaultChild);r.appendChild(t),t=r}c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n)}},{key:"leaf",value:function(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function(t){return t===this.length()?this.line(t-1):this.descendant(a,t)}},{key:"lines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,n=function t(e,n,r){var o=[],i=r;return e.children.forEachAt(n,r,function(e,n,r){a(e)?o.push(e):e instanceof p.default.Container&&(o=o.concat(t(e,n,i))),i-=r}),o};return n(this,t,e)}},{key:"optimize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.batch!==!0&&(c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t),t.length>0&&this.emitter.emit(d.default.events.SCROLL_OPTIMIZE,t))}},{key:"path",value:function(t){return c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){if(this.batch!==!0){var n=d.default.sources.USER;"string"==typeof t&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(d.default.events.SCROLL_BEFORE_UPDATE,n,t),c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"update",this).call(this,t.concat([])),t.length>0&&this.emitter.emit(d.default.events.SCROLL_UPDATE,n,t)}}}]),e}(p.default.Scroll);x.blotName="scroll",x.className="ql-editor",x.tagName="DIV",x.defaultChild="block",x.allowedChildren=[v.default,y.BlockEmbed,_.default],e.default=x},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e=0&&n.length-1}function p(t,e,n){return n.compose((new k.default).retain(n.length(),o({},t,!0)))}function h(t,e){var n=j.default.Attributor.Attribute.keys(t),r=j.default.Attributor.Class.keys(t),o=j.default.Attributor.Style.keys(t),i={};return n.concat(r).concat(o).forEach(function(e){var n=j.default.query(e,j.default.Scope.ATTRIBUTE);null!=n&&(i[n.attrName]=n.value(t),i[n.attrName])||(null!=H[e]&&(n=H[e],i[n.attrName]=n.value(t)),null!=F[e]&&(n=F[e],i[n.attrName]=n.value(t)))}),Object.keys(i).length>0&&(e=e.compose((new k.default).retain(e.length(),i))),e}function d(t,e){var n=j.default.query(t);if(null==n)return e;if(n.prototype instanceof j.default.Embed){var r={},i=n.value(t);null!=i&&(r[n.blotName]=i,e=(new k.default).insert(r,n.formats(t)))}else if("function"==typeof n.formats){var l=o({},n.blotName,n.formats(t));e=e.compose((new k.default).retain(e.length(),l))}return e}function y(t,e){return c(e,"\n")||e.insert("\n"),e}function v(){return new k.default}function b(t,e){return f(t)&&!c(e,"\n")&&e.insert("\n"),e}function g(t,e){if(f(t)&&null!=t.nextElementSibling&&!c(e,"\n\n")){var n=t.offsetHeight+parseFloat(u(t).marginTop)+parseFloat(u(t).marginBottom);t.nextElementSibling.offsetTop>t.offsetTop+1.5*n&&e.insert("\n")}return e}function m(t,e){var n={},r=t.style||{};return r.fontWeight&&"bold"===u(t).fontWeight&&(n.bold=!0),Object.keys(n).length>0&&(e=e.compose((new k.default).retain(e.length(),n))),parseFloat(r.textIndent||0)>0&&(e=(new k.default).insert("\t").concat(e)),e}function _(t,e){var n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(!u(t.parentNode).whiteSpace.startsWith("pre")){var r=function(t,e){return e=e.replace(/[^\u00a0]/g,""),e.length<1&&t?" ":e};n=n.replace(/\r\n/g," ").replace(/\n/g," "),n=n.replace(/\s\s+/g,r.bind(r,!0)),(null==t.previousSibling&&f(t.parentNode)||null!=t.previousSibling&&f(t.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==t.nextSibling&&f(t.parentNode)||null!=t.nextSibling&&f(t.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return e.insert(n)}Object.defineProperty(e,"__esModule",{value:!0}),e.matchText=e.matchSpacing=e.matchNewline=e.matchBlot=e.matchAttributor=e.default=void 0;var O=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),w=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:N.default.sources.API;if("string"==typeof t)return this.quill.setContents(this.convert(t),e);var r=this.convert(e);return this.quill.updateContents((new k.default).retain(t).concat(r),n)}},{key:"onPaste",value:function(t){var e=this;if(!t.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=(new k.default).retain(n.index).delete(n.length),o=document.body.scrollTop;this.container.focus(),setTimeout(function(){e.quill.selection.update(N.default.sources.SILENT),r=r.concat(e.convert()),e.quill.updateContents(r,N.default.sources.USER),e.quill.setSelection(r.length()-n.length,N.default.sources.SILENT),document.body.scrollTop=o,e.quill.selection.scrollIntoView()},1)}}}]),e}(S.default);K.DEFAULTS={matchers:[]},e.default=K,e.matchAttributor=h,e.matchBlot=d,e.matchNewline=b,e.matchSpacing=g,e.matchText=_},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.AlignStyle=e.AlignClass=e.AlignAttribute=void 0;var o=n(2),i=r(o),l={scope:i.default.Scope.BLOCK,whitelist:["right","center","justify"]},a=new i.default.Attributor.Attribute("align","align",l),s=new i.default.Attributor.Class("align","ql-align",l),u=new i.default.Attributor.Style("align","text-align",l);e.AlignAttribute=a,e.AlignClass=s,e.AlignStyle=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.BackgroundStyle=e.BackgroundClass=void 0;var o=n(2),i=r(o),l=n(51),a=new i.default.Attributor.Class("background","ql-bg",{scope:i.default.Scope.INLINE}),s=new l.ColorAttributor("background","background-color",{scope:i.default.Scope.INLINE});e.BackgroundClass=a,e.BackgroundStyle=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorStyle=e.ColorClass=e.ColorAttributor=void 0;var a=function(){function t(t,e){for(var n=0;nr&&this.stack.undo.length>0){var o=this.stack.undo.pop();n=n.compose(o.undo),t=o.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(t){this.stack.undo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}),this.stack.redo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),e}(y.default);v.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=v,e.getLastChangeIndex=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(0!==t.index){var n=this.quill.scroll.line(t.index),r=y(n,1),o=r[0],i={};if(0===e.offset){var l=o.formats(),a=this.quill.getFormat(t.index-1,1);i=k.default.attributes.diff(l,a)||{}}this.quill.deleteText(t.index-1,1,N.default.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(t.index-1,1,i,N.default.sources.USER),this.quill.selection.scrollIntoView()}}function s(t){t.index>=this.quill.getLength()-1||this.quill.deleteText(t.index,1,N.default.sources.USER)}function u(t){this.quill.deleteText(t,N.default.sources.USER),this.quill.setSelection(t.index,N.default.sources.SILENT),this.quill.selection.scrollIntoView()}function c(t,e){var n=this;t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);var r=Object.keys(e.format).reduce(function(t,n){return j.default.query(n,j.default.Scope.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t},{});this.quill.insertText(t.index,"\n",r,N.default.sources.USER),this.quill.selection.scrollIntoView(),Object.keys(e.format).forEach(function(t){null==r[t]&&(Array.isArray(e.format[t])||"link"!==t&&n.quill.format(t,e.format[t],N.default.sources.USER))})}function f(t){return{key:M.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(e){var n=j.default.query("code-block"),r=e.index,o=e.length,i=this.quill.scroll.descendant(n,r),l=y(i,2),a=l[0],s=l[1];if(null!=a){var u=this.quill.scroll.offset(a),c=a.newlineIndex(s,!0)+1,f=a.newlineIndex(u+s+o),p=a.domNode.textContent.slice(c,f).split("\n");s=0,p.forEach(function(e,i){t?(a.insertAt(c+s,n.TAB),s+=n.TAB.length,0===i?r+=n.TAB.length:o+=n.TAB.length):e.startsWith(n.TAB)&&(a.deleteAt(c+s,n.TAB.length),s-=n.TAB.length,0===i?r-=n.TAB.length:o-=n.TAB.length),s+=e.length+1}),this.quill.update(N.default.sources.USER),this.quill.setSelection(r,o,N.default.sources.SILENT)}}}}function p(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],N.default.sources.USER)}}}function h(t){if("string"==typeof t||"number"==typeof t)return h({key:t});if("object"===("undefined"==typeof t?"undefined":d(t))&&(t=(0,g.default)(t,!1)),"string"==typeof t.key)if(null!=M.keys[t.key.toUpperCase()])t.key=M.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t}Object.defineProperty(e,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),v=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=h(t);return null==r||null==r.key?L.warn("Attempted to add invalid keyboard binding",r):("function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),r=(0,w.default)(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],void this.bindings[r.key].push(r))}},{key:"listen",value:function(){var t=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var r=n.which||n.keyCode,o=(t.bindings[r]||[]).filter(function(t){return e.match(n,t)});if(0!==o.length){var i=t.quill.getSelection();if(null!=i&&t.quill.hasFocus()){var l=t.quill.scroll.line(i.index),a=y(l,2),s=a[0],u=a[1],c=t.quill.scroll.leaf(i.index),f=y(c,2),p=f[0],h=f[1],v=0===i.length?[p,h]:t.quill.scroll.leaf(i.index+i.length),b=y(v,2),g=b[0],m=b[1],O=p instanceof j.default.Text?p.value().slice(0,h):"",w=g instanceof j.default.Text?g.value().slice(m):"",x={collapsed:0===i.length,empty:0===i.length&&s.length()<=1,format:t.quill.getFormat(i),offset:u,prefix:O,suffix:w},k=o.some(function(e){if(null!=e.collapsed&&e.collapsed!==x.collapsed)return!1;if(null!=e.empty&&e.empty!==x.empty)return!1;if(null!=e.offset&&e.offset!==x.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(function(t){return null==x.format[t]}))return!1}else if("object"===d(e.format)&&!Object.keys(e.format).every(function(t){return e.format[t]===!0?null!=x.format[t]:e.format[t]===!1?null==x.format[t]:(0,_.default)(e.format[t],x.format[t])}))return!1;return!(null!=e.prefix&&!e.prefix.test(x.prefix))&&(!(null!=e.suffix&&!e.suffix.test(x.suffix))&&e.handler.call(t,i,x)!==!0)});k&&n.preventDefault()}}}})}}]),e}(S.default);M.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},M.DEFAULTS={bindings:{bold:p("bold"),italic:p("italic"),underline:p("underline"),indent:{key:M.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){return!(!e.collapsed||0===e.offset)||void this.quill.format("indent","+1",N.default.sources.USER)}},outdent:{key:M.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){return!(!e.collapsed||0===e.offset)||void this.quill.format("indent","-1",N.default.sources.USER)}},"outdent backspace":{key:M.keys.BACKSPACE,collapsed:!0,format:["blockquote","indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",N.default.sources.USER):null!=e.format.blockquote?this.quill.format("blockquote",!1,N.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,N.default.sources.USER)}},"indent code-block":f(!0),"outdent code-block":f(!1),"remove tab":{key:M.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,N.default.sources.USER)}},tab:{key:M.keys.TAB,handler:function(t,e){e.collapsed||this.quill.scroll.deleteAt(t.index,t.length),this.quill.insertText(t.index,"\t",N.default.sources.USER),this.quill.setSelection(t.index+1,N.default.sources.SILENT)}},"list empty enter":{key:M.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,N.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,N.default.sources.USER)}},"header enter":{key:M.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t){this.quill.scroll.insertAt(t.index,"\n"),this.quill.formatText(t.index+1,1,"header",!1,N.default.sources.USER),this.quill.setSelection(t.index+1,N.default.sources.SILENT),this.quill.selection.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^(1\.|-)$/,handler:function(t,e){var n=e.prefix.length;this.quill.scroll.deleteAt(t.index-n,n),this.quill.formatLine(t.index-n,1,"list",1===n?"bullet":"ordered",N.default.sources.USER),this.quill.setSelection(t.index-n,N.default.sources.SILENT)}}}},e.default=M},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var a=function(){function t(t,e){for(var n=0;n0&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return o({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(t,n){if(t instanceof v)u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n);else{var r=null==n?this.length():n.offset(this),o=this.split(r);o.parent.insertBefore(t,o)}}},{key:"optimize",value:function(){u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this);var t=this.next;null!=t&&t.prev===this&&t.statics.blotName===this.statics.blotName&&t.domNode.tagName===this.domNode.tagName&&(t.moveChildren(this),t.remove())}},{key:"replace",value:function(t){if(t.statics.blotName!==this.statics.blotName){var n=f.default.create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t)}}],[{key:"create",value:function(t){return"ordered"===t?t="OL":"bullet"===t&&(t="UL"),u(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t)}},{key:"formats",value:function(t){return"OL"===t.tagName?"ordered":"UL"===t.tagName?"bullet":void 0}}]),e}(y.default);b.blotName="list",b.scope=f.default.Scope.BLOCK_BLOT,b.tagName=["OL","UL"],b.defaultChild="list-item",b.allowedChildren=[v],e.ListItem=v,e.default=b},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n-1}Object.defineProperty(e,"__esModule",{value:!0}),e.sanitize=e.default=void 0;var s=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=s(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"==typeof t&&n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return p.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,f.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(c.default);h.blotName="image",h.tagName="IMG",e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=s(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return p.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"sanitize",value:function(t){return f.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(u.BlockEmbed);h.blotName="video",h.className="ql-video",h.tagName="IFRAME",e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(){if(null==window.katex)throw new Error("Formula module requires KaTeX.");h.default.register(d,!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var s=function(){function t(t,e){for(var n=0;n0||null==this.cachedHTML)&&(this.domNode.innerHTML=t(e),this.attach()),this.cachedHTML=this.domNode.innerHTML}}}]),e}(v.default);b.className="ql-syntax";var g=new c.default.Attributor.Class("token","hljs",{scope:c.default.Scope.INLINE}),m=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if("function"!=typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");p.default.register(g,!0),p.default.register(b,!0);var l=null;return r.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){null==l&&(l=setTimeout(function(){r.highlight(),l=null},100))}),r.highlight(),r}return l(e,t),a(e,[{key:"highlight",value:function(){var t=this;if(!this.quill.selection.composing){var e=this.quill.getSelection();this.quill.scroll.descendants(b).forEach(function(e){e.highlight(t.options.highlight)}),this.quill.update(p.default.sources.SILENT),null!=e&&this.quill.setSelection(e,p.default.sources.SILENT)}}}]),e}(d.default);m.DEFAULTS={highlight:function(){return null==window.hljs?null:function(t){var e=window.hljs.highlightAuto(t);return e.value}}()},e.CodeBlock=b,e.CodeToken=g,e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e,n){var r=document.createElement("button");r.setAttribute("type","button"),r.classList.add("ql-"+e),null!=n&&(r.value=n),t.appendChild(r)}function u(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(function(e){var n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(function(t){if("string"==typeof t)s(n,t);else{var e=Object.keys(t)[0],r=t[e];Array.isArray(r)?c(n,e,r):s(n,e,r)}}),t.appendChild(n)})}function c(t,e,n){var r=document.createElement("select");r.classList.add("ql-"+e),n.forEach(function(t){var e=document.createElement("option");t!==!1?e.setAttribute("value",t):e.setAttribute("selected","selected"),r.appendChild(e)}),t.appendChild(r)}Object.defineProperty(e,"__esModule",{value:!0}),e.addControls=e.default=void 0;var f=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(){function t(t,e){for(var n=0;n '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '; +},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(t!==n)if(null!=n&&n.classList.remove("ql-selected"),null!=t){if(t.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":i(Event))){var r=document.createEvent("Event");r.initEvent("change",!0,!0),this.select.dispatchEvent(r)}this.close()}}else this.label.removeAttribute("data-value"),this.label.removeAttribute("data-label")}},{key:"update",value:function(){var t=void 0;if(this.select.selectedIndex>-1){var e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);var n=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),t}();e.default=u},function(t,e){t.exports=' '},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n=this.quill.root.offsetHeight)}},{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(t){var e=t.left+t.width/2-this.root.offsetWidth/2,n=t.bottom+this.quill.root.scrollTop;this.root.style.left=e+"px",this.root.style.top=n+"px";var r=this.boundsContainer.getBoundingClientRect(),o=this.root.getBoundingClientRect(),i=0;return o.right>r.right&&(i=r.right-o.right,this.root.style.left=e+i+"px"),o.left0){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var n=r.quill.scroll.lines(e.index,e.length);if(1===n.length)r.position(r.quill.getBounds(e));else{var o=n[n.length-1],i=o.offset(r.quill.scroll),l=Math.min(o.length()-1,e.index+e.length-i),a=r.quill.getBounds(new y.Range(i,l));r.position(a)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}),r}return l(e,t),s(e,[{key:"listen",value:function(){var t=this;a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){t.root.classList.remove("ql-editing")}),this.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!t.root.classList.contains("ql-hidden")){var e=t.quill.getSelection();null!=e&&t.position(t.quill.getBounds(e))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var n=a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"position",this).call(this,t),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",0===n?n:void(r.style.marginLeft=-1*n-r.offsetWidth/2+"px")}}]),e}(h.BaseTooltip);_.TEMPLATE=['','
    ','','',"
    "].join(""),e.BubbleTooltip=_,e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(function(e){var r=document.createElement("option");e===n?r.setAttribute("selected","selected"):r.setAttribute("value",e),t.appendChild(r)})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var s=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||""),this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function(){var t=this.quill.root.scrollTop;this.quill.focus(),this.quill.root.scrollTop=t}},{key:"save",value:function(){var t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,y.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,y.default.sources.USER)),this.quill.root.scrollTop=e;break;case"video":var n=t.match(/^(https?):\/\/(www\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(https?):\/\/(www\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);n?t=n[1]+"://www.youtube.com/embed/"+n[3]+"?showinfo=0":(n=t.match(/^(https?):\/\/(www\.)?vimeo\.com\/(\d+)/))&&(t=n[1]+"://player.vimeo.com/video/"+n[3]+"/");case"formula":var r=this.quill.getSelection(!0),o=r.index+r.length;null!=r&&(this.quill.insertEmbed(o,this.root.getAttribute("data-mode"),t,y.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(o+1," ",y.default.sources.USER),this.quill.setSelection(o+2,y.default.sources.USER))}this.textbox.value="",this.hide()}}]),e}(A.default);e.BaseTooltip=C,e.default=L},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0); +}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},u=function(){function t(t,e){for(var n=0;n','','',''].join(""),e.default=w},function(t,e,n,r,o){function i(t){return null===t||void 0===t}function l(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function a(t,e,n){var r,o;if(i(t)||i(e))return!1;if(t.prototype!==e.prototype)return!1;if(c(t))return!!c(e)&&(t=s.call(t),e=s.call(e),f(t,e,n));if(l(t)){if(!l(e))return!1;if(t.length!==e.length)return!1;for(r=0;r=0;r--)if(a[r]!=p[r])return!1;for(r=a.length-1;r>=0;r--)if(o=a[r],!f(t[o],e[o],n))return!1;return typeof t==typeof e}var s=Array.prototype.slice,u=n(r),c=n(o),f=t.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:a(t,e,n))}}]))}); diff -Nru bibledit-5.0.912/quill/1.1.5/quill.min.js.map bibledit-5.0.922/quill/1.1.5/quill.min.js.map --- bibledit-5.0.912/quill/1.1.5/quill.min.js.map 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.1.5/quill.min.js.map 2017-02-06 10:08:27.000000000 +0000 @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///quill.min.js","webpack:///webpack/bootstrap 12da403d1f2adb6b6342","webpack:///./quill.js","webpack:///./core.js","webpack:///../parchment/src/parchment.ts","webpack:///../parchment/src/blot/abstract/container.ts","webpack:///../parchment/src/collection/linked-list.ts","webpack:///../parchment/src/blot/abstract/shadow.ts","webpack:///../parchment/src/registry.ts","webpack:///../parchment/src/blot/abstract/format.ts","webpack:///../parchment/src/attributor/attributor.ts","webpack:///../parchment/src/attributor/store.ts","webpack:///../parchment/src/attributor/class.ts","webpack:///../parchment/src/attributor/style.ts","webpack:///../parchment/src/blot/abstract/leaf.ts","webpack:///../parchment/src/blot/scroll.ts","webpack:///../parchment/src/blot/inline.ts","webpack:///../parchment/src/blot/block.ts","webpack:///../parchment/src/blot/embed.ts","webpack:///../parchment/src/blot/text.ts","webpack:///./core/quill.js","webpack:///./core/polyfill.js","webpack:///../delta/lib/delta.js","webpack:///../delta/~/fast-diff/diff.js","webpack:///../delta/~/deep-equal/lib/keys.js","webpack:///../delta/~/deep-equal/lib/is_arguments.js","webpack:///../delta/~/extend/index.js","webpack:///../delta/lib/op.js","webpack:///./core/editor.js","webpack:///./formats/code.js","webpack:///./blots/block.js","webpack:///./blots/break.js","webpack:///./blots/embed.js","webpack:///./blots/inline.js","webpack:///./blots/text.js","webpack:///./blots/cursor.js","webpack:///./core/emitter.js","webpack:///./~/eventemitter3/index.js","webpack:///./core/logger.js","webpack:///./~/clone/clone.js","webpack:///./core/module.js","webpack:///./core/selection.js","webpack:///./core/theme.js","webpack:///./blots/container.js","webpack:///./blots/scroll.js","webpack:///./modules/clipboard.js","webpack:///./formats/align.js","webpack:///./formats/background.js","webpack:///./formats/color.js","webpack:///./formats/direction.js","webpack:///./formats/font.js","webpack:///./formats/size.js","webpack:///./modules/history.js","webpack:///./modules/keyboard.js","webpack:///./formats/indent.js","webpack:///./formats/blockquote.js","webpack:///./formats/header.js","webpack:///./formats/list.js","webpack:///./formats/bold.js","webpack:///./formats/italic.js","webpack:///./formats/link.js","webpack:///./formats/script.js","webpack:///./formats/strike.js","webpack:///./formats/underline.js","webpack:///./formats/image.js","webpack:///./formats/video.js","webpack:///./modules/formula.js","webpack:///./modules/syntax.js","webpack:///./modules/toolbar.js","webpack:///./ui/icons.js","webpack:///./assets/icons/align-left.svg","webpack:///./assets/icons/align-center.svg","webpack:///./assets/icons/align-right.svg","webpack:///./assets/icons/align-justify.svg","webpack:///./assets/icons/background.svg","webpack:///./assets/icons/blockquote.svg","webpack:///./assets/icons/bold.svg","webpack:///./assets/icons/clean.svg","webpack:///./assets/icons/code.svg","webpack:///./assets/icons/color.svg","webpack:///./assets/icons/direction-ltr.svg","webpack:///./assets/icons/direction-rtl.svg","webpack:///./assets/icons/float-center.svg","webpack:///./assets/icons/float-full.svg","webpack:///./assets/icons/float-left.svg","webpack:///./assets/icons/float-right.svg","webpack:///./assets/icons/formula.svg","webpack:///./assets/icons/header.svg","webpack:///./assets/icons/header-2.svg","webpack:///./assets/icons/italic.svg","webpack:///./assets/icons/image.svg","webpack:///./assets/icons/indent.svg","webpack:///./assets/icons/outdent.svg","webpack:///./assets/icons/link.svg","webpack:///./assets/icons/list-ordered.svg","webpack:///./assets/icons/list-bullet.svg","webpack:///./assets/icons/subscript.svg","webpack:///./assets/icons/superscript.svg","webpack:///./assets/icons/strike.svg","webpack:///./assets/icons/underline.svg","webpack:///./assets/icons/video.svg","webpack:///./ui/picker.js","webpack:///./assets/icons/dropdown.svg","webpack:///./ui/color-picker.js","webpack:///./ui/icon-picker.js","webpack:///./ui/tooltip.js","webpack:///./themes/bubble.js","webpack:///./themes/base.js","webpack:///./themes/snow.js","webpack:///../delta/~/deep-equal/index.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","i","Object","prototype","hasOwnProperty","_m","args","slice","fn","a","b","apply","concat","_interopRequireDefault","obj","__esModule","default","_core","_core2","_align","_direction","_indent","_blockquote","_blockquote2","_header","_header2","_list","_list2","_background","_color","_font","_size","_bold","_bold2","_italic","_italic2","_link","_link2","_script","_script2","_strike","_strike2","_underline","_underline2","_image","_image2","_video","_video2","_code","_code2","_formula","_formula2","_syntax","_syntax2","_toolbar","_toolbar2","_icons","_icons2","_picker","_picker2","_colorPicker","_colorPicker2","_iconPicker","_iconPicker2","_tooltip","_tooltip2","_bubble","_bubble2","_snow","_snow2","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","formats/align","formats/direction","formats/indent","IndentClass","formats/background","formats/color","formats/font","formats/size","formats/blockquote","formats/code-block","formats/header","formats/list","formats/bold","formats/code","Code","formats/italic","formats/link","formats/script","formats/strike","formats/underline","formats/image","formats/video","formats/list/item","ListItem","modules/formula","modules/syntax","modules/toolbar","themes/bubble","themes/snow","ui/icons","ui/picker","ui/icon-picker","ui/color-picker","ui/tooltip","_parchment","_parchment2","_quill","_quill2","_block","_block2","_break","_break2","_container","_container2","_cursor","_cursor2","_embed","_embed2","_inline","_inline2","_scroll","_scroll2","_text","_text2","_clipboard","_clipboard2","_history","_history2","_keyboard","_keyboard2","blots/block","blots/block/embed","BlockEmbed","blots/break","blots/container","blots/cursor","blots/embed","blots/inline","blots/scroll","blots/text","modules/clipboard","modules/history","modules/keyboard","container_1","format_1","leaf_1","scroll_1","inline_1","block_1","embed_1","text_1","attributor_1","class_1","style_1","store_1","Registry","Parchment","Scope","create","find","query","Container","Format","Leaf","Embed","Scroll","Block","Inline","Text","Attributor","Attribute","Class","Style","Store","defineProperty","value","makeBlot","node","blot","e","INLINE","childNodes","forEach","child","domNode","appendChild","parentNode","replaceChild","attach","__extends","d","__","constructor","linked_list_1","shadow_1","ContainerBlot","_super","arguments","other","insertBefore","_this","children","reverse","head","err","ParchmentError","deleteAt","index","length","remove","forEachAt","offset","descendant","criteria","_a","blotName","descendants","Number","MAX_VALUE","lengthLeft","push","detach","formatAt","name","insertAt","def","childBlot","refBlot","statics","allowedChildren","some","insertInto","reduce","memo","moveChildren","targetParent","refNode","optimize","defaultChild","path","inclusive","position","removeChild","replace","target","split","force","next","after","clone","parent","unwrap","update","mutations","addedNodes","removedNodes","mutation","type","document","body","compareDocumentPosition","Node","DOCUMENT_POSITION_CONTAINED_BY","filter","sort","DOCUMENT_POSITION_FOLLOWING","nextSibling","LinkedList","tail","undefined","append","nodes","_i","contains","cur","iterator","prev","curNode","ret","length_1","callback","startNode","curIndex","curLength","Math","min","map","ShadowBlot","get","enumerable","configurable","tagName","Array","isArray","toUpperCase","parseInt","toString","createElement","indexOf","className","classList","add","DATA_KEY","cloneNode","isolate","BLOT","wrap","ATTRIBUTE","parent_1","scope","format","ref","parentBlot","refDomNode","replaceWith","replacement","wrapper","input","match","BlotClass","bubble","ANY","types","attributes","LEVEL","BLOCK","HTMLElement","names","getAttribute","classes","tags","console","log","nodeType","TYPE","Definitions","Definition","attrName","keyName","tagNames","tag","message","Error","FormatBlot","formats","toLowerCase","attribute","values","copy","build","move","options","attributeBit","whitelist","keys","item","canAdd","setAttribute","removeAttribute","AttributorStore","styles","attr","key","prefix","ClassAttributor","join","matches","result","camelize","parts","rest","part","StyleAttributor","arr","trim","style","LeafBlot","INLINE_BLOT","OBSERVER_CONFIG","characterData","characterDataOldValue","childList","subtree","MAX_OPTIMIZE_ITERATIONS","ScrollBlot","observer","MutationObserver","observe","disconnect","takeRecords","mark","markParent","remaining","previousSibling","grandChild","BLOCK_BLOT","isEqual","obj1","obj2","prop","InlineBlot","BlockBlot","EmbedBlot","TextBlot","text","createTextNode","data","splitText","_defineProperty","writable","_classCallCheck","instance","Constructor","TypeError","expandConfig","container","userConfig","_extend2","clipboard","keyboard","history","theme","Quill","DEFAULTS","import","_theme2","themeConfig","config","moduleNames","moduleConfig","moduleClass","debug","error","toolbar","querySelector","modify","modifier","source","shift","strict","isEnabled","_emitter4","sources","USER","_quillDelta2","range","getSelection","oldDelta","editor","delta","change","shiftRange","setSelection","SILENT","_emitter","events","TEXT_CHANGE","emitter","emit","EDITOR_CHANGE","_emitter2","overload","_typeof","API","start","end","_map","pos","transformPosition","_map2","_slicedToArray","_map3","max","_map4","_selection","Range","Symbol","sliceIterator","_arr","_n","_d","_e","_s","done","_createClass","defineProperties","props","descriptor","protoProps","staticProps","_quillDelta","_editor","_editor2","_emitter3","_module","_module2","_selection2","_extend","_logger","_logger2","_theme","_this2","html","innerHTML","addContainer","scroll","selection","addModule","init","on","toggle","isBlank","SCROLL_UPDATE","lastRange","contents","convert","setContents","clear","placeholder","readOnly","disable","limit","level","imports","overwrite","warn","startsWith","setRange","_this3","_overload","_overload2","deleteText","enable","enabled","blur","focus","scrollIntoView","_this4","formatLine","formatText","_this5","_overload3","_overload4","_this6","_overload5","_overload6","getBounds","getLength","_overload7","_overload8","getContents","getFormat","getRange","_overload9","_overload10","getText","hasFocus","embed","_this7","insertEmbed","_this8","_overload11","_overload12","insertText","off","once","dangerouslyPasteHTML","_this9","_overload13","_overload14","removeFormat","_this10","deleted","applied","applyDelta","lastOp","ops","insert","delete","compose","_overload15","_overload16","_this11","bounds","version","parchment","core/module","core/theme","elem","_toggle","DOMTokenList","token","String","searchString","substr","endsWith","subjectString","isFinite","floor","lastIndex","predicate","list","thisArg","addEventListener","execCommand","diff","equal","extend","op","NULL_CHARACTER","fromCharCode","Delta","newOp","retain","unshift","splice","partition","passed","failed","initial","chop","pop","Infinity","iter","hasNext","nextOp","thisIter","otherIter","peekType","peekLength","thisOp","otherOp","strings","prep","diffResult","component","opLength","INSERT","DELETE","EQUAL","eachLine","newline","line","peek","transform","priority","nextType","diff_main","text1","text2","cursor_pos","DIFF_EQUAL","commonlength","diff_commonPrefix","commonprefix","substring","diff_commonSuffix","commonsuffix","diffs","diff_compute_","diff_cleanupMerge","fix_cursor","DIFF_INSERT","DIFF_DELETE","longtext","shorttext","hm","diff_halfMatch_","text1_a","text1_b","text2_a","text2_b","mid_common","diffs_a","diffs_b","diff_bisect_","text1_length","text2_length","max_d","ceil","v_offset","v_length","v1","v2","x","front","k1start","k1end","k2start","k2end","k1","x1","k1_offset","y1","charAt","k2_offset","x2","diff_bisectSplit_","k2","y2","y","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","pointerend","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","j","best_common","prefixLength","suffixLength","hm1","hm2","pointer","count_delete","count_insert","text_delete","text_insert","changes","cursor_normalize_diff","current_pos","next_pos","split_pos","d_left","d_right","norm","ndiffs","cursor_pointer","d_next","merge_tuples","suffix","left_d","right_d","shim","supported","object","unsupported","propertyIsEnumerable","supportsArgumentsClass","hasOwn","toStr","isPlainObject","hasOwnConstructor","hasIsPrototypeOf","src","copyIsArray","deep","Iterator","lib","keepNull","retOp","combineFormats","combined","merged","normalizeDelta","_clone2","image","bullet","_op","_op2","_clone","_deepEqual","_deepEqual2","Editor","getDelta","consumeNextNewline","scrollLength","batch","_scroll$line","_scroll$line2","bubbleFormats","_line$descendant","_line$descendant2","leaf","lines","lengthRemaining","lineLength","codeIndex","codeLength","newlineIndex","leaves","_path","formatsArr","blots","_scroll$line3","_scroll$line4","cursorIndex","textBlot","oldValue","CONTENTS","oldText","newText","diffDelta","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","setPrototypeOf","__proto__","_get","property","receiver","Function","desc","getOwnPropertyDescriptor","getPrototypeOf","getter","_Inline","CodeBlock","_Block","textContent","frag","_descendant","_descendant2","nextNewline","prevNewline","isolateLength","_descendant3","_descendant4","searchIndex","lastIndexOf","querySelectorAll","TAB","NEWLINE_LENGTH","_Embed","BLOCK_ATTRIBUTE","block","_Parchment$Block","cache","Break","_Parchment$Embed","_Parchment$Inline","compare","selfIndex","order","otherIndex","_Parchment$Text","Cursor","textNode","_length","composing","getNativeRange","restoreText","_ref","lastChild","SCROLL_OPTIMIZE","setNativeRange","restore","_eventemitter","_eventemitter2","Emitter","_EventEmitter","SCROLL_BEFORE_UPDATE","SELECTION_CHANGE","Events","EE","context","EventEmitter","_events","_eventsCount","has","eventNames","getOwnPropertySymbols","listeners","event","exists","evt","available","l","ee","a1","a2","a3","a4","a5","len","removeListener","listener","removeAllListeners","addListener","setMaxListeners","prefixed","method","levels","_len","_key","namespace","ns","logger","bind","newLevel","circular","depth","proto","nativeMap","nativeSet","nativePromise","resolve","reject","then","__isArray","__isRegExp","RegExp","__getRegExpFlags","__isDate","Date","getTime","useBuffer","Buffer","isBuffer","allParents","allChildren","keyIterator","keyChild","valueChild","set","entryChild","attrs","symbols","symbol","__objToStr","o","re","flags","global","ignoreCase","multiline","Map","_","Set","Promise","clonePrototype","Module","quill","_toConsumableArray","arr2","from","Selection","cursor","savedRange","eventName","setTimeout","native","ignored","bodyTop","scrollTop","nativeRange","collapsed","_scroll$leaf","_scroll$leaf2","_leaf$position","_leaf$position2","createRange","setStart","_scroll$leaf3","_scroll$leaf4","_leaf$position3","_leaf$position4","setEnd","getBoundingClientRect","side","rect","height","left","width","top","containerBounds","right","bottom","rangeCount","getRangeAt","startContainer","endContainer","startOffset","endOffset","info","positions","indexes","_position","activeElement","offsetHeight","offsetTop","endNode","removeAllRanges","addRange","_scroll$leaf5","_scroll$leaf6","_leaf$position5","_leaf$position6","oldRange","_getRange","_getRange2","Theme","themes","_Parchment$Container","isLine","_Parchment$Scroll","_line","_line2","first","_line3","_line4","last","getLines","computeStyle","ELEMENT_NODE","DOM_KEY","window","getComputedStyle","deltaEndsWith","endText","display","matchAlias","matchAttributor","ATTRIBUTE_ATTRIBUTORS","STYLE_ATTRIBUTORS","matchBlot","matchBreak","matchIgnore","matchNewline","matchSpacing","nextElementSibling","nodeHeight","parseFloat","marginTop","marginBottom","matchStyles","fontWeight","bold","textIndent","matchText","whiteSpace","replacer","collapse","CLIPBOARD_CONFIG","TEXT_NODE","AlignAttribute","Clipboard","_Module","onPaste","matchers","pair","addMatcher","selector","matcher","textMatchers","elementMatchers","_pair","traverse","childNode","childrenDelta","paste","updateContents","defaultPrevented","ColorAttributor","_Parchment$Attributor","FontStyleAttributor","endsWithNewlineChange","getLastChangeIndex","deleteLength","changeIndex","History","lastRecorded","ignoreChange","userOnly","record","addBinding","shortKey","undo","shiftKey","redo","test","navigator","platform","dest","stack","changeDelta","undoDelta","timestamp","now","delay","maxStack","handleBackspace","_quill$scroll$line3","_quill$scroll$line4","curFormats","prevFormats","handleDelete","handleDeleteRange","handleEnter","lineFormats","makeCodeBlockHandler","indent","Keyboard","code-block","handler","_quill$scroll$descend","_quill$scroll$descend2","scrollOffset","makeFormatHandler","normalize","binding","charCodeAt","SHORTKEY","bindings","ENTER","metaKey","ctrlKey","altKey","BACKSPACE","userAgent","listen","which","keyCode","_quill$scroll$line","_quill$scroll$line2","_quill$scroll$leaf","_quill$scroll$leaf2","leafStart","offsetStart","_ref2","leafEnd","offsetEnd","prefixText","suffixText","curContext","empty","prevented","every","preventDefault","ESCAPE","LEFT","UP","RIGHT","DOWN","italic","underline","outdent","outdent backspace","blockquote","indent code-block","outdent code-block","remove tab","tab","list empty enter","header enter","list autofill","IdentAttributor","Blockquote","Header","List","_Container","Bold","Italic","_Bold","sanitize","url","protocols","anchor","href","protocol","Link","SANITIZED_URL","Script","Strike","Underline","ATTRIBUTES","Image","hasAttribute","Video","_BlockEmbed","Formula","katex","FormulaBlot","render","CodeToken","SyntaxCodeBlock","_CodeBlock","highlight","cachedHTML","Syntax","timer","code","hljs","highlightAuto","addButton","addControls","groups","controls","group","control","addSelect","option","Toolbar","_ret","handlers","addHandler","_this$quill$selection","_this$quill$selection2","selectedIndex","selected","_quill$selection$getR","_quill$selection$getR2","prompt","isActive","clean","direction","align","link","","center","justify","background","color","rtl","float","full","formula","header","1","2","+1","-1","ordered","script","sub","super","strike","video","_dropdown","_dropdown2","Picker","select","buildPicker","label","selectItem","buildItem","buildLabel","buildOptions","trigger","Event","dispatchEvent","createEvent","initEvent","close","ColorPicker","_Picker","backgroundColor","colorLabel","stroke","fill","IconPicker","icons","defaultItem","Tooltip","boundsContainer","TEMPLATE","checkBounds","hide","reference","offsetWidth","rootBounds","BubbleTooltip","_base","_base2","TOOLBAR_CONFIG","BubbleTheme","_BaseTheme","tooltip","buildButtons","buildPickers","edit","_BaseTooltip","show","lastLine","textbox","arrow","marginLeft","BaseTooltip","fillSelect","defaultValue","ALIGNS","COLORS","FONTS","HEADERS","SIZES","BaseTheme","_Theme","pickers","picker","removeEventListener","extendToolbar","buttons","button","selects","fileInput","files","reader","FileReader","onload","readAsDataURL","click","_Tooltip","save","cancel","mode","preview","linkRange","restoreFocus","SnowTheme","SnowTooltip","__webpack_module_template_argument_0__","__webpack_module_template_argument_1__","isUndefinedOrNull","objEquiv","opts","isArguments","pSlice","deepEqual","ka","objectKeys","kb","actual","expected"],"mappings":";;;;;;CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAA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yB1O,GAAA,EAAQA,IAEjC,GADAoY,EAAAy8B,EAAA70C,IACA40C,EAAAp0C,EAAA4X,GAAA3X,EAAA2X,GAAAq8B,GAAA,QAEA,cAAAj0C,UAAAC,GA5FA,GAAAk0C,GAAA7gC,MAAA5T,UAAAI,MACAw0C,EAAAv1C,EAAA80C,GACAK,EAAAn1C,EAAA+0C,GAEAM,EAAA11C,EAAAD,QAAA,SAAA+1C,EAAAC,EAAAR,GAGA,MAFAA,WAEAO,IAAAC,IAGGD,YAAAja,OAAAka,YAAAla,MACHia,EAAAha,YAAAia,EAAAja,WAIGga,IAAAC,GAAA,gBAAAD,IAAA,gBAAAC,GACHR,EAAAx3B,OAAA+3B,IAAAC,EAAAD,GAAAC,EASAT,EAAAQ,EAAAC,EAAAR","file":"quill.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","/*!\n * Quill Editor v1.1.5\n * https://quilljs.com/\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ((function(modules) {\n\t// Check all modules for deduplicated modules\n\tfor(var i in modules) {\n\t\tif(Object.prototype.hasOwnProperty.call(modules, i)) {\n\t\t\tswitch(typeof modules[i]) {\n\t\t\tcase \"function\": break;\n\t\t\tcase \"object\":\n\t\t\t\t// Module can be created from a template\n\t\t\t\tmodules[i] = (function(_m) {\n\t\t\t\t\tvar args = _m.slice(1), fn = modules[_m[0]];\n\t\t\t\t\treturn function (a,b,c) {\n\t\t\t\t\t\tfn.apply(this, [a,b,c].concat(args));\n\t\t\t\t\t};\n\t\t\t\t}(modules[i]));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// Module is a copy of another module\n\t\t\t\tmodules[i] = modules[modules[i]];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn modules;\n}([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _core = __webpack_require__(1);\n\t\n\tvar _core2 = _interopRequireDefault(_core);\n\t\n\tvar _align = __webpack_require__(49);\n\t\n\tvar _direction = __webpack_require__(52);\n\t\n\tvar _indent = __webpack_require__(57);\n\t\n\tvar _blockquote = __webpack_require__(58);\n\t\n\tvar _blockquote2 = _interopRequireDefault(_blockquote);\n\t\n\tvar _header = __webpack_require__(59);\n\t\n\tvar _header2 = _interopRequireDefault(_header);\n\t\n\tvar _list = __webpack_require__(60);\n\t\n\tvar _list2 = _interopRequireDefault(_list);\n\t\n\tvar _background = __webpack_require__(50);\n\t\n\tvar _color = __webpack_require__(51);\n\t\n\tvar _font = __webpack_require__(53);\n\t\n\tvar _size = __webpack_require__(54);\n\t\n\tvar _bold = __webpack_require__(61);\n\t\n\tvar _bold2 = _interopRequireDefault(_bold);\n\t\n\tvar _italic = __webpack_require__(62);\n\t\n\tvar _italic2 = _interopRequireDefault(_italic);\n\t\n\tvar _link = __webpack_require__(63);\n\t\n\tvar _link2 = _interopRequireDefault(_link);\n\t\n\tvar _script = __webpack_require__(64);\n\t\n\tvar _script2 = _interopRequireDefault(_script);\n\t\n\tvar _strike = __webpack_require__(65);\n\t\n\tvar _strike2 = _interopRequireDefault(_strike);\n\t\n\tvar _underline = __webpack_require__(66);\n\t\n\tvar _underline2 = _interopRequireDefault(_underline);\n\t\n\tvar _image = __webpack_require__(67);\n\t\n\tvar _image2 = _interopRequireDefault(_image);\n\t\n\tvar _video = __webpack_require__(68);\n\t\n\tvar _video2 = _interopRequireDefault(_video);\n\t\n\tvar _code = __webpack_require__(28);\n\t\n\tvar _code2 = _interopRequireDefault(_code);\n\t\n\tvar _formula = __webpack_require__(69);\n\t\n\tvar _formula2 = _interopRequireDefault(_formula);\n\t\n\tvar _syntax = __webpack_require__(70);\n\t\n\tvar _syntax2 = _interopRequireDefault(_syntax);\n\t\n\tvar _toolbar = __webpack_require__(71);\n\t\n\tvar _toolbar2 = _interopRequireDefault(_toolbar);\n\t\n\tvar _icons = __webpack_require__(72);\n\t\n\tvar _icons2 = _interopRequireDefault(_icons);\n\t\n\tvar _picker = __webpack_require__(104);\n\t\n\tvar _picker2 = _interopRequireDefault(_picker);\n\t\n\tvar _colorPicker = __webpack_require__(106);\n\t\n\tvar _colorPicker2 = _interopRequireDefault(_colorPicker);\n\t\n\tvar _iconPicker = __webpack_require__(107);\n\t\n\tvar _iconPicker2 = _interopRequireDefault(_iconPicker);\n\t\n\tvar _tooltip = __webpack_require__(108);\n\t\n\tvar _tooltip2 = _interopRequireDefault(_tooltip);\n\t\n\tvar _bubble = __webpack_require__(109);\n\t\n\tvar _bubble2 = _interopRequireDefault(_bubble);\n\t\n\tvar _snow = __webpack_require__(111);\n\t\n\tvar _snow2 = _interopRequireDefault(_snow);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t_core2.default.register({\n\t 'attributors/attribute/direction': _direction.DirectionAttribute,\n\t\n\t 'attributors/class/align': _align.AlignClass,\n\t 'attributors/class/background': _background.BackgroundClass,\n\t 'attributors/class/color': _color.ColorClass,\n\t 'attributors/class/direction': _direction.DirectionClass,\n\t 'attributors/class/font': _font.FontClass,\n\t 'attributors/class/size': _size.SizeClass,\n\t\n\t 'attributors/style/align': _align.AlignStyle,\n\t 'attributors/style/background': _background.BackgroundStyle,\n\t 'attributors/style/color': _color.ColorStyle,\n\t 'attributors/style/direction': _direction.DirectionStyle,\n\t 'attributors/style/font': _font.FontStyle,\n\t 'attributors/style/size': _size.SizeStyle\n\t}, true);\n\t\n\t_core2.default.register({\n\t 'formats/align': _align.AlignClass,\n\t 'formats/direction': _direction.DirectionClass,\n\t 'formats/indent': _indent.IndentClass,\n\t\n\t 'formats/background': _background.BackgroundStyle,\n\t 'formats/color': _color.ColorStyle,\n\t 'formats/font': _font.FontClass,\n\t 'formats/size': _size.SizeClass,\n\t\n\t 'formats/blockquote': _blockquote2.default,\n\t 'formats/code-block': _code2.default,\n\t 'formats/header': _header2.default,\n\t 'formats/list': _list2.default,\n\t\n\t 'formats/bold': _bold2.default,\n\t 'formats/code': _code.Code,\n\t 'formats/italic': _italic2.default,\n\t 'formats/link': _link2.default,\n\t 'formats/script': _script2.default,\n\t 'formats/strike': _strike2.default,\n\t 'formats/underline': _underline2.default,\n\t\n\t 'formats/image': _image2.default,\n\t 'formats/video': _video2.default,\n\t\n\t 'formats/list/item': _list.ListItem,\n\t\n\t 'modules/formula': _formula2.default,\n\t 'modules/syntax': _syntax2.default,\n\t 'modules/toolbar': _toolbar2.default,\n\t\n\t 'themes/bubble': _bubble2.default,\n\t 'themes/snow': _snow2.default,\n\t\n\t 'ui/icons': _icons2.default,\n\t 'ui/picker': _picker2.default,\n\t 'ui/icon-picker': _iconPicker2.default,\n\t 'ui/color-picker': _colorPicker2.default,\n\t 'ui/tooltip': _tooltip2.default\n\t}, true);\n\t\n\tmodule.exports = _core2.default;\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tvar _break = __webpack_require__(31);\n\t\n\tvar _break2 = _interopRequireDefault(_break);\n\t\n\tvar _container = __webpack_require__(46);\n\t\n\tvar _container2 = _interopRequireDefault(_container);\n\t\n\tvar _cursor = __webpack_require__(35);\n\t\n\tvar _cursor2 = _interopRequireDefault(_cursor);\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tvar _scroll = __webpack_require__(47);\n\t\n\tvar _scroll2 = _interopRequireDefault(_scroll);\n\t\n\tvar _text = __webpack_require__(34);\n\t\n\tvar _text2 = _interopRequireDefault(_text);\n\t\n\tvar _clipboard = __webpack_require__(48);\n\t\n\tvar _clipboard2 = _interopRequireDefault(_clipboard);\n\t\n\tvar _history = __webpack_require__(55);\n\t\n\tvar _history2 = _interopRequireDefault(_history);\n\t\n\tvar _keyboard = __webpack_require__(56);\n\t\n\tvar _keyboard2 = _interopRequireDefault(_keyboard);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t_quill2.default.register({\n\t 'blots/block': _block2.default,\n\t 'blots/block/embed': _block.BlockEmbed,\n\t 'blots/break': _break2.default,\n\t 'blots/container': _container2.default,\n\t 'blots/cursor': _cursor2.default,\n\t 'blots/embed': _embed2.default,\n\t 'blots/inline': _inline2.default,\n\t 'blots/scroll': _scroll2.default,\n\t 'blots/text': _text2.default,\n\t\n\t 'modules/clipboard': _clipboard2.default,\n\t 'modules/history': _history2.default,\n\t 'modules/keyboard': _keyboard2.default\n\t});\n\t\n\t_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default);\n\t\n\tmodule.exports = _quill2.default;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar container_1 = __webpack_require__(3);\n\tvar format_1 = __webpack_require__(7);\n\tvar leaf_1 = __webpack_require__(12);\n\tvar scroll_1 = __webpack_require__(13);\n\tvar inline_1 = __webpack_require__(14);\n\tvar block_1 = __webpack_require__(15);\n\tvar embed_1 = __webpack_require__(16);\n\tvar text_1 = __webpack_require__(17);\n\tvar attributor_1 = __webpack_require__(8);\n\tvar class_1 = __webpack_require__(10);\n\tvar style_1 = __webpack_require__(11);\n\tvar store_1 = __webpack_require__(9);\n\tvar Registry = __webpack_require__(6);\n\tvar Parchment = {\n\t Scope: Registry.Scope,\n\t create: Registry.create,\n\t find: Registry.find,\n\t query: Registry.query,\n\t register: Registry.register,\n\t Container: container_1.default,\n\t Format: format_1.default,\n\t Leaf: leaf_1.default,\n\t Embed: embed_1.default,\n\t Scroll: scroll_1.default,\n\t Block: block_1.default,\n\t Inline: inline_1.default,\n\t Text: text_1.default,\n\t Attributor: {\n\t Attribute: attributor_1.default,\n\t Class: class_1.default,\n\t Style: style_1.default,\n\t Store: store_1.default\n\t }\n\t};\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = Parchment;\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar linked_list_1 = __webpack_require__(4);\n\tvar shadow_1 = __webpack_require__(5);\n\tvar Registry = __webpack_require__(6);\n\tvar ContainerBlot = (function (_super) {\n\t __extends(ContainerBlot, _super);\n\t function ContainerBlot() {\n\t _super.apply(this, arguments);\n\t }\n\t ContainerBlot.prototype.appendChild = function (other) {\n\t this.insertBefore(other);\n\t };\n\t ContainerBlot.prototype.attach = function () {\n\t var _this = this;\n\t _super.prototype.attach.call(this);\n\t this.children = new linked_list_1.default();\n\t // Need to be reversed for if DOM nodes already in order\n\t [].slice.call(this.domNode.childNodes).reverse().forEach(function (node) {\n\t try {\n\t var child = makeBlot(node);\n\t _this.insertBefore(child, _this.children.head);\n\t }\n\t catch (err) {\n\t if (err instanceof Registry.ParchmentError)\n\t return;\n\t else\n\t throw err;\n\t }\n\t });\n\t };\n\t ContainerBlot.prototype.deleteAt = function (index, length) {\n\t if (index === 0 && length === this.length()) {\n\t return this.remove();\n\t }\n\t this.children.forEachAt(index, length, function (child, offset, length) {\n\t child.deleteAt(offset, length);\n\t });\n\t };\n\t ContainerBlot.prototype.descendant = function (criteria, index) {\n\t var _a = this.children.find(index), child = _a[0], offset = _a[1];\n\t if ((criteria.blotName == null && criteria(child)) ||\n\t (criteria.blotName != null && child instanceof criteria)) {\n\t return [child, offset];\n\t }\n\t else if (child instanceof ContainerBlot) {\n\t return child.descendant(criteria, offset);\n\t }\n\t else {\n\t return [null, -1];\n\t }\n\t };\n\t ContainerBlot.prototype.descendants = function (criteria, index, length) {\n\t if (index === void 0) { index = 0; }\n\t if (length === void 0) { length = Number.MAX_VALUE; }\n\t var descendants = [], lengthLeft = length;\n\t this.children.forEachAt(index, length, function (child, index, length) {\n\t if ((criteria.blotName == null && criteria(child)) ||\n\t (criteria.blotName != null && child instanceof criteria)) {\n\t descendants.push(child);\n\t }\n\t if (child instanceof ContainerBlot) {\n\t descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n\t }\n\t lengthLeft -= length;\n\t });\n\t return descendants;\n\t };\n\t ContainerBlot.prototype.detach = function () {\n\t this.children.forEach(function (child) {\n\t child.detach();\n\t });\n\t _super.prototype.detach.call(this);\n\t };\n\t ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n\t this.children.forEachAt(index, length, function (child, offset, length) {\n\t child.formatAt(offset, length, name, value);\n\t });\n\t };\n\t ContainerBlot.prototype.insertAt = function (index, value, def) {\n\t var _a = this.children.find(index), child = _a[0], offset = _a[1];\n\t if (child) {\n\t child.insertAt(offset, value, def);\n\t }\n\t else {\n\t var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def);\n\t this.appendChild(blot);\n\t }\n\t };\n\t ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n\t if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function (child) {\n\t return childBlot instanceof child;\n\t })) {\n\t throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n\t }\n\t childBlot.insertInto(this, refBlot);\n\t };\n\t ContainerBlot.prototype.length = function () {\n\t return this.children.reduce(function (memo, child) {\n\t return memo + child.length();\n\t }, 0);\n\t };\n\t ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n\t this.children.forEach(function (child) {\n\t targetParent.insertBefore(child, refNode);\n\t });\n\t };\n\t ContainerBlot.prototype.optimize = function () {\n\t _super.prototype.optimize.call(this);\n\t if (this.children.length === 0) {\n\t if (this.statics.defaultChild != null) {\n\t var child = Registry.create(this.statics.defaultChild);\n\t this.appendChild(child);\n\t child.optimize();\n\t }\n\t else {\n\t this.remove();\n\t }\n\t }\n\t };\n\t ContainerBlot.prototype.path = function (index, inclusive) {\n\t if (inclusive === void 0) { inclusive = false; }\n\t var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n\t var position = [[this, index]];\n\t if (child instanceof ContainerBlot) {\n\t return position.concat(child.path(offset, inclusive));\n\t }\n\t else if (child != null) {\n\t position.push([child, offset]);\n\t }\n\t return position;\n\t };\n\t ContainerBlot.prototype.removeChild = function (child) {\n\t this.children.remove(child);\n\t };\n\t ContainerBlot.prototype.replace = function (target) {\n\t if (target instanceof ContainerBlot) {\n\t target.moveChildren(this);\n\t }\n\t _super.prototype.replace.call(this, target);\n\t };\n\t ContainerBlot.prototype.split = function (index, force) {\n\t if (force === void 0) { force = false; }\n\t if (!force) {\n\t if (index === 0)\n\t return this;\n\t if (index === this.length())\n\t return this.next;\n\t }\n\t var after = this.clone();\n\t this.parent.insertBefore(after, this.next);\n\t this.children.forEachAt(index, this.length(), function (child, offset, length) {\n\t child = child.split(offset, force);\n\t after.appendChild(child);\n\t });\n\t return after;\n\t };\n\t ContainerBlot.prototype.unwrap = function () {\n\t this.moveChildren(this.parent, this.next);\n\t this.remove();\n\t };\n\t ContainerBlot.prototype.update = function (mutations) {\n\t var _this = this;\n\t var addedNodes = [], removedNodes = [];\n\t mutations.forEach(function (mutation) {\n\t if (mutation.target === _this.domNode && mutation.type === 'childList') {\n\t addedNodes.push.apply(addedNodes, mutation.addedNodes);\n\t removedNodes.push.apply(removedNodes, mutation.removedNodes);\n\t }\n\t });\n\t removedNodes.forEach(function (node) {\n\t if (node.parentNode != null &&\n\t (document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY)) {\n\t // Node has not actually been removed\n\t return;\n\t }\n\t var blot = Registry.find(node);\n\t if (blot == null)\n\t return;\n\t if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n\t blot.detach();\n\t }\n\t });\n\t addedNodes.filter(function (node) {\n\t return node.parentNode == _this.domNode;\n\t }).sort(function (a, b) {\n\t if (a === b)\n\t return 0;\n\t if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n\t return 1;\n\t }\n\t return -1;\n\t }).forEach(function (node) {\n\t var refBlot = null;\n\t if (node.nextSibling != null) {\n\t refBlot = Registry.find(node.nextSibling);\n\t }\n\t var blot = makeBlot(node);\n\t if (blot.next != refBlot || blot.next == null) {\n\t if (blot.parent != null) {\n\t blot.parent.removeChild(_this);\n\t }\n\t _this.insertBefore(blot, refBlot);\n\t }\n\t });\n\t };\n\t return ContainerBlot;\n\t}(shadow_1.default));\n\tfunction makeBlot(node) {\n\t var blot = Registry.find(node);\n\t if (blot == null) {\n\t try {\n\t blot = Registry.create(node);\n\t }\n\t catch (e) {\n\t blot = Registry.create(Registry.Scope.INLINE);\n\t [].slice.call(node.childNodes).forEach(function (child) {\n\t blot.domNode.appendChild(child);\n\t });\n\t node.parentNode.replaceChild(blot.domNode, node);\n\t blot.attach();\n\t }\n\t }\n\t return blot;\n\t}\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = ContainerBlot;\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar LinkedList = (function () {\n\t function LinkedList() {\n\t this.head = this.tail = undefined;\n\t this.length = 0;\n\t }\n\t LinkedList.prototype.append = function () {\n\t var nodes = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t nodes[_i - 0] = arguments[_i];\n\t }\n\t this.insertBefore(nodes[0], undefined);\n\t if (nodes.length > 1) {\n\t this.append.apply(this, nodes.slice(1));\n\t }\n\t };\n\t LinkedList.prototype.contains = function (node) {\n\t var cur, next = this.iterator();\n\t while (cur = next()) {\n\t if (cur === node)\n\t return true;\n\t }\n\t return false;\n\t };\n\t LinkedList.prototype.insertBefore = function (node, refNode) {\n\t node.next = refNode;\n\t if (refNode != null) {\n\t node.prev = refNode.prev;\n\t if (refNode.prev != null) {\n\t refNode.prev.next = node;\n\t }\n\t refNode.prev = node;\n\t if (refNode === this.head) {\n\t this.head = node;\n\t }\n\t }\n\t else if (this.tail != null) {\n\t this.tail.next = node;\n\t node.prev = this.tail;\n\t this.tail = node;\n\t }\n\t else {\n\t node.prev = undefined;\n\t this.head = this.tail = node;\n\t }\n\t this.length += 1;\n\t };\n\t LinkedList.prototype.offset = function (target) {\n\t var index = 0, cur = this.head;\n\t while (cur != null) {\n\t if (cur === target)\n\t return index;\n\t index += cur.length();\n\t cur = cur.next;\n\t }\n\t return -1;\n\t };\n\t LinkedList.prototype.remove = function (node) {\n\t if (!this.contains(node))\n\t return;\n\t if (node.prev != null)\n\t node.prev.next = node.next;\n\t if (node.next != null)\n\t node.next.prev = node.prev;\n\t if (node === this.head)\n\t this.head = node.next;\n\t if (node === this.tail)\n\t this.tail = node.prev;\n\t this.length -= 1;\n\t };\n\t LinkedList.prototype.iterator = function (curNode) {\n\t if (curNode === void 0) { curNode = this.head; }\n\t // TODO use yield when we can\n\t return function () {\n\t var ret = curNode;\n\t if (curNode != null)\n\t curNode = curNode.next;\n\t return ret;\n\t };\n\t };\n\t LinkedList.prototype.find = function (index, inclusive) {\n\t if (inclusive === void 0) { inclusive = false; }\n\t var cur, next = this.iterator();\n\t while (cur = next()) {\n\t var length_1 = cur.length();\n\t if (index < length_1 || (inclusive && index === length_1 && (cur.next == null || cur.next.length() !== 0))) {\n\t return [cur, index];\n\t }\n\t index -= length_1;\n\t }\n\t return [null, 0];\n\t };\n\t LinkedList.prototype.forEach = function (callback) {\n\t var cur, next = this.iterator();\n\t while (cur = next()) {\n\t callback(cur);\n\t }\n\t };\n\t LinkedList.prototype.forEachAt = function (index, length, callback) {\n\t if (length <= 0)\n\t return;\n\t var _a = this.find(index), startNode = _a[0], offset = _a[1];\n\t var cur, curIndex = index - offset, next = this.iterator(startNode);\n\t while ((cur = next()) && curIndex < index + length) {\n\t var curLength = cur.length();\n\t if (index > curIndex) {\n\t callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n\t }\n\t else {\n\t callback(cur, 0, Math.min(curLength, index + length - curIndex));\n\t }\n\t curIndex += curLength;\n\t }\n\t };\n\t LinkedList.prototype.map = function (callback) {\n\t return this.reduce(function (memo, cur) {\n\t memo.push(callback(cur));\n\t return memo;\n\t }, []);\n\t };\n\t LinkedList.prototype.reduce = function (callback, memo) {\n\t var cur, next = this.iterator();\n\t while (cur = next()) {\n\t memo = callback(memo, cur);\n\t }\n\t return memo;\n\t };\n\t return LinkedList;\n\t}());\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = LinkedList;\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar Registry = __webpack_require__(6);\n\tvar ShadowBlot = (function () {\n\t function ShadowBlot(domNode) {\n\t this.domNode = domNode;\n\t this.attach();\n\t }\n\t Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n\t // Hack for accessing inherited static methods\n\t get: function () {\n\t return this.constructor;\n\t },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t ShadowBlot.create = function (value) {\n\t if (this.tagName == null) {\n\t throw new Registry.ParchmentError('Blot definition missing tagName');\n\t }\n\t var node;\n\t if (Array.isArray(this.tagName)) {\n\t if (typeof value === 'string') {\n\t value = value.toUpperCase();\n\t if (parseInt(value).toString() === value) {\n\t value = parseInt(value);\n\t }\n\t }\n\t if (typeof value === 'number') {\n\t node = document.createElement(this.tagName[value - 1]);\n\t }\n\t else if (this.tagName.indexOf(value) > -1) {\n\t node = document.createElement(value);\n\t }\n\t else {\n\t node = document.createElement(this.tagName[0]);\n\t }\n\t }\n\t else {\n\t node = document.createElement(this.tagName);\n\t }\n\t if (this.className) {\n\t node.classList.add(this.className);\n\t }\n\t return node;\n\t };\n\t ShadowBlot.prototype.attach = function () {\n\t this.domNode[Registry.DATA_KEY] = { blot: this };\n\t };\n\t ShadowBlot.prototype.clone = function () {\n\t var domNode = this.domNode.cloneNode();\n\t return Registry.create(domNode);\n\t };\n\t ShadowBlot.prototype.detach = function () {\n\t if (this.parent != null)\n\t this.parent.removeChild(this);\n\t delete this.domNode[Registry.DATA_KEY];\n\t };\n\t ShadowBlot.prototype.deleteAt = function (index, length) {\n\t var blot = this.isolate(index, length);\n\t blot.remove();\n\t };\n\t ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n\t var blot = this.isolate(index, length);\n\t if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n\t blot.wrap(name, value);\n\t }\n\t else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n\t var parent_1 = Registry.create(this.statics.scope);\n\t blot.wrap(parent_1);\n\t parent_1.format(name, value);\n\t }\n\t };\n\t ShadowBlot.prototype.insertAt = function (index, value, def) {\n\t var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def);\n\t var ref = this.split(index);\n\t this.parent.insertBefore(blot, ref);\n\t };\n\t ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n\t if (this.parent != null) {\n\t this.parent.children.remove(this);\n\t }\n\t parentBlot.children.insertBefore(this, refBlot);\n\t if (refBlot != null) {\n\t var refDomNode = refBlot.domNode;\n\t }\n\t if (this.next == null || this.domNode.nextSibling != refDomNode) {\n\t parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n\t }\n\t this.parent = parentBlot;\n\t };\n\t ShadowBlot.prototype.isolate = function (index, length) {\n\t var target = this.split(index);\n\t target.split(length);\n\t return target;\n\t };\n\t ShadowBlot.prototype.length = function () {\n\t return 1;\n\t };\n\t ;\n\t ShadowBlot.prototype.offset = function (root) {\n\t if (root === void 0) { root = this.parent; }\n\t if (this.parent == null || this == root)\n\t return 0;\n\t return this.parent.children.offset(this) + this.parent.offset(root);\n\t };\n\t ShadowBlot.prototype.optimize = function () {\n\t // TODO clean up once we use WeakMap\n\t if (this.domNode[Registry.DATA_KEY] != null) {\n\t delete this.domNode[Registry.DATA_KEY].mutations;\n\t }\n\t };\n\t ShadowBlot.prototype.remove = function () {\n\t if (this.domNode.parentNode != null) {\n\t this.domNode.parentNode.removeChild(this.domNode);\n\t }\n\t this.detach();\n\t };\n\t ShadowBlot.prototype.replace = function (target) {\n\t if (target.parent == null)\n\t return;\n\t target.parent.insertBefore(this, target.next);\n\t target.remove();\n\t };\n\t ShadowBlot.prototype.replaceWith = function (name, value) {\n\t var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n\t replacement.replace(this);\n\t return replacement;\n\t };\n\t ShadowBlot.prototype.split = function (index, force) {\n\t return index === 0 ? this : this.next;\n\t };\n\t ShadowBlot.prototype.update = function (mutations) {\n\t if (mutations === void 0) { mutations = []; }\n\t // Nothing to do by default\n\t };\n\t ShadowBlot.prototype.wrap = function (name, value) {\n\t var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n\t if (this.parent != null) {\n\t this.parent.insertBefore(wrapper, this.next);\n\t }\n\t wrapper.appendChild(this);\n\t return wrapper;\n\t };\n\t ShadowBlot.blotName = 'abstract';\n\t return ShadowBlot;\n\t}());\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = ShadowBlot;\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar ParchmentError = (function (_super) {\n\t __extends(ParchmentError, _super);\n\t function ParchmentError(message) {\n\t message = '[Parchment] ' + message;\n\t _super.call(this, message);\n\t this.message = message;\n\t this.name = this.constructor.name;\n\t }\n\t return ParchmentError;\n\t}(Error));\n\texports.ParchmentError = ParchmentError;\n\tvar attributes = {};\n\tvar classes = {};\n\tvar tags = {};\n\tvar types = {};\n\texports.DATA_KEY = '__blot';\n\t(function (Scope) {\n\t Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n\t Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n\t Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n\t Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n\t Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n\t Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n\t Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n\t Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n\t Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n\t Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n\t Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n\t})(exports.Scope || (exports.Scope = {}));\n\tvar Scope = exports.Scope;\n\t;\n\tfunction create(input, value) {\n\t var match = query(input);\n\t if (match == null) {\n\t throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n\t }\n\t var BlotClass = match;\n\t var node = input instanceof Node ? input : BlotClass.create(value);\n\t return new BlotClass(node, value);\n\t}\n\texports.create = create;\n\tfunction find(node, bubble) {\n\t if (bubble === void 0) { bubble = false; }\n\t if (node == null)\n\t return null;\n\t if (node[exports.DATA_KEY] != null)\n\t return node[exports.DATA_KEY].blot;\n\t if (bubble)\n\t return find(node.parentNode, bubble);\n\t return null;\n\t}\n\texports.find = find;\n\tfunction query(query, scope) {\n\t if (scope === void 0) { scope = Scope.ANY; }\n\t var match;\n\t if (typeof query === 'string') {\n\t match = types[query] || attributes[query];\n\t }\n\t else if (query instanceof Text) {\n\t match = types['text'];\n\t }\n\t else if (typeof query === 'number') {\n\t if (query & Scope.LEVEL & Scope.BLOCK) {\n\t match = types['block'];\n\t }\n\t else if (query & Scope.LEVEL & Scope.INLINE) {\n\t match = types['inline'];\n\t }\n\t }\n\t else if (query instanceof HTMLElement) {\n\t var names = (query.getAttribute('class') || '').split(/\\s+/);\n\t for (var i in names) {\n\t match = classes[names[i]];\n\t if (match)\n\t break;\n\t }\n\t match = match || tags[query.tagName];\n\t }\n\t if (match == null) {\n\t if (query instanceof Node) {\n\t console.log(query.nodeType);\n\t }\n\t }\n\t if (match == null)\n\t return null;\n\t if ((scope & Scope.LEVEL & match.scope) && (scope & Scope.TYPE & match.scope))\n\t return match;\n\t return null;\n\t}\n\texports.query = query;\n\tfunction register() {\n\t var Definitions = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t Definitions[_i - 0] = arguments[_i];\n\t }\n\t if (Definitions.length > 1) {\n\t return Definitions.map(function (d) {\n\t return register(d);\n\t });\n\t }\n\t var Definition = Definitions[0];\n\t if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n\t throw new ParchmentError('Invalid definition');\n\t }\n\t else if (Definition.blotName === 'abstract') {\n\t throw new ParchmentError('Cannot register abstract class');\n\t }\n\t types[Definition.blotName || Definition.attrName] = Definition;\n\t if (typeof Definition.keyName === 'string') {\n\t attributes[Definition.keyName] = Definition;\n\t }\n\t else {\n\t if (Definition.className != null) {\n\t classes[Definition.className] = Definition;\n\t }\n\t if (Definition.tagName != null) {\n\t if (Array.isArray(Definition.tagName)) {\n\t Definition.tagName = Definition.tagName.map(function (tagName) {\n\t return tagName.toUpperCase();\n\t });\n\t }\n\t else {\n\t Definition.tagName = Definition.tagName.toUpperCase();\n\t }\n\t var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n\t tagNames.forEach(function (tag) {\n\t if (tags[tag] == null || Definition.className == null) {\n\t tags[tag] = Definition;\n\t }\n\t });\n\t }\n\t }\n\t return Definition;\n\t}\n\texports.register = register;\n\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar attributor_1 = __webpack_require__(8);\n\tvar store_1 = __webpack_require__(9);\n\tvar container_1 = __webpack_require__(3);\n\tvar Registry = __webpack_require__(6);\n\tvar FormatBlot = (function (_super) {\n\t __extends(FormatBlot, _super);\n\t function FormatBlot() {\n\t _super.apply(this, arguments);\n\t }\n\t FormatBlot.formats = function (domNode) {\n\t if (typeof this.tagName === 'string') {\n\t return true;\n\t }\n\t else if (Array.isArray(this.tagName)) {\n\t return domNode.tagName.toLowerCase();\n\t }\n\t return undefined;\n\t };\n\t FormatBlot.prototype.attach = function () {\n\t _super.prototype.attach.call(this);\n\t this.attributes = new store_1.default(this.domNode);\n\t };\n\t FormatBlot.prototype.format = function (name, value) {\n\t var format = Registry.query(name);\n\t if (format instanceof attributor_1.default) {\n\t this.attributes.attribute(format, value);\n\t }\n\t else if (value) {\n\t if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n\t this.replaceWith(name, value);\n\t }\n\t }\n\t };\n\t FormatBlot.prototype.formats = function () {\n\t var formats = this.attributes.values();\n\t var format = this.statics.formats(this.domNode);\n\t if (format != null) {\n\t formats[this.statics.blotName] = format;\n\t }\n\t return formats;\n\t };\n\t FormatBlot.prototype.replaceWith = function (name, value) {\n\t var replacement = _super.prototype.replaceWith.call(this, name, value);\n\t this.attributes.copy(replacement);\n\t return replacement;\n\t };\n\t FormatBlot.prototype.update = function (mutations) {\n\t var _this = this;\n\t _super.prototype.update.call(this, mutations);\n\t if (mutations.some(function (mutation) {\n\t return mutation.target === _this.domNode && mutation.type === 'attributes';\n\t })) {\n\t this.attributes.build();\n\t }\n\t };\n\t FormatBlot.prototype.wrap = function (name, value) {\n\t var wrapper = _super.prototype.wrap.call(this, name, value);\n\t if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n\t this.attributes.move(wrapper);\n\t }\n\t return wrapper;\n\t };\n\t return FormatBlot;\n\t}(container_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = FormatBlot;\n\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar Registry = __webpack_require__(6);\n\tvar Attributor = (function () {\n\t function Attributor(attrName, keyName, options) {\n\t if (options === void 0) { options = {}; }\n\t this.attrName = attrName;\n\t this.keyName = keyName;\n\t var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n\t if (options.scope != null) {\n\t // Ignore type bits, force attribute bit\n\t this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n\t }\n\t else {\n\t this.scope = Registry.Scope.ATTRIBUTE;\n\t }\n\t if (options.whitelist != null)\n\t this.whitelist = options.whitelist;\n\t }\n\t Attributor.keys = function (node) {\n\t return [].map.call(node.attributes, function (item) {\n\t return item.name;\n\t });\n\t };\n\t Attributor.prototype.add = function (node, value) {\n\t if (!this.canAdd(node, value))\n\t return false;\n\t node.setAttribute(this.keyName, value);\n\t return true;\n\t };\n\t Attributor.prototype.canAdd = function (node, value) {\n\t var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n\t if (match != null && (this.whitelist == null || this.whitelist.indexOf(value) > -1)) {\n\t return true;\n\t }\n\t return false;\n\t };\n\t Attributor.prototype.remove = function (node) {\n\t node.removeAttribute(this.keyName);\n\t };\n\t Attributor.prototype.value = function (node) {\n\t return node.getAttribute(this.keyName);\n\t };\n\t return Attributor;\n\t}());\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = Attributor;\n\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar attributor_1 = __webpack_require__(8);\n\tvar class_1 = __webpack_require__(10);\n\tvar style_1 = __webpack_require__(11);\n\tvar Registry = __webpack_require__(6);\n\tvar AttributorStore = (function () {\n\t function AttributorStore(domNode) {\n\t this.attributes = {};\n\t this.domNode = domNode;\n\t this.build();\n\t }\n\t AttributorStore.prototype.attribute = function (attribute, value) {\n\t if (value) {\n\t if (attribute.add(this.domNode, value)) {\n\t if (attribute.value(this.domNode) != null) {\n\t this.attributes[attribute.attrName] = attribute;\n\t }\n\t else {\n\t delete this.attributes[attribute.attrName];\n\t }\n\t }\n\t }\n\t else {\n\t attribute.remove(this.domNode);\n\t delete this.attributes[attribute.attrName];\n\t }\n\t };\n\t AttributorStore.prototype.build = function () {\n\t var _this = this;\n\t this.attributes = {};\n\t var attributes = attributor_1.default.keys(this.domNode);\n\t var classes = class_1.default.keys(this.domNode);\n\t var styles = style_1.default.keys(this.domNode);\n\t attributes.concat(classes).concat(styles).forEach(function (name) {\n\t var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n\t if (attr instanceof attributor_1.default) {\n\t _this.attributes[attr.attrName] = attr;\n\t }\n\t });\n\t };\n\t AttributorStore.prototype.copy = function (target) {\n\t var _this = this;\n\t Object.keys(this.attributes).forEach(function (key) {\n\t var value = _this.attributes[key].value(_this.domNode);\n\t target.format(key, value);\n\t });\n\t };\n\t AttributorStore.prototype.move = function (target) {\n\t var _this = this;\n\t this.copy(target);\n\t Object.keys(this.attributes).forEach(function (key) {\n\t _this.attributes[key].remove(_this.domNode);\n\t });\n\t this.attributes = {};\n\t };\n\t AttributorStore.prototype.values = function () {\n\t var _this = this;\n\t return Object.keys(this.attributes).reduce(function (attributes, name) {\n\t attributes[name] = _this.attributes[name].value(_this.domNode);\n\t return attributes;\n\t }, {});\n\t };\n\t return AttributorStore;\n\t}());\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = AttributorStore;\n\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar attributor_1 = __webpack_require__(8);\n\tfunction match(node, prefix) {\n\t var className = node.getAttribute('class') || '';\n\t return className.split(/\\s+/).filter(function (name) {\n\t return name.indexOf(prefix + \"-\") === 0;\n\t });\n\t}\n\tvar ClassAttributor = (function (_super) {\n\t __extends(ClassAttributor, _super);\n\t function ClassAttributor() {\n\t _super.apply(this, arguments);\n\t }\n\t ClassAttributor.keys = function (node) {\n\t return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n\t return name.split('-').slice(0, -1).join('-');\n\t });\n\t };\n\t ClassAttributor.prototype.add = function (node, value) {\n\t if (!this.canAdd(node, value))\n\t return false;\n\t this.remove(node);\n\t node.classList.add(this.keyName + \"-\" + value);\n\t return true;\n\t };\n\t ClassAttributor.prototype.remove = function (node) {\n\t var matches = match(node, this.keyName);\n\t matches.forEach(function (name) {\n\t node.classList.remove(name);\n\t });\n\t if (node.classList.length === 0) {\n\t node.removeAttribute('class');\n\t }\n\t };\n\t ClassAttributor.prototype.value = function (node) {\n\t var result = match(node, this.keyName)[0] || '';\n\t return result.slice(this.keyName.length + 1); // +1 for hyphen\n\t };\n\t return ClassAttributor;\n\t}(attributor_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = ClassAttributor;\n\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar attributor_1 = __webpack_require__(8);\n\tfunction camelize(name) {\n\t var parts = name.split('-');\n\t var rest = parts.slice(1).map(function (part) {\n\t return part[0].toUpperCase() + part.slice(1);\n\t }).join('');\n\t return parts[0] + rest;\n\t}\n\tvar StyleAttributor = (function (_super) {\n\t __extends(StyleAttributor, _super);\n\t function StyleAttributor() {\n\t _super.apply(this, arguments);\n\t }\n\t StyleAttributor.keys = function (node) {\n\t return (node.getAttribute('style') || '').split(';').map(function (value) {\n\t var arr = value.split(':');\n\t return arr[0].trim();\n\t });\n\t };\n\t StyleAttributor.prototype.add = function (node, value) {\n\t if (!this.canAdd(node, value))\n\t return false;\n\t node.style[camelize(this.keyName)] = value;\n\t return true;\n\t };\n\t StyleAttributor.prototype.remove = function (node) {\n\t node.style[camelize(this.keyName)] = '';\n\t if (!node.getAttribute('style')) {\n\t node.removeAttribute('style');\n\t }\n\t };\n\t StyleAttributor.prototype.value = function (node) {\n\t return node.style[camelize(this.keyName)];\n\t };\n\t return StyleAttributor;\n\t}(attributor_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = StyleAttributor;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar shadow_1 = __webpack_require__(5);\n\tvar Registry = __webpack_require__(6);\n\tvar LeafBlot = (function (_super) {\n\t __extends(LeafBlot, _super);\n\t function LeafBlot() {\n\t _super.apply(this, arguments);\n\t }\n\t LeafBlot.value = function (domNode) {\n\t return true;\n\t };\n\t LeafBlot.prototype.index = function (node, offset) {\n\t if (node !== this.domNode)\n\t return -1;\n\t return Math.min(offset, 1);\n\t };\n\t LeafBlot.prototype.position = function (index, inclusive) {\n\t var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n\t if (index > 0)\n\t offset += 1;\n\t return [this.parent.domNode, offset];\n\t };\n\t LeafBlot.prototype.value = function () {\n\t return (_a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a);\n\t var _a;\n\t };\n\t LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n\t return LeafBlot;\n\t}(shadow_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = LeafBlot;\n\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar container_1 = __webpack_require__(3);\n\tvar Registry = __webpack_require__(6);\n\tvar OBSERVER_CONFIG = {\n\t attributes: true,\n\t characterData: true,\n\t characterDataOldValue: true,\n\t childList: true,\n\t subtree: true\n\t};\n\tvar MAX_OPTIMIZE_ITERATIONS = 100;\n\tvar ScrollBlot = (function (_super) {\n\t __extends(ScrollBlot, _super);\n\t function ScrollBlot(node) {\n\t var _this = this;\n\t _super.call(this, node);\n\t this.parent = null;\n\t this.observer = new MutationObserver(function (mutations) {\n\t _this.update(mutations);\n\t });\n\t this.observer.observe(this.domNode, OBSERVER_CONFIG);\n\t }\n\t ScrollBlot.prototype.detach = function () {\n\t _super.prototype.detach.call(this);\n\t this.observer.disconnect();\n\t };\n\t ScrollBlot.prototype.deleteAt = function (index, length) {\n\t this.update();\n\t if (index === 0 && length === this.length()) {\n\t this.children.forEach(function (child) {\n\t child.remove();\n\t });\n\t }\n\t else {\n\t _super.prototype.deleteAt.call(this, index, length);\n\t }\n\t };\n\t ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n\t this.update();\n\t _super.prototype.formatAt.call(this, index, length, name, value);\n\t };\n\t ScrollBlot.prototype.insertAt = function (index, value, def) {\n\t this.update();\n\t _super.prototype.insertAt.call(this, index, value, def);\n\t };\n\t ScrollBlot.prototype.optimize = function (mutations) {\n\t var _this = this;\n\t if (mutations === void 0) { mutations = []; }\n\t _super.prototype.optimize.call(this);\n\t mutations.push.apply(mutations, this.observer.takeRecords());\n\t // TODO use WeakMap\n\t var mark = function (blot, markParent) {\n\t if (markParent === void 0) { markParent = true; }\n\t if (blot == null || blot === _this)\n\t return;\n\t if (blot.domNode.parentNode == null)\n\t return;\n\t if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n\t blot.domNode[Registry.DATA_KEY].mutations = [];\n\t }\n\t if (markParent)\n\t mark(blot.parent);\n\t };\n\t var optimize = function (blot) {\n\t if (blot.domNode[Registry.DATA_KEY] == null || blot.domNode[Registry.DATA_KEY].mutations == null) {\n\t return;\n\t }\n\t if (blot instanceof container_1.default) {\n\t blot.children.forEach(optimize);\n\t }\n\t blot.optimize();\n\t };\n\t var remaining = mutations;\n\t for (var i = 0; remaining.length > 0; i += 1) {\n\t if (i >= MAX_OPTIMIZE_ITERATIONS) {\n\t throw new Error('[Parchment] Maximum optimize iterations reached');\n\t }\n\t remaining.forEach(function (mutation) {\n\t var blot = Registry.find(mutation.target, true);\n\t if (blot == null)\n\t return;\n\t if (blot.domNode === mutation.target) {\n\t if (mutation.type === 'childList') {\n\t mark(Registry.find(mutation.previousSibling, false));\n\t [].forEach.call(mutation.addedNodes, function (node) {\n\t var child = Registry.find(node, false);\n\t mark(child, false);\n\t if (child instanceof container_1.default) {\n\t child.children.forEach(function (grandChild) {\n\t mark(grandChild, false);\n\t });\n\t }\n\t });\n\t }\n\t else if (mutation.type === 'attributes') {\n\t mark(blot.prev);\n\t }\n\t }\n\t mark(blot);\n\t });\n\t this.children.forEach(optimize);\n\t remaining = this.observer.takeRecords();\n\t mutations.push.apply(mutations, remaining);\n\t }\n\t };\n\t ScrollBlot.prototype.update = function (mutations) {\n\t var _this = this;\n\t mutations = mutations || this.observer.takeRecords();\n\t // TODO use WeakMap\n\t mutations.map(function (mutation) {\n\t var blot = Registry.find(mutation.target, true);\n\t if (blot == null)\n\t return;\n\t if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n\t blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n\t return blot;\n\t }\n\t else {\n\t blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n\t return null;\n\t }\n\t }).forEach(function (blot) {\n\t if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null)\n\t return;\n\t blot.update(blot.domNode[Registry.DATA_KEY].mutations || []);\n\t });\n\t if (this.domNode[Registry.DATA_KEY].mutations != null) {\n\t _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations);\n\t }\n\t this.optimize(mutations);\n\t };\n\t ScrollBlot.blotName = 'scroll';\n\t ScrollBlot.defaultChild = 'block';\n\t ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n\t ScrollBlot.tagName = 'DIV';\n\t return ScrollBlot;\n\t}(container_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = ScrollBlot;\n\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar format_1 = __webpack_require__(7);\n\tvar Registry = __webpack_require__(6);\n\t// Shallow object comparison\n\tfunction isEqual(obj1, obj2) {\n\t if (Object.keys(obj1).length !== Object.keys(obj2).length)\n\t return false;\n\t for (var prop in obj1) {\n\t if (obj1[prop] !== obj2[prop])\n\t return false;\n\t }\n\t return true;\n\t}\n\tvar InlineBlot = (function (_super) {\n\t __extends(InlineBlot, _super);\n\t function InlineBlot() {\n\t _super.apply(this, arguments);\n\t }\n\t InlineBlot.formats = function (domNode) {\n\t if (domNode.tagName === InlineBlot.tagName)\n\t return undefined;\n\t return _super.formats.call(this, domNode);\n\t };\n\t InlineBlot.prototype.format = function (name, value) {\n\t var _this = this;\n\t if (name === this.statics.blotName && !value) {\n\t this.children.forEach(function (child) {\n\t if (!(child instanceof format_1.default)) {\n\t child = child.wrap(InlineBlot.blotName, true);\n\t }\n\t _this.attributes.copy(child);\n\t });\n\t this.unwrap();\n\t }\n\t else {\n\t _super.prototype.format.call(this, name, value);\n\t }\n\t };\n\t InlineBlot.prototype.formatAt = function (index, length, name, value) {\n\t if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n\t var blot = this.isolate(index, length);\n\t blot.format(name, value);\n\t }\n\t else {\n\t _super.prototype.formatAt.call(this, index, length, name, value);\n\t }\n\t };\n\t InlineBlot.prototype.optimize = function () {\n\t _super.prototype.optimize.call(this);\n\t var formats = this.formats();\n\t if (Object.keys(formats).length === 0) {\n\t return this.unwrap(); // unformatted span\n\t }\n\t var next = this.next;\n\t if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n\t next.moveChildren(this);\n\t next.remove();\n\t }\n\t };\n\t InlineBlot.blotName = 'inline';\n\t InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n\t InlineBlot.tagName = 'SPAN';\n\t return InlineBlot;\n\t}(format_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = InlineBlot;\n\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar format_1 = __webpack_require__(7);\n\tvar Registry = __webpack_require__(6);\n\tvar BlockBlot = (function (_super) {\n\t __extends(BlockBlot, _super);\n\t function BlockBlot() {\n\t _super.apply(this, arguments);\n\t }\n\t BlockBlot.formats = function (domNode) {\n\t var tagName = Registry.query(BlockBlot.blotName).tagName;\n\t if (domNode.tagName === tagName)\n\t return undefined;\n\t return _super.formats.call(this, domNode);\n\t };\n\t BlockBlot.prototype.format = function (name, value) {\n\t if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n\t return;\n\t }\n\t else if (name === this.statics.blotName && !value) {\n\t this.replaceWith(BlockBlot.blotName);\n\t }\n\t else {\n\t _super.prototype.format.call(this, name, value);\n\t }\n\t };\n\t BlockBlot.prototype.formatAt = function (index, length, name, value) {\n\t if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n\t this.format(name, value);\n\t }\n\t else {\n\t _super.prototype.formatAt.call(this, index, length, name, value);\n\t }\n\t };\n\t BlockBlot.prototype.insertAt = function (index, value, def) {\n\t if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n\t // Insert text or inline\n\t _super.prototype.insertAt.call(this, index, value, def);\n\t }\n\t else {\n\t var after = this.split(index);\n\t var blot = Registry.create(value, def);\n\t after.parent.insertBefore(blot, after);\n\t }\n\t };\n\t BlockBlot.blotName = 'block';\n\t BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n\t BlockBlot.tagName = 'P';\n\t return BlockBlot;\n\t}(format_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = BlockBlot;\n\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar leaf_1 = __webpack_require__(12);\n\tvar EmbedBlot = (function (_super) {\n\t __extends(EmbedBlot, _super);\n\t function EmbedBlot() {\n\t _super.apply(this, arguments);\n\t }\n\t EmbedBlot.formats = function (domNode) {\n\t return undefined;\n\t };\n\t EmbedBlot.prototype.format = function (name, value) {\n\t // super.formatAt wraps, which is what we want in general,\n\t // but this allows subclasses to overwrite for formats\n\t // that just apply to particular embeds\n\t _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n\t };\n\t EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n\t if (index === 0 && length === this.length()) {\n\t this.format(name, value);\n\t }\n\t else {\n\t _super.prototype.formatAt.call(this, index, length, name, value);\n\t }\n\t };\n\t EmbedBlot.prototype.formats = function () {\n\t return this.statics.formats(this.domNode);\n\t };\n\t return EmbedBlot;\n\t}(leaf_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = EmbedBlot;\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar leaf_1 = __webpack_require__(12);\n\tvar Registry = __webpack_require__(6);\n\tvar TextBlot = (function (_super) {\n\t __extends(TextBlot, _super);\n\t function TextBlot(node) {\n\t _super.call(this, node);\n\t this.text = this.statics.value(this.domNode);\n\t }\n\t TextBlot.create = function (value) {\n\t return document.createTextNode(value);\n\t };\n\t TextBlot.value = function (domNode) {\n\t return domNode.data;\n\t };\n\t TextBlot.prototype.deleteAt = function (index, length) {\n\t this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n\t };\n\t TextBlot.prototype.index = function (node, offset) {\n\t if (this.domNode === node) {\n\t return offset;\n\t }\n\t return -1;\n\t };\n\t TextBlot.prototype.insertAt = function (index, value, def) {\n\t if (def == null) {\n\t this.text = this.text.slice(0, index) + value + this.text.slice(index);\n\t this.domNode.data = this.text;\n\t }\n\t else {\n\t _super.prototype.insertAt.call(this, index, value, def);\n\t }\n\t };\n\t TextBlot.prototype.length = function () {\n\t return this.text.length;\n\t };\n\t TextBlot.prototype.optimize = function () {\n\t _super.prototype.optimize.call(this);\n\t this.text = this.statics.value(this.domNode);\n\t if (this.text.length === 0) {\n\t this.remove();\n\t }\n\t else if (this.next instanceof TextBlot && this.next.prev === this) {\n\t this.insertAt(this.length(), this.next.value());\n\t this.next.remove();\n\t }\n\t };\n\t TextBlot.prototype.position = function (index, inclusive) {\n\t if (inclusive === void 0) { inclusive = false; }\n\t return [this.domNode, index];\n\t };\n\t TextBlot.prototype.split = function (index, force) {\n\t if (force === void 0) { force = false; }\n\t if (!force) {\n\t if (index === 0)\n\t return this;\n\t if (index === this.length())\n\t return this.next;\n\t }\n\t var after = Registry.create(this.domNode.splitText(index));\n\t this.parent.insertBefore(after, this.next);\n\t this.text = this.statics.value(this.domNode);\n\t return after;\n\t };\n\t TextBlot.prototype.update = function (mutations) {\n\t var _this = this;\n\t if (mutations.some(function (mutation) {\n\t return mutation.type === 'characterData' && mutation.target === _this.domNode;\n\t })) {\n\t this.text = this.statics.value(this.domNode);\n\t }\n\t };\n\t TextBlot.prototype.value = function () {\n\t return this.text;\n\t };\n\t TextBlot.blotName = 'text';\n\t TextBlot.scope = Registry.Scope.INLINE_BLOT;\n\t return TextBlot;\n\t}(leaf_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = TextBlot;\n\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.overload = exports.expandConfig = undefined;\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\t__webpack_require__(19);\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _editor = __webpack_require__(27);\n\t\n\tvar _editor2 = _interopRequireDefault(_editor);\n\t\n\tvar _emitter3 = __webpack_require__(36);\n\t\n\tvar _emitter4 = _interopRequireDefault(_emitter3);\n\t\n\tvar _module = __webpack_require__(43);\n\t\n\tvar _module2 = _interopRequireDefault(_module);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _selection = __webpack_require__(44);\n\t\n\tvar _selection2 = _interopRequireDefault(_selection);\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _logger = __webpack_require__(38);\n\t\n\tvar _logger2 = _interopRequireDefault(_logger);\n\t\n\tvar _theme = __webpack_require__(45);\n\t\n\tvar _theme2 = _interopRequireDefault(_theme);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar debug = (0, _logger2.default)('quill');\n\t\n\tvar Quill = function () {\n\t _createClass(Quill, null, [{\n\t key: 'debug',\n\t value: function debug(limit) {\n\t if (limit === true) {\n\t limit = 'log';\n\t }\n\t _logger2.default.level(limit);\n\t }\n\t }, {\n\t key: 'import',\n\t value: function _import(name) {\n\t if (this.imports[name] == null) {\n\t debug.error('Cannot import ' + name + '. Are you sure it was registered?');\n\t }\n\t return this.imports[name];\n\t }\n\t }, {\n\t key: 'register',\n\t value: function register(path, target) {\n\t var _this = this;\n\t\n\t var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\t\n\t if (typeof path !== 'string') {\n\t var name = path.attrName || path.blotName;\n\t if (typeof name === 'string') {\n\t // register(Blot | Attributor, overwrite)\n\t this.register('formats/' + name, path, target);\n\t } else {\n\t Object.keys(path).forEach(function (key) {\n\t _this.register(key, path[key], target);\n\t });\n\t }\n\t } else {\n\t if (this.imports[path] != null && !overwrite) {\n\t debug.warn('Overwriting ' + path + ' with', target);\n\t }\n\t this.imports[path] = target;\n\t if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') {\n\t _parchment2.default.register(target);\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t function Quill(container) {\n\t var _this2 = this;\n\t\n\t var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t\n\t _classCallCheck(this, Quill);\n\t\n\t this.options = expandConfig(container, options);\n\t this.container = this.options.container;\n\t if (this.container == null) {\n\t return debug.error('Invalid Quill container', container);\n\t }\n\t if (this.options.debug) {\n\t Quill.debug(this.options.debug);\n\t }\n\t var html = this.container.innerHTML.trim();\n\t this.container.classList.add('ql-container');\n\t this.container.innerHTML = '';\n\t this.root = this.addContainer('ql-editor');\n\t this.root.classList.add('ql-blank');\n\t this.emitter = new _emitter4.default();\n\t this.scroll = _parchment2.default.create(this.root, {\n\t emitter: this.emitter,\n\t whitelist: this.options.formats\n\t });\n\t this.editor = new _editor2.default(this.scroll);\n\t this.selection = new _selection2.default(this.scroll, this.emitter);\n\t this.theme = new this.options.theme(this, this.options);\n\t this.keyboard = this.theme.addModule('keyboard');\n\t this.clipboard = this.theme.addModule('clipboard');\n\t this.history = this.theme.addModule('history');\n\t this.theme.init();\n\t this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) {\n\t if (type === _emitter4.default.events.TEXT_CHANGE) {\n\t _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank());\n\t }\n\t });\n\t this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) {\n\t var range = _this2.selection.lastRange;\n\t var index = range && range.length === 0 ? range.index : undefined;\n\t modify.call(_this2, function () {\n\t return _this2.editor.update(null, mutations, index);\n\t }, source);\n\t });\n\t var contents = this.clipboard.convert('
    ' + html + '


    ');\n\t this.setContents(contents);\n\t this.history.clear();\n\t if (this.options.placeholder) {\n\t this.root.setAttribute('data-placeholder', this.options.placeholder);\n\t }\n\t if (this.options.readOnly) {\n\t this.disable();\n\t }\n\t }\n\t\n\t _createClass(Quill, [{\n\t key: 'addContainer',\n\t value: function addContainer(container) {\n\t var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\t\n\t if (typeof container === 'string') {\n\t var className = container;\n\t container = document.createElement('div');\n\t container.classList.add(className);\n\t }\n\t this.container.insertBefore(container, refNode);\n\t return container;\n\t }\n\t }, {\n\t key: 'blur',\n\t value: function blur() {\n\t this.selection.setRange(null);\n\t }\n\t }, {\n\t key: 'deleteText',\n\t value: function deleteText(index, length, source) {\n\t var _this3 = this;\n\t\n\t var _overload = overload(index, length, source);\n\t\n\t var _overload2 = _slicedToArray(_overload, 4);\n\t\n\t index = _overload2[0];\n\t length = _overload2[1];\n\t source = _overload2[3];\n\t\n\t return modify.call(this, function () {\n\t return _this3.editor.deleteText(index, length);\n\t }, source, index, -1 * length);\n\t }\n\t }, {\n\t key: 'disable',\n\t value: function disable() {\n\t this.enable(false);\n\t }\n\t }, {\n\t key: 'enable',\n\t value: function enable() {\n\t var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\t\n\t this.scroll.enable(enabled);\n\t this.container.classList.toggle('ql-disabled', !enabled);\n\t if (!enabled) {\n\t this.blur();\n\t }\n\t }\n\t }, {\n\t key: 'focus',\n\t value: function focus() {\n\t this.selection.focus();\n\t this.selection.scrollIntoView();\n\t }\n\t }, {\n\t key: 'format',\n\t value: function format(name, value) {\n\t var _this4 = this;\n\t\n\t var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;\n\t\n\t return modify.call(this, function () {\n\t var range = _this4.getSelection(true);\n\t var change = new _quillDelta2.default();\n\t if (range == null) {\n\t return change;\n\t } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {\n\t change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value));\n\t } else if (range.length === 0) {\n\t _this4.selection.format(name, value);\n\t return change;\n\t } else {\n\t change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value));\n\t }\n\t _this4.setSelection(range, _emitter4.default.sources.SILENT);\n\t return change;\n\t }, source);\n\t }\n\t }, {\n\t key: 'formatLine',\n\t value: function formatLine(index, length, name, value, source) {\n\t var _this5 = this;\n\t\n\t var formats = void 0;\n\t\n\t var _overload3 = overload(index, length, name, value, source);\n\t\n\t var _overload4 = _slicedToArray(_overload3, 4);\n\t\n\t index = _overload4[0];\n\t length = _overload4[1];\n\t formats = _overload4[2];\n\t source = _overload4[3];\n\t\n\t return modify.call(this, function () {\n\t return _this5.editor.formatLine(index, length, formats);\n\t }, source, index, 0);\n\t }\n\t }, {\n\t key: 'formatText',\n\t value: function formatText(index, length, name, value, source) {\n\t var _this6 = this;\n\t\n\t var formats = void 0;\n\t\n\t var _overload5 = overload(index, length, name, value, source);\n\t\n\t var _overload6 = _slicedToArray(_overload5, 4);\n\t\n\t index = _overload6[0];\n\t length = _overload6[1];\n\t formats = _overload6[2];\n\t source = _overload6[3];\n\t\n\t return modify.call(this, function () {\n\t return _this6.editor.formatText(index, length, formats);\n\t }, source, index, 0);\n\t }\n\t }, {\n\t key: 'getBounds',\n\t value: function getBounds(index) {\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\t\n\t if (typeof index === 'number') {\n\t return this.selection.getBounds(index, length);\n\t } else {\n\t return this.selection.getBounds(index.index, index.length);\n\t }\n\t }\n\t }, {\n\t key: 'getContents',\n\t value: function getContents() {\n\t var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\t\n\t var _overload7 = overload(index, length);\n\t\n\t var _overload8 = _slicedToArray(_overload7, 2);\n\t\n\t index = _overload8[0];\n\t length = _overload8[1];\n\t\n\t return this.editor.getContents(index, length);\n\t }\n\t }, {\n\t key: 'getFormat',\n\t value: function getFormat() {\n\t var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection();\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\t\n\t if (typeof index === 'number') {\n\t return this.editor.getFormat(index, length);\n\t } else {\n\t return this.editor.getFormat(index.index, index.length);\n\t }\n\t }\n\t }, {\n\t key: 'getLength',\n\t value: function getLength() {\n\t return this.scroll.length();\n\t }\n\t }, {\n\t key: 'getModule',\n\t value: function getModule(name) {\n\t return this.theme.modules[name];\n\t }\n\t }, {\n\t key: 'getSelection',\n\t value: function getSelection() {\n\t var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\t\n\t if (focus) this.focus();\n\t this.update(); // Make sure we access getRange with editor in consistent state\n\t return this.selection.getRange()[0];\n\t }\n\t }, {\n\t key: 'getText',\n\t value: function getText() {\n\t var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\t\n\t var _overload9 = overload(index, length);\n\t\n\t var _overload10 = _slicedToArray(_overload9, 2);\n\t\n\t index = _overload10[0];\n\t length = _overload10[1];\n\t\n\t return this.editor.getText(index, length);\n\t }\n\t }, {\n\t key: 'hasFocus',\n\t value: function hasFocus() {\n\t return this.selection.hasFocus();\n\t }\n\t }, {\n\t key: 'insertEmbed',\n\t value: function insertEmbed(index, embed, value) {\n\t var _this7 = this;\n\t\n\t var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n\t\n\t return modify.call(this, function () {\n\t return _this7.editor.insertEmbed(index, embed, value);\n\t }, source, index);\n\t }\n\t }, {\n\t key: 'insertText',\n\t value: function insertText(index, text, name, value, source) {\n\t var _this8 = this;\n\t\n\t var formats = void 0;\n\t\n\t var _overload11 = overload(index, 0, name, value, source);\n\t\n\t var _overload12 = _slicedToArray(_overload11, 4);\n\t\n\t index = _overload12[0];\n\t formats = _overload12[2];\n\t source = _overload12[3];\n\t\n\t return modify.call(this, function () {\n\t return _this8.editor.insertText(index, text, formats);\n\t }, source, index, text.length);\n\t }\n\t }, {\n\t key: 'isEnabled',\n\t value: function isEnabled() {\n\t return !this.container.classList.contains('ql-disabled');\n\t }\n\t }, {\n\t key: 'off',\n\t value: function off() {\n\t return this.emitter.off.apply(this.emitter, arguments);\n\t }\n\t }, {\n\t key: 'on',\n\t value: function on() {\n\t return this.emitter.on.apply(this.emitter, arguments);\n\t }\n\t }, {\n\t key: 'once',\n\t value: function once() {\n\t return this.emitter.once.apply(this.emitter, arguments);\n\t }\n\t }, {\n\t key: 'pasteHTML',\n\t value: function pasteHTML(index, html, source) {\n\t this.clipboard.dangerouslyPasteHTML(index, html, source);\n\t }\n\t }, {\n\t key: 'removeFormat',\n\t value: function removeFormat(index, length, source) {\n\t var _this9 = this;\n\t\n\t var _overload13 = overload(index, length, source);\n\t\n\t var _overload14 = _slicedToArray(_overload13, 4);\n\t\n\t index = _overload14[0];\n\t length = _overload14[1];\n\t source = _overload14[3];\n\t\n\t return modify.call(this, function () {\n\t return _this9.editor.removeFormat(index, length);\n\t }, source, index);\n\t }\n\t }, {\n\t key: 'setContents',\n\t value: function setContents(delta) {\n\t var _this10 = this;\n\t\n\t var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\t\n\t return modify.call(this, function () {\n\t delta = new _quillDelta2.default(delta);\n\t var length = _this10.getLength();\n\t var deleted = _this10.editor.deleteText(0, length);\n\t var applied = _this10.editor.applyDelta(delta);\n\t var lastOp = applied.ops[applied.ops.length - 1];\n\t if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\\n') {\n\t _this10.editor.deleteText(_this10.getLength() - 1, 1);\n\t applied.delete(1);\n\t }\n\t var ret = deleted.compose(applied);\n\t return ret;\n\t }, source);\n\t }\n\t }, {\n\t key: 'setSelection',\n\t value: function setSelection(index, length, source) {\n\t if (index == null) {\n\t this.selection.setRange(null, length || Quill.sources.API);\n\t } else {\n\t var _overload15 = overload(index, length, source);\n\t\n\t var _overload16 = _slicedToArray(_overload15, 4);\n\t\n\t index = _overload16[0];\n\t length = _overload16[1];\n\t source = _overload16[3];\n\t\n\t this.selection.setRange(new _selection.Range(index, length), source);\n\t }\n\t this.selection.scrollIntoView();\n\t }\n\t }, {\n\t key: 'setText',\n\t value: function setText(text) {\n\t var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\t\n\t var delta = new _quillDelta2.default().insert(text);\n\t return this.setContents(delta, source);\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update() {\n\t var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;\n\t\n\t var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n\t this.selection.update(source);\n\t return change;\n\t }\n\t }, {\n\t key: 'updateContents',\n\t value: function updateContents(delta) {\n\t var _this11 = this;\n\t\n\t var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\t\n\t return modify.call(this, function () {\n\t delta = new _quillDelta2.default(delta);\n\t return _this11.editor.applyDelta(delta, source);\n\t }, source, true);\n\t }\n\t }]);\n\t\n\t return Quill;\n\t}();\n\t\n\tQuill.DEFAULTS = {\n\t bounds: null,\n\t formats: null,\n\t modules: {},\n\t placeholder: '',\n\t readOnly: false,\n\t strict: true,\n\t theme: 'default'\n\t};\n\tQuill.events = _emitter4.default.events;\n\tQuill.sources = _emitter4.default.sources;\n\t// eslint-disable-next-line no-undef\n\tQuill.version = false ? 'dev' : (\"1.1.5\");\n\t\n\tQuill.imports = {\n\t 'delta': _quillDelta2.default,\n\t 'parchment': _parchment2.default,\n\t 'core/module': _module2.default,\n\t 'core/theme': _theme2.default\n\t};\n\t\n\tfunction expandConfig(container, userConfig) {\n\t userConfig = (0, _extend2.default)(true, {\n\t container: container,\n\t modules: {\n\t clipboard: true,\n\t keyboard: true,\n\t history: true\n\t }\n\t }, userConfig);\n\t if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n\t userConfig.theme = _theme2.default;\n\t } else {\n\t userConfig.theme = Quill.import('themes/' + userConfig.theme);\n\t if (userConfig.theme == null) {\n\t throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?');\n\t }\n\t }\n\t var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS);\n\t [themeConfig, userConfig].forEach(function (config) {\n\t config.modules = config.modules || {};\n\t Object.keys(config.modules).forEach(function (module) {\n\t if (config.modules[module] === true) {\n\t config.modules[module] = {};\n\t }\n\t });\n\t });\n\t var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n\t var moduleConfig = moduleNames.reduce(function (config, name) {\n\t var moduleClass = Quill.import('modules/' + name);\n\t if (moduleClass == null) {\n\t debug.error('Cannot load ' + name + ' module. Are you sure you registered it?');\n\t } else {\n\t config[name] = moduleClass.DEFAULTS || {};\n\t }\n\t return config;\n\t }, {});\n\t // Special case toolbar shorthand\n\t if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {\n\t userConfig.modules.toolbar = {\n\t container: userConfig.modules.toolbar\n\t };\n\t }\n\t userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n\t ['bounds', 'container'].forEach(function (key) {\n\t if (typeof userConfig[key] === 'string') {\n\t userConfig[key] = document.querySelector(userConfig[key]);\n\t }\n\t });\n\t userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) {\n\t if (userConfig.modules[name]) {\n\t config[name] = userConfig.modules[name];\n\t }\n\t return config;\n\t }, {});\n\t return userConfig;\n\t}\n\t\n\t// Handle selection preservation and TEXT_CHANGE emission\n\t// common to modification APIs\n\tfunction modify(modifier, source, index, shift) {\n\t if (!this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n\t return new _quillDelta2.default();\n\t }\n\t var range = index == null ? null : this.getSelection();\n\t var oldDelta = this.editor.delta;\n\t var change = modifier();\n\t if (range != null) {\n\t if (index === true) index = range.index;\n\t if (shift == null) {\n\t range = shiftRange(range, change, source);\n\t } else if (shift !== 0) {\n\t range = shiftRange(range, index, shift, source);\n\t }\n\t this.setSelection(range, _emitter4.default.sources.SILENT);\n\t }\n\t if (change.length() > 0) {\n\t var _emitter;\n\t\n\t var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n\t (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n\t if (source !== _emitter4.default.sources.SILENT) {\n\t var _emitter2;\n\t\n\t (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n\t }\n\t }\n\t return change;\n\t}\n\t\n\tfunction overload(index, length, name, value, source) {\n\t var formats = {};\n\t if (typeof index.index === 'number' && typeof index.length === 'number') {\n\t // Allow for throwaway end (used by insertText/insertEmbed)\n\t if (typeof length !== 'number') {\n\t source = value, value = name, name = length, length = index.length, index = index.index;\n\t } else {\n\t length = index.length, index = index.index;\n\t }\n\t } else if (typeof length !== 'number') {\n\t source = value, value = name, name = length, length = 0;\n\t }\n\t // Handle format being object, two format name/value strings or excluded\n\t if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n\t formats = name;\n\t source = value;\n\t } else if (typeof name === 'string') {\n\t if (value != null) {\n\t formats[name] = value;\n\t } else {\n\t source = name;\n\t }\n\t }\n\t // Handle optional source\n\t source = source || _emitter4.default.sources.API;\n\t return [index, length, formats, source];\n\t}\n\t\n\tfunction shiftRange(range, index, length, source) {\n\t if (range == null) return null;\n\t var start = void 0,\n\t end = void 0;\n\t if (index instanceof _quillDelta2.default) {\n\t var _map = [range.index, range.index + range.length].map(function (pos) {\n\t return index.transformPosition(pos, source === _emitter4.default.sources.USER);\n\t });\n\t\n\t var _map2 = _slicedToArray(_map, 2);\n\t\n\t start = _map2[0];\n\t end = _map2[1];\n\t } else {\n\t var _map3 = [range.index, range.index + range.length].map(function (pos) {\n\t if (pos < index || pos === index && source !== _emitter4.default.sources.USER) return pos;\n\t if (length >= 0) {\n\t return pos + length;\n\t } else {\n\t return Math.max(index, pos + length);\n\t }\n\t });\n\t\n\t var _map4 = _slicedToArray(_map3, 2);\n\t\n\t start = _map4[0];\n\t end = _map4[1];\n\t }\n\t return new _selection.Range(start, end - start);\n\t}\n\t\n\texports.expandConfig = expandConfig;\n\texports.overload = overload;\n\texports.default = Quill;\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar elem = document.createElement('div');\n\telem.classList.toggle('test-class', false);\n\tif (elem.classList.contains('test-class')) {\n\t (function () {\n\t var _toggle = DOMTokenList.prototype.toggle;\n\t DOMTokenList.prototype.toggle = function (token, force) {\n\t if (arguments.length > 1 && !this.contains(token) === !force) {\n\t return force;\n\t } else {\n\t return _toggle.call(this, token);\n\t }\n\t };\n\t })();\n\t}\n\t\n\tif (!String.prototype.startsWith) {\n\t String.prototype.startsWith = function (searchString, position) {\n\t position = position || 0;\n\t return this.substr(position, searchString.length) === searchString;\n\t };\n\t}\n\t\n\tif (!String.prototype.endsWith) {\n\t String.prototype.endsWith = function (searchString, position) {\n\t var subjectString = this.toString();\n\t if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n\t position = subjectString.length;\n\t }\n\t position -= searchString.length;\n\t var lastIndex = subjectString.indexOf(searchString, position);\n\t return lastIndex !== -1 && lastIndex === position;\n\t };\n\t}\n\t\n\tif (!Array.prototype.find) {\n\t Object.defineProperty(Array.prototype, \"find\", {\n\t value: function value(predicate) {\n\t if (this === null) {\n\t throw new TypeError('Array.prototype.find called on null or undefined');\n\t }\n\t if (typeof predicate !== 'function') {\n\t throw new TypeError('predicate must be a function');\n\t }\n\t var list = Object(this);\n\t var length = list.length >>> 0;\n\t var thisArg = arguments[1];\n\t var value;\n\t\n\t for (var i = 0; i < length; i++) {\n\t value = list[i];\n\t if (predicate.call(thisArg, value, i, list)) {\n\t return value;\n\t }\n\t }\n\t return undefined;\n\t }\n\t });\n\t}\n\t\n\t// Disable resizing in Firefox\n\tdocument.addEventListener(\"DOMContentLoaded\", function () {\n\t document.execCommand(\"enableObjectResizing\", false, false);\n\t});\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar diff = __webpack_require__(21);\n\tvar equal = __webpack_require__(22);\n\tvar extend = __webpack_require__(25);\n\tvar op = __webpack_require__(26);\n\t\n\t\n\tvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\t\n\t\n\tvar Delta = function (ops) {\n\t // Assume we are given a well formed ops\n\t if (Array.isArray(ops)) {\n\t this.ops = ops;\n\t } else if (ops != null && Array.isArray(ops.ops)) {\n\t this.ops = ops.ops;\n\t } else {\n\t this.ops = [];\n\t }\n\t};\n\t\n\t\n\tDelta.prototype.insert = function (text, attributes) {\n\t var newOp = {};\n\t if (text.length === 0) return this;\n\t newOp.insert = text;\n\t if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n\t newOp.attributes = attributes;\n\t }\n\t return this.push(newOp);\n\t};\n\t\n\tDelta.prototype['delete'] = function (length) {\n\t if (length <= 0) return this;\n\t return this.push({ 'delete': length });\n\t};\n\t\n\tDelta.prototype.retain = function (length, attributes) {\n\t if (length <= 0) return this;\n\t var newOp = { retain: length };\n\t if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n\t newOp.attributes = attributes;\n\t }\n\t return this.push(newOp);\n\t};\n\t\n\tDelta.prototype.push = function (newOp) {\n\t var index = this.ops.length;\n\t var lastOp = this.ops[index - 1];\n\t newOp = extend(true, {}, newOp);\n\t if (typeof lastOp === 'object') {\n\t if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {\n\t this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };\n\t return this;\n\t }\n\t // Since it does not matter if we insert before or after deleting at the same index,\n\t // always prefer to insert first\n\t if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {\n\t index -= 1;\n\t lastOp = this.ops[index - 1];\n\t if (typeof lastOp !== 'object') {\n\t this.ops.unshift(newOp);\n\t return this;\n\t }\n\t }\n\t if (equal(newOp.attributes, lastOp.attributes)) {\n\t if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {\n\t this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n\t if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n\t return this;\n\t } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {\n\t this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n\t if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n\t return this;\n\t }\n\t }\n\t }\n\t if (index === this.ops.length) {\n\t this.ops.push(newOp);\n\t } else {\n\t this.ops.splice(index, 0, newOp);\n\t }\n\t return this;\n\t};\n\t\n\tDelta.prototype.filter = function (predicate) {\n\t return this.ops.filter(predicate);\n\t};\n\t\n\tDelta.prototype.forEach = function (predicate) {\n\t this.ops.forEach(predicate);\n\t};\n\t\n\tDelta.prototype.map = function (predicate) {\n\t return this.ops.map(predicate);\n\t};\n\t\n\tDelta.prototype.partition = function (predicate) {\n\t var passed = [], failed = [];\n\t this.forEach(function(op) {\n\t var target = predicate(op) ? passed : failed;\n\t target.push(op);\n\t });\n\t return [passed, failed];\n\t};\n\t\n\tDelta.prototype.reduce = function (predicate, initial) {\n\t return this.ops.reduce(predicate, initial);\n\t};\n\t\n\tDelta.prototype.chop = function () {\n\t var lastOp = this.ops[this.ops.length - 1];\n\t if (lastOp && lastOp.retain && !lastOp.attributes) {\n\t this.ops.pop();\n\t }\n\t return this;\n\t};\n\t\n\tDelta.prototype.length = function () {\n\t return this.reduce(function (length, elem) {\n\t return length + op.length(elem);\n\t }, 0);\n\t};\n\t\n\tDelta.prototype.slice = function (start, end) {\n\t start = start || 0;\n\t if (typeof end !== 'number') end = Infinity;\n\t var ops = [];\n\t var iter = op.iterator(this.ops);\n\t var index = 0;\n\t while (index < end && iter.hasNext()) {\n\t var nextOp;\n\t if (index < start) {\n\t nextOp = iter.next(start - index);\n\t } else {\n\t nextOp = iter.next(end - index);\n\t ops.push(nextOp);\n\t }\n\t index += op.length(nextOp);\n\t }\n\t return new Delta(ops);\n\t};\n\t\n\t\n\tDelta.prototype.compose = function (other) {\n\t var thisIter = op.iterator(this.ops);\n\t var otherIter = op.iterator(other.ops);\n\t var delta = new Delta();\n\t while (thisIter.hasNext() || otherIter.hasNext()) {\n\t if (otherIter.peekType() === 'insert') {\n\t delta.push(otherIter.next());\n\t } else if (thisIter.peekType() === 'delete') {\n\t delta.push(thisIter.next());\n\t } else {\n\t var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n\t var thisOp = thisIter.next(length);\n\t var otherOp = otherIter.next(length);\n\t if (typeof otherOp.retain === 'number') {\n\t var newOp = {};\n\t if (typeof thisOp.retain === 'number') {\n\t newOp.retain = length;\n\t } else {\n\t newOp.insert = thisOp.insert;\n\t }\n\t // Preserve null when composing with a retain, otherwise remove it for inserts\n\t var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n\t if (attributes) newOp.attributes = attributes;\n\t delta.push(newOp);\n\t // Other op should be delete, we could be an insert or retain\n\t // Insert + delete cancels out\n\t } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {\n\t delta.push(otherOp);\n\t }\n\t }\n\t }\n\t return delta.chop();\n\t};\n\t\n\tDelta.prototype.concat = function (other) {\n\t var delta = new Delta(this.ops.slice());\n\t if (other.ops.length > 0) {\n\t delta.push(other.ops[0]);\n\t delta.ops = delta.ops.concat(other.ops.slice(1));\n\t }\n\t return delta;\n\t};\n\t\n\tDelta.prototype.diff = function (other, index) {\n\t if (this.ops === other.ops) {\n\t return new Delta();\n\t }\n\t var strings = [this, other].map(function (delta) {\n\t return delta.map(function (op) {\n\t if (op.insert != null) {\n\t return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n\t }\n\t var prep = (delta === other) ? 'on' : 'with';\n\t throw new Error('diff() called ' + prep + ' non-document');\n\t }).join('');\n\t });\n\t var delta = new Delta();\n\t var diffResult = diff(strings[0], strings[1], index);\n\t var thisIter = op.iterator(this.ops);\n\t var otherIter = op.iterator(other.ops);\n\t diffResult.forEach(function (component) {\n\t var length = component[1].length;\n\t while (length > 0) {\n\t var opLength = 0;\n\t switch (component[0]) {\n\t case diff.INSERT:\n\t opLength = Math.min(otherIter.peekLength(), length);\n\t delta.push(otherIter.next(opLength));\n\t break;\n\t case diff.DELETE:\n\t opLength = Math.min(length, thisIter.peekLength());\n\t thisIter.next(opLength);\n\t delta['delete'](opLength);\n\t break;\n\t case diff.EQUAL:\n\t opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n\t var thisOp = thisIter.next(opLength);\n\t var otherOp = otherIter.next(opLength);\n\t if (equal(thisOp.insert, otherOp.insert)) {\n\t delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));\n\t } else {\n\t delta.push(otherOp)['delete'](opLength);\n\t }\n\t break;\n\t }\n\t length -= opLength;\n\t }\n\t });\n\t return delta.chop();\n\t};\n\t\n\tDelta.prototype.eachLine = function (predicate, newline) {\n\t newline = newline || '\\n';\n\t var iter = op.iterator(this.ops);\n\t var line = new Delta();\n\t while (iter.hasNext()) {\n\t if (iter.peekType() !== 'insert') return;\n\t var thisOp = iter.peek();\n\t var start = op.length(thisOp) - iter.peekLength();\n\t var index = typeof thisOp.insert === 'string' ?\n\t thisOp.insert.indexOf(newline, start) - start : -1;\n\t if (index < 0) {\n\t line.push(iter.next());\n\t } else if (index > 0) {\n\t line.push(iter.next(index));\n\t } else {\n\t predicate(line, iter.next(1).attributes || {});\n\t line = new Delta();\n\t }\n\t }\n\t if (line.length() > 0) {\n\t predicate(line, {});\n\t }\n\t};\n\t\n\tDelta.prototype.transform = function (other, priority) {\n\t priority = !!priority;\n\t if (typeof other === 'number') {\n\t return this.transformPosition(other, priority);\n\t }\n\t var thisIter = op.iterator(this.ops);\n\t var otherIter = op.iterator(other.ops);\n\t var delta = new Delta();\n\t while (thisIter.hasNext() || otherIter.hasNext()) {\n\t if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {\n\t delta.retain(op.length(thisIter.next()));\n\t } else if (otherIter.peekType() === 'insert') {\n\t delta.push(otherIter.next());\n\t } else {\n\t var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n\t var thisOp = thisIter.next(length);\n\t var otherOp = otherIter.next(length);\n\t if (thisOp['delete']) {\n\t // Our delete either makes their delete redundant or removes their retain\n\t continue;\n\t } else if (otherOp['delete']) {\n\t delta.push(otherOp);\n\t } else {\n\t // We retain either their retain or insert\n\t delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));\n\t }\n\t }\n\t }\n\t return delta.chop();\n\t};\n\t\n\tDelta.prototype.transformPosition = function (index, priority) {\n\t priority = !!priority;\n\t var thisIter = op.iterator(this.ops);\n\t var offset = 0;\n\t while (thisIter.hasNext() && offset <= index) {\n\t var length = thisIter.peekLength();\n\t var nextType = thisIter.peekType();\n\t thisIter.next();\n\t if (nextType === 'delete') {\n\t index -= Math.min(length, index - offset);\n\t continue;\n\t } else if (nextType === 'insert' && (offset < index || !priority)) {\n\t index += length;\n\t }\n\t offset += length;\n\t }\n\t return index;\n\t};\n\t\n\t\n\tmodule.exports = Delta;\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t/**\n\t * This library modifies the diff-patch-match library by Neil Fraser\n\t * by removing the patch and match functionality and certain advanced\n\t * options in the diff function. The original license is as follows:\n\t *\n\t * ===\n\t *\n\t * Diff Match and Patch\n\t *\n\t * Copyright 2006 Google Inc.\n\t * http://code.google.com/p/google-diff-match-patch/\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\");\n\t * you may not use this file except in compliance with the License.\n\t * You may obtain a copy of the License at\n\t *\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software\n\t * distributed under the License is distributed on an \"AS IS\" BASIS,\n\t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\t * See the License for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t\n\t/**\n\t * The data structure representing a diff is an array of tuples:\n\t * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n\t * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n\t */\n\tvar DIFF_DELETE = -1;\n\tvar DIFF_INSERT = 1;\n\tvar DIFF_EQUAL = 0;\n\t\n\t\n\t/**\n\t * Find the differences between two texts. Simplifies the problem by stripping\n\t * any common prefix or suffix off the texts before diffing.\n\t * @param {string} text1 Old string to be diffed.\n\t * @param {string} text2 New string to be diffed.\n\t * @param {Int} cursor_pos Expected edit position in text1 (optional)\n\t * @return {Array} Array of diff tuples.\n\t */\n\tfunction diff_main(text1, text2, cursor_pos) {\n\t // Check for equality (speedup).\n\t if (text1 == text2) {\n\t if (text1) {\n\t return [[DIFF_EQUAL, text1]];\n\t }\n\t return [];\n\t }\n\t\n\t // Check cursor_pos within bounds\n\t if (cursor_pos < 0 || text1.length < cursor_pos) {\n\t cursor_pos = null;\n\t }\n\t\n\t // Trim off common prefix (speedup).\n\t var commonlength = diff_commonPrefix(text1, text2);\n\t var commonprefix = text1.substring(0, commonlength);\n\t text1 = text1.substring(commonlength);\n\t text2 = text2.substring(commonlength);\n\t\n\t // Trim off common suffix (speedup).\n\t commonlength = diff_commonSuffix(text1, text2);\n\t var commonsuffix = text1.substring(text1.length - commonlength);\n\t text1 = text1.substring(0, text1.length - commonlength);\n\t text2 = text2.substring(0, text2.length - commonlength);\n\t\n\t // Compute the diff on the middle block.\n\t var diffs = diff_compute_(text1, text2);\n\t\n\t // Restore the prefix and suffix.\n\t if (commonprefix) {\n\t diffs.unshift([DIFF_EQUAL, commonprefix]);\n\t }\n\t if (commonsuffix) {\n\t diffs.push([DIFF_EQUAL, commonsuffix]);\n\t }\n\t diff_cleanupMerge(diffs);\n\t if (cursor_pos != null) {\n\t diffs = fix_cursor(diffs, cursor_pos);\n\t }\n\t return diffs;\n\t};\n\t\n\t\n\t/**\n\t * Find the differences between two texts. Assumes that the texts do not\n\t * have any common prefix or suffix.\n\t * @param {string} text1 Old string to be diffed.\n\t * @param {string} text2 New string to be diffed.\n\t * @return {Array} Array of diff tuples.\n\t */\n\tfunction diff_compute_(text1, text2) {\n\t var diffs;\n\t\n\t if (!text1) {\n\t // Just add some text (speedup).\n\t return [[DIFF_INSERT, text2]];\n\t }\n\t\n\t if (!text2) {\n\t // Just delete some text (speedup).\n\t return [[DIFF_DELETE, text1]];\n\t }\n\t\n\t var longtext = text1.length > text2.length ? text1 : text2;\n\t var shorttext = text1.length > text2.length ? text2 : text1;\n\t var i = longtext.indexOf(shorttext);\n\t if (i != -1) {\n\t // Shorter text is inside the longer text (speedup).\n\t diffs = [[DIFF_INSERT, longtext.substring(0, i)],\n\t [DIFF_EQUAL, shorttext],\n\t [DIFF_INSERT, longtext.substring(i + shorttext.length)]];\n\t // Swap insertions for deletions if diff is reversed.\n\t if (text1.length > text2.length) {\n\t diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n\t }\n\t return diffs;\n\t }\n\t\n\t if (shorttext.length == 1) {\n\t // Single character string.\n\t // After the previous speedup, the character can't be an equality.\n\t return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n\t }\n\t\n\t // Check to see if the problem can be split in two.\n\t var hm = diff_halfMatch_(text1, text2);\n\t if (hm) {\n\t // A half-match was found, sort out the return data.\n\t var text1_a = hm[0];\n\t var text1_b = hm[1];\n\t var text2_a = hm[2];\n\t var text2_b = hm[3];\n\t var mid_common = hm[4];\n\t // Send both pairs off for separate processing.\n\t var diffs_a = diff_main(text1_a, text2_a);\n\t var diffs_b = diff_main(text1_b, text2_b);\n\t // Merge the results.\n\t return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n\t }\n\t\n\t return diff_bisect_(text1, text2);\n\t};\n\t\n\t\n\t/**\n\t * Find the 'middle snake' of a diff, split the problem in two\n\t * and return the recursively constructed diff.\n\t * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n\t * @param {string} text1 Old string to be diffed.\n\t * @param {string} text2 New string to be diffed.\n\t * @return {Array} Array of diff tuples.\n\t * @private\n\t */\n\tfunction diff_bisect_(text1, text2) {\n\t // Cache the text lengths to prevent multiple calls.\n\t var text1_length = text1.length;\n\t var text2_length = text2.length;\n\t var max_d = Math.ceil((text1_length + text2_length) / 2);\n\t var v_offset = max_d;\n\t var v_length = 2 * max_d;\n\t var v1 = new Array(v_length);\n\t var v2 = new Array(v_length);\n\t // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n\t // integers and undefined.\n\t for (var x = 0; x < v_length; x++) {\n\t v1[x] = -1;\n\t v2[x] = -1;\n\t }\n\t v1[v_offset + 1] = 0;\n\t v2[v_offset + 1] = 0;\n\t var delta = text1_length - text2_length;\n\t // If the total number of characters is odd, then the front path will collide\n\t // with the reverse path.\n\t var front = (delta % 2 != 0);\n\t // Offsets for start and end of k loop.\n\t // Prevents mapping of space beyond the grid.\n\t var k1start = 0;\n\t var k1end = 0;\n\t var k2start = 0;\n\t var k2end = 0;\n\t for (var d = 0; d < max_d; d++) {\n\t // Walk the front path one step.\n\t for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n\t var k1_offset = v_offset + k1;\n\t var x1;\n\t if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n\t x1 = v1[k1_offset + 1];\n\t } else {\n\t x1 = v1[k1_offset - 1] + 1;\n\t }\n\t var y1 = x1 - k1;\n\t while (x1 < text1_length && y1 < text2_length &&\n\t text1.charAt(x1) == text2.charAt(y1)) {\n\t x1++;\n\t y1++;\n\t }\n\t v1[k1_offset] = x1;\n\t if (x1 > text1_length) {\n\t // Ran off the right of the graph.\n\t k1end += 2;\n\t } else if (y1 > text2_length) {\n\t // Ran off the bottom of the graph.\n\t k1start += 2;\n\t } else if (front) {\n\t var k2_offset = v_offset + delta - k1;\n\t if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n\t // Mirror x2 onto top-left coordinate system.\n\t var x2 = text1_length - v2[k2_offset];\n\t if (x1 >= x2) {\n\t // Overlap detected.\n\t return diff_bisectSplit_(text1, text2, x1, y1);\n\t }\n\t }\n\t }\n\t }\n\t\n\t // Walk the reverse path one step.\n\t for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n\t var k2_offset = v_offset + k2;\n\t var x2;\n\t if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n\t x2 = v2[k2_offset + 1];\n\t } else {\n\t x2 = v2[k2_offset - 1] + 1;\n\t }\n\t var y2 = x2 - k2;\n\t while (x2 < text1_length && y2 < text2_length &&\n\t text1.charAt(text1_length - x2 - 1) ==\n\t text2.charAt(text2_length - y2 - 1)) {\n\t x2++;\n\t y2++;\n\t }\n\t v2[k2_offset] = x2;\n\t if (x2 > text1_length) {\n\t // Ran off the left of the graph.\n\t k2end += 2;\n\t } else if (y2 > text2_length) {\n\t // Ran off the top of the graph.\n\t k2start += 2;\n\t } else if (!front) {\n\t var k1_offset = v_offset + delta - k2;\n\t if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n\t var x1 = v1[k1_offset];\n\t var y1 = v_offset + x1 - k1_offset;\n\t // Mirror x2 onto top-left coordinate system.\n\t x2 = text1_length - x2;\n\t if (x1 >= x2) {\n\t // Overlap detected.\n\t return diff_bisectSplit_(text1, text2, x1, y1);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t // Diff took too long and hit the deadline or\n\t // number of diffs equals number of characters, no commonality at all.\n\t return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n\t};\n\t\n\t\n\t/**\n\t * Given the location of the 'middle snake', split the diff in two parts\n\t * and recurse.\n\t * @param {string} text1 Old string to be diffed.\n\t * @param {string} text2 New string to be diffed.\n\t * @param {number} x Index of split point in text1.\n\t * @param {number} y Index of split point in text2.\n\t * @return {Array} Array of diff tuples.\n\t */\n\tfunction diff_bisectSplit_(text1, text2, x, y) {\n\t var text1a = text1.substring(0, x);\n\t var text2a = text2.substring(0, y);\n\t var text1b = text1.substring(x);\n\t var text2b = text2.substring(y);\n\t\n\t // Compute both diffs serially.\n\t var diffs = diff_main(text1a, text2a);\n\t var diffsb = diff_main(text1b, text2b);\n\t\n\t return diffs.concat(diffsb);\n\t};\n\t\n\t\n\t/**\n\t * Determine the common prefix of two strings.\n\t * @param {string} text1 First string.\n\t * @param {string} text2 Second string.\n\t * @return {number} The number of characters common to the start of each\n\t * string.\n\t */\n\tfunction diff_commonPrefix(text1, text2) {\n\t // Quick check for common null cases.\n\t if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n\t return 0;\n\t }\n\t // Binary search.\n\t // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n\t var pointermin = 0;\n\t var pointermax = Math.min(text1.length, text2.length);\n\t var pointermid = pointermax;\n\t var pointerstart = 0;\n\t while (pointermin < pointermid) {\n\t if (text1.substring(pointerstart, pointermid) ==\n\t text2.substring(pointerstart, pointermid)) {\n\t pointermin = pointermid;\n\t pointerstart = pointermin;\n\t } else {\n\t pointermax = pointermid;\n\t }\n\t pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n\t }\n\t return pointermid;\n\t};\n\t\n\t\n\t/**\n\t * Determine the common suffix of two strings.\n\t * @param {string} text1 First string.\n\t * @param {string} text2 Second string.\n\t * @return {number} The number of characters common to the end of each string.\n\t */\n\tfunction diff_commonSuffix(text1, text2) {\n\t // Quick check for common null cases.\n\t if (!text1 || !text2 ||\n\t text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n\t return 0;\n\t }\n\t // Binary search.\n\t // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n\t var pointermin = 0;\n\t var pointermax = Math.min(text1.length, text2.length);\n\t var pointermid = pointermax;\n\t var pointerend = 0;\n\t while (pointermin < pointermid) {\n\t if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n\t text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n\t pointermin = pointermid;\n\t pointerend = pointermin;\n\t } else {\n\t pointermax = pointermid;\n\t }\n\t pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n\t }\n\t return pointermid;\n\t};\n\t\n\t\n\t/**\n\t * Do the two texts share a substring which is at least half the length of the\n\t * longer text?\n\t * This speedup can produce non-minimal diffs.\n\t * @param {string} text1 First string.\n\t * @param {string} text2 Second string.\n\t * @return {Array.} Five element Array, containing the prefix of\n\t * text1, the suffix of text1, the prefix of text2, the suffix of\n\t * text2 and the common middle. Or null if there was no match.\n\t */\n\tfunction diff_halfMatch_(text1, text2) {\n\t var longtext = text1.length > text2.length ? text1 : text2;\n\t var shorttext = text1.length > text2.length ? text2 : text1;\n\t if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n\t return null; // Pointless.\n\t }\n\t\n\t /**\n\t * Does a substring of shorttext exist within longtext such that the substring\n\t * is at least half the length of longtext?\n\t * Closure, but does not reference any external variables.\n\t * @param {string} longtext Longer string.\n\t * @param {string} shorttext Shorter string.\n\t * @param {number} i Start index of quarter length substring within longtext.\n\t * @return {Array.} Five element Array, containing the prefix of\n\t * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n\t * of shorttext and the common middle. Or null if there was no match.\n\t * @private\n\t */\n\t function diff_halfMatchI_(longtext, shorttext, i) {\n\t // Start with a 1/4 length substring at position i as a seed.\n\t var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n\t var j = -1;\n\t var best_common = '';\n\t var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n\t while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n\t var prefixLength = diff_commonPrefix(longtext.substring(i),\n\t shorttext.substring(j));\n\t var suffixLength = diff_commonSuffix(longtext.substring(0, i),\n\t shorttext.substring(0, j));\n\t if (best_common.length < suffixLength + prefixLength) {\n\t best_common = shorttext.substring(j - suffixLength, j) +\n\t shorttext.substring(j, j + prefixLength);\n\t best_longtext_a = longtext.substring(0, i - suffixLength);\n\t best_longtext_b = longtext.substring(i + prefixLength);\n\t best_shorttext_a = shorttext.substring(0, j - suffixLength);\n\t best_shorttext_b = shorttext.substring(j + prefixLength);\n\t }\n\t }\n\t if (best_common.length * 2 >= longtext.length) {\n\t return [best_longtext_a, best_longtext_b,\n\t best_shorttext_a, best_shorttext_b, best_common];\n\t } else {\n\t return null;\n\t }\n\t }\n\t\n\t // First check if the second quarter is the seed for a half-match.\n\t var hm1 = diff_halfMatchI_(longtext, shorttext,\n\t Math.ceil(longtext.length / 4));\n\t // Check again based on the third quarter.\n\t var hm2 = diff_halfMatchI_(longtext, shorttext,\n\t Math.ceil(longtext.length / 2));\n\t var hm;\n\t if (!hm1 && !hm2) {\n\t return null;\n\t } else if (!hm2) {\n\t hm = hm1;\n\t } else if (!hm1) {\n\t hm = hm2;\n\t } else {\n\t // Both matched. Select the longest.\n\t hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n\t }\n\t\n\t // A half-match was found, sort out the return data.\n\t var text1_a, text1_b, text2_a, text2_b;\n\t if (text1.length > text2.length) {\n\t text1_a = hm[0];\n\t text1_b = hm[1];\n\t text2_a = hm[2];\n\t text2_b = hm[3];\n\t } else {\n\t text2_a = hm[0];\n\t text2_b = hm[1];\n\t text1_a = hm[2];\n\t text1_b = hm[3];\n\t }\n\t var mid_common = hm[4];\n\t return [text1_a, text1_b, text2_a, text2_b, mid_common];\n\t};\n\t\n\t\n\t/**\n\t * Reorder and merge like edit sections. Merge equalities.\n\t * Any edit section can move as long as it doesn't cross an equality.\n\t * @param {Array} diffs Array of diff tuples.\n\t */\n\tfunction diff_cleanupMerge(diffs) {\n\t diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n\t var pointer = 0;\n\t var count_delete = 0;\n\t var count_insert = 0;\n\t var text_delete = '';\n\t var text_insert = '';\n\t var commonlength;\n\t while (pointer < diffs.length) {\n\t switch (diffs[pointer][0]) {\n\t case DIFF_INSERT:\n\t count_insert++;\n\t text_insert += diffs[pointer][1];\n\t pointer++;\n\t break;\n\t case DIFF_DELETE:\n\t count_delete++;\n\t text_delete += diffs[pointer][1];\n\t pointer++;\n\t break;\n\t case DIFF_EQUAL:\n\t // Upon reaching an equality, check for prior redundancies.\n\t if (count_delete + count_insert > 1) {\n\t if (count_delete !== 0 && count_insert !== 0) {\n\t // Factor out any common prefixies.\n\t commonlength = diff_commonPrefix(text_insert, text_delete);\n\t if (commonlength !== 0) {\n\t if ((pointer - count_delete - count_insert) > 0 &&\n\t diffs[pointer - count_delete - count_insert - 1][0] ==\n\t DIFF_EQUAL) {\n\t diffs[pointer - count_delete - count_insert - 1][1] +=\n\t text_insert.substring(0, commonlength);\n\t } else {\n\t diffs.splice(0, 0, [DIFF_EQUAL,\n\t text_insert.substring(0, commonlength)]);\n\t pointer++;\n\t }\n\t text_insert = text_insert.substring(commonlength);\n\t text_delete = text_delete.substring(commonlength);\n\t }\n\t // Factor out any common suffixies.\n\t commonlength = diff_commonSuffix(text_insert, text_delete);\n\t if (commonlength !== 0) {\n\t diffs[pointer][1] = text_insert.substring(text_insert.length -\n\t commonlength) + diffs[pointer][1];\n\t text_insert = text_insert.substring(0, text_insert.length -\n\t commonlength);\n\t text_delete = text_delete.substring(0, text_delete.length -\n\t commonlength);\n\t }\n\t }\n\t // Delete the offending records and add the merged ones.\n\t if (count_delete === 0) {\n\t diffs.splice(pointer - count_insert,\n\t count_delete + count_insert, [DIFF_INSERT, text_insert]);\n\t } else if (count_insert === 0) {\n\t diffs.splice(pointer - count_delete,\n\t count_delete + count_insert, [DIFF_DELETE, text_delete]);\n\t } else {\n\t diffs.splice(pointer - count_delete - count_insert,\n\t count_delete + count_insert, [DIFF_DELETE, text_delete],\n\t [DIFF_INSERT, text_insert]);\n\t }\n\t pointer = pointer - count_delete - count_insert +\n\t (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;\n\t } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n\t // Merge this equality with the previous one.\n\t diffs[pointer - 1][1] += diffs[pointer][1];\n\t diffs.splice(pointer, 1);\n\t } else {\n\t pointer++;\n\t }\n\t count_insert = 0;\n\t count_delete = 0;\n\t text_delete = '';\n\t text_insert = '';\n\t break;\n\t }\n\t }\n\t if (diffs[diffs.length - 1][1] === '') {\n\t diffs.pop(); // Remove the dummy entry at the end.\n\t }\n\t\n\t // Second pass: look for single edits surrounded on both sides by equalities\n\t // which can be shifted sideways to eliminate an equality.\n\t // e.g: ABAC -> ABAC\n\t var changes = false;\n\t pointer = 1;\n\t // Intentionally ignore the first and last element (don't need checking).\n\t while (pointer < diffs.length - 1) {\n\t if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n\t diffs[pointer + 1][0] == DIFF_EQUAL) {\n\t // This is a single edit surrounded by equalities.\n\t if (diffs[pointer][1].substring(diffs[pointer][1].length -\n\t diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n\t // Shift the edit over the previous equality.\n\t diffs[pointer][1] = diffs[pointer - 1][1] +\n\t diffs[pointer][1].substring(0, diffs[pointer][1].length -\n\t diffs[pointer - 1][1].length);\n\t diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n\t diffs.splice(pointer - 1, 1);\n\t changes = true;\n\t } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n\t diffs[pointer + 1][1]) {\n\t // Shift the edit over the next equality.\n\t diffs[pointer - 1][1] += diffs[pointer + 1][1];\n\t diffs[pointer][1] =\n\t diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n\t diffs[pointer + 1][1];\n\t diffs.splice(pointer + 1, 1);\n\t changes = true;\n\t }\n\t }\n\t pointer++;\n\t }\n\t // If shifts were made, the diff needs reordering and another shift sweep.\n\t if (changes) {\n\t diff_cleanupMerge(diffs);\n\t }\n\t};\n\t\n\t\n\tvar diff = diff_main;\n\tdiff.INSERT = DIFF_INSERT;\n\tdiff.DELETE = DIFF_DELETE;\n\tdiff.EQUAL = DIFF_EQUAL;\n\t\n\tmodule.exports = diff;\n\t\n\t/*\n\t * Modify a diff such that the cursor position points to the start of a change:\n\t * E.g.\n\t * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)\n\t * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]\n\t * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)\n\t * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]\n\t *\n\t * @param {Array} diffs Array of diff tuples\n\t * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n\t * @return {Array} A tuple [cursor location in the modified diff, modified diff]\n\t */\n\tfunction cursor_normalize_diff (diffs, cursor_pos) {\n\t if (cursor_pos === 0) {\n\t return [DIFF_EQUAL, diffs];\n\t }\n\t for (var current_pos = 0, i = 0; i < diffs.length; i++) {\n\t var d = diffs[i];\n\t if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {\n\t var next_pos = current_pos + d[1].length;\n\t if (cursor_pos === next_pos) {\n\t return [i + 1, diffs];\n\t } else if (cursor_pos < next_pos) {\n\t // copy to prevent side effects\n\t diffs = diffs.slice();\n\t // split d into two diff changes\n\t var split_pos = cursor_pos - current_pos;\n\t var d_left = [d[0], d[1].slice(0, split_pos)];\n\t var d_right = [d[0], d[1].slice(split_pos)];\n\t diffs.splice(i, 1, d_left, d_right);\n\t return [i + 1, diffs];\n\t } else {\n\t current_pos = next_pos;\n\t }\n\t }\n\t }\n\t throw new Error('cursor_pos is out of bounds!')\n\t}\n\t\n\t/*\n\t * Modify a diff such that the edit position is \"shifted\" to the proposed edit location (cursor_position).\n\t *\n\t * Case 1)\n\t * Check if a naive shift is possible:\n\t * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)\n\t * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result\n\t * Case 2)\n\t * Check if the following shifts are possible:\n\t * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']\n\t * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']\n\t * ^ ^\n\t * d d_next\n\t *\n\t * @param {Array} diffs Array of diff tuples\n\t * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n\t * @return {Array} Array of diff tuples\n\t */\n\tfunction fix_cursor (diffs, cursor_pos) {\n\t var norm = cursor_normalize_diff(diffs, cursor_pos);\n\t var ndiffs = norm[1];\n\t var cursor_pointer = norm[0];\n\t var d = ndiffs[cursor_pointer];\n\t var d_next = ndiffs[cursor_pointer + 1];\n\t\n\t if (d == null) {\n\t // Text was deleted from end of original string,\n\t // cursor is now out of bounds in new string\n\t return diffs;\n\t } else if (d[0] !== DIFF_EQUAL) {\n\t // A modification happened at the cursor location.\n\t // This is the expected outcome, so we can return the original diff.\n\t return diffs;\n\t } else {\n\t if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {\n\t // Case 1)\n\t // It is possible to perform a naive shift\n\t ndiffs.splice(cursor_pointer, 2, d_next, d)\n\t return merge_tuples(ndiffs, cursor_pointer, 2)\n\t } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {\n\t // Case 2)\n\t // d[1] is a prefix of d_next[1]\n\t // We can assume that d_next[0] !== 0, since d[0] === 0\n\t // Shift edit locations..\n\t ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);\n\t var suffix = d_next[1].slice(d[1].length);\n\t if (suffix.length > 0) {\n\t ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);\n\t }\n\t return merge_tuples(ndiffs, cursor_pointer, 3)\n\t } else {\n\t // Not possible to perform any modification\n\t return diffs;\n\t }\n\t }\n\t\n\t}\n\t\n\t/*\n\t * Try to merge tuples with their neigbors in a given range.\n\t * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']\n\t *\n\t * @param {Array} diffs Array of diff tuples.\n\t * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).\n\t * @param {Int} length Number of consecutive elements to check.\n\t * @return {Array} Array of merged diff tuples.\n\t */\n\tfunction merge_tuples (diffs, start, length) {\n\t // Check from (start-1) to (start+length).\n\t for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {\n\t if (i + 1 < diffs.length) {\n\t var left_d = diffs[i];\n\t var right_d = diffs[i+1];\n\t if (left_d[0] === right_d[1]) {\n\t diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);\n\t }\n\t }\n\t }\n\t return diffs;\n\t}\n\n\n/***/ },\n/* 22 */\n[112, 23, 24],\n/* 23 */\n/***/ function(module, exports) {\n\n\texports = module.exports = typeof Object.keys === 'function'\n\t ? Object.keys : shim;\n\t\n\texports.shim = shim;\n\tfunction shim (obj) {\n\t var keys = [];\n\t for (var key in obj) keys.push(key);\n\t return keys;\n\t}\n\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\tvar supportsArgumentsClass = (function(){\n\t return Object.prototype.toString.call(arguments)\n\t})() == '[object Arguments]';\n\t\n\texports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\t\n\texports.supported = supported;\n\tfunction supported(object) {\n\t return Object.prototype.toString.call(object) == '[object Arguments]';\n\t};\n\t\n\texports.unsupported = unsupported;\n\tfunction unsupported(object){\n\t return object &&\n\t typeof object == 'object' &&\n\t typeof object.length == 'number' &&\n\t Object.prototype.hasOwnProperty.call(object, 'callee') &&\n\t !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n\t false;\n\t};\n\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar hasOwn = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\t\n\tvar isArray = function isArray(arr) {\n\t\tif (typeof Array.isArray === 'function') {\n\t\t\treturn Array.isArray(arr);\n\t\t}\n\t\n\t\treturn toStr.call(arr) === '[object Array]';\n\t};\n\t\n\tvar isPlainObject = function isPlainObject(obj) {\n\t\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\t\treturn false;\n\t\t}\n\t\n\t\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\t\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t\t// Not own constructor property must be Object\n\t\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\t\treturn false;\n\t\t}\n\t\n\t\t// Own properties are enumerated firstly, so to speed up,\n\t\t// if last one is own, then all properties are own.\n\t\tvar key;\n\t\tfor (key in obj) {/**/}\n\t\n\t\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n\t};\n\t\n\tmodule.exports = function extend() {\n\t\tvar options, name, src, copy, copyIsArray, clone,\n\t\t\ttarget = arguments[0],\n\t\t\ti = 1,\n\t\t\tlength = arguments.length,\n\t\t\tdeep = false;\n\t\n\t\t// Handle a deep copy situation\n\t\tif (typeof target === 'boolean') {\n\t\t\tdeep = target;\n\t\t\ttarget = arguments[1] || {};\n\t\t\t// skip the boolean and the target\n\t\t\ti = 2;\n\t\t} else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) {\n\t\t\ttarget = {};\n\t\t}\n\t\n\t\tfor (; i < length; ++i) {\n\t\t\toptions = arguments[i];\n\t\t\t// Only deal with non-null/undefined values\n\t\t\tif (options != null) {\n\t\t\t\t// Extend the base object\n\t\t\t\tfor (name in options) {\n\t\t\t\t\tsrc = target[name];\n\t\t\t\t\tcopy = options[name];\n\t\n\t\t\t\t\t// Prevent never-ending loop\n\t\t\t\t\tif (target !== copy) {\n\t\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\t\ttarget[name] = extend(deep, clone, copy);\n\t\n\t\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Return the modified object\n\t\treturn target;\n\t};\n\t\n\n\n/***/ },\n/* 26 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar equal = __webpack_require__(22);\n\tvar extend = __webpack_require__(25);\n\t\n\t\n\tvar lib = {\n\t attributes: {\n\t compose: function (a, b, keepNull) {\n\t if (typeof a !== 'object') a = {};\n\t if (typeof b !== 'object') b = {};\n\t var attributes = extend(true, {}, b);\n\t if (!keepNull) {\n\t attributes = Object.keys(attributes).reduce(function (copy, key) {\n\t if (attributes[key] != null) {\n\t copy[key] = attributes[key];\n\t }\n\t return copy;\n\t }, {});\n\t }\n\t for (var key in a) {\n\t if (a[key] !== undefined && b[key] === undefined) {\n\t attributes[key] = a[key];\n\t }\n\t }\n\t return Object.keys(attributes).length > 0 ? attributes : undefined;\n\t },\n\t\n\t diff: function(a, b) {\n\t if (typeof a !== 'object') a = {};\n\t if (typeof b !== 'object') b = {};\n\t var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {\n\t if (!equal(a[key], b[key])) {\n\t attributes[key] = b[key] === undefined ? null : b[key];\n\t }\n\t return attributes;\n\t }, {});\n\t return Object.keys(attributes).length > 0 ? attributes : undefined;\n\t },\n\t\n\t transform: function (a, b, priority) {\n\t if (typeof a !== 'object') return b;\n\t if (typeof b !== 'object') return undefined;\n\t if (!priority) return b; // b simply overwrites us without priority\n\t var attributes = Object.keys(b).reduce(function (attributes, key) {\n\t if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value\n\t return attributes;\n\t }, {});\n\t return Object.keys(attributes).length > 0 ? attributes : undefined;\n\t }\n\t },\n\t\n\t iterator: function (ops) {\n\t return new Iterator(ops);\n\t },\n\t\n\t length: function (op) {\n\t if (typeof op['delete'] === 'number') {\n\t return op['delete'];\n\t } else if (typeof op.retain === 'number') {\n\t return op.retain;\n\t } else {\n\t return typeof op.insert === 'string' ? op.insert.length : 1;\n\t }\n\t }\n\t};\n\t\n\t\n\tfunction Iterator(ops) {\n\t this.ops = ops;\n\t this.index = 0;\n\t this.offset = 0;\n\t};\n\t\n\tIterator.prototype.hasNext = function () {\n\t return this.peekLength() < Infinity;\n\t};\n\t\n\tIterator.prototype.next = function (length) {\n\t if (!length) length = Infinity;\n\t var nextOp = this.ops[this.index];\n\t if (nextOp) {\n\t var offset = this.offset;\n\t var opLength = lib.length(nextOp)\n\t if (length >= opLength - offset) {\n\t length = opLength - offset;\n\t this.index += 1;\n\t this.offset = 0;\n\t } else {\n\t this.offset += length;\n\t }\n\t if (typeof nextOp['delete'] === 'number') {\n\t return { 'delete': length };\n\t } else {\n\t var retOp = {};\n\t if (nextOp.attributes) {\n\t retOp.attributes = nextOp.attributes;\n\t }\n\t if (typeof nextOp.retain === 'number') {\n\t retOp.retain = length;\n\t } else if (typeof nextOp.insert === 'string') {\n\t retOp.insert = nextOp.insert.substr(offset, length);\n\t } else {\n\t // offset should === 0, length should === 1\n\t retOp.insert = nextOp.insert;\n\t }\n\t return retOp;\n\t }\n\t } else {\n\t return { retain: Infinity };\n\t }\n\t};\n\t\n\tIterator.prototype.peek = function () {\n\t return this.ops[this.index];\n\t};\n\t\n\tIterator.prototype.peekLength = function () {\n\t if (this.ops[this.index]) {\n\t // Should never return 0 if our index is being managed correctly\n\t return lib.length(this.ops[this.index]) - this.offset;\n\t } else {\n\t return Infinity;\n\t }\n\t};\n\t\n\tIterator.prototype.peekType = function () {\n\t if (this.ops[this.index]) {\n\t if (typeof this.ops[this.index]['delete'] === 'number') {\n\t return 'delete';\n\t } else if (typeof this.ops[this.index].retain === 'number') {\n\t return 'retain';\n\t } else {\n\t return 'insert';\n\t }\n\t }\n\t return 'retain';\n\t};\n\t\n\t\n\tmodule.exports = lib;\n\n\n/***/ },\n/* 27 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _op = __webpack_require__(26);\n\t\n\tvar _op2 = _interopRequireDefault(_op);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _code = __webpack_require__(28);\n\t\n\tvar _code2 = _interopRequireDefault(_code);\n\t\n\tvar _cursor = __webpack_require__(35);\n\t\n\tvar _cursor2 = _interopRequireDefault(_cursor);\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tvar _clone = __webpack_require__(39);\n\t\n\tvar _clone2 = _interopRequireDefault(_clone);\n\t\n\tvar _deepEqual = __webpack_require__(40);\n\t\n\tvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Editor = function () {\n\t function Editor(scroll) {\n\t _classCallCheck(this, Editor);\n\t\n\t this.scroll = scroll;\n\t this.delta = this.getDelta();\n\t }\n\t\n\t _createClass(Editor, [{\n\t key: 'applyDelta',\n\t value: function applyDelta(delta) {\n\t var _this = this;\n\t\n\t var consumeNextNewline = false;\n\t this.scroll.update();\n\t var scrollLength = this.scroll.length();\n\t this.scroll.batch = true;\n\t delta = normalizeDelta(delta);\n\t delta.reduce(function (index, op) {\n\t var length = op.retain || op.delete || op.insert.length || 1;\n\t var attributes = op.attributes || {};\n\t if (op.insert != null) {\n\t if (typeof op.insert === 'string') {\n\t var text = op.insert;\n\t if (text.endsWith('\\n') && consumeNextNewline) {\n\t consumeNextNewline = false;\n\t text = text.slice(0, -1);\n\t }\n\t if (index >= scrollLength && !text.endsWith('\\n')) {\n\t consumeNextNewline = true;\n\t }\n\t _this.scroll.insertAt(index, text);\n\t\n\t var _scroll$line = _this.scroll.line(index),\n\t _scroll$line2 = _slicedToArray(_scroll$line, 2),\n\t line = _scroll$line2[0],\n\t offset = _scroll$line2[1];\n\t\n\t var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line));\n\t if (line instanceof _block2.default) {\n\t var _line$descendant = line.descendant(_parchment2.default.Leaf, offset),\n\t _line$descendant2 = _slicedToArray(_line$descendant, 1),\n\t leaf = _line$descendant2[0];\n\t\n\t formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf));\n\t }\n\t attributes = _op2.default.attributes.diff(formats, attributes) || {};\n\t } else if (_typeof(op.insert) === 'object') {\n\t var key = Object.keys(op.insert)[0]; // There should only be one key\n\t if (key == null) return index;\n\t _this.scroll.insertAt(index, key, op.insert[key]);\n\t }\n\t scrollLength += length;\n\t }\n\t Object.keys(attributes).forEach(function (name) {\n\t _this.scroll.formatAt(index, length, name, attributes[name]);\n\t });\n\t return index + length;\n\t }, 0);\n\t delta.reduce(function (index, op) {\n\t if (typeof op.delete === 'number') {\n\t _this.scroll.deleteAt(index, op.delete);\n\t return index;\n\t }\n\t return index + (op.retain || op.insert.length || 1);\n\t }, 0);\n\t this.scroll.batch = false;\n\t this.scroll.optimize();\n\t return this.update(delta);\n\t }\n\t }, {\n\t key: 'deleteText',\n\t value: function deleteText(index, length) {\n\t this.scroll.deleteAt(index, length);\n\t return this.update(new _quillDelta2.default().retain(index).delete(length));\n\t }\n\t }, {\n\t key: 'formatLine',\n\t value: function formatLine(index, length) {\n\t var _this2 = this;\n\t\n\t var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t\n\t this.scroll.update();\n\t Object.keys(formats).forEach(function (format) {\n\t var lines = _this2.scroll.lines(index, Math.max(length, 1));\n\t var lengthRemaining = length;\n\t lines.forEach(function (line) {\n\t var lineLength = line.length();\n\t if (!(line instanceof _code2.default)) {\n\t line.format(format, formats[format]);\n\t } else {\n\t var codeIndex = index - line.offset(_this2.scroll);\n\t var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n\t line.formatAt(codeIndex, codeLength, format, formats[format]);\n\t }\n\t lengthRemaining -= lineLength;\n\t });\n\t });\n\t this.scroll.optimize();\n\t return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));\n\t }\n\t }, {\n\t key: 'formatText',\n\t value: function formatText(index, length) {\n\t var _this3 = this;\n\t\n\t var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t\n\t Object.keys(formats).forEach(function (format) {\n\t _this3.scroll.formatAt(index, length, format, formats[format]);\n\t });\n\t return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));\n\t }\n\t }, {\n\t key: 'getContents',\n\t value: function getContents(index, length) {\n\t return this.delta.slice(index, index + length);\n\t }\n\t }, {\n\t key: 'getDelta',\n\t value: function getDelta() {\n\t return this.scroll.lines().reduce(function (delta, line) {\n\t return delta.concat(line.delta());\n\t }, new _quillDelta2.default());\n\t }\n\t }, {\n\t key: 'getFormat',\n\t value: function getFormat(index) {\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\t\n\t var lines = [],\n\t leaves = [];\n\t if (length === 0) {\n\t this.scroll.path(index).forEach(function (path) {\n\t var _path = _slicedToArray(path, 1),\n\t blot = _path[0];\n\t\n\t if (blot instanceof _block2.default) {\n\t lines.push(blot);\n\t } else if (blot instanceof _parchment2.default.Leaf) {\n\t leaves.push(blot);\n\t }\n\t });\n\t } else {\n\t lines = this.scroll.lines(index, length);\n\t leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length);\n\t }\n\t var formatsArr = [lines, leaves].map(function (blots) {\n\t if (blots.length === 0) return {};\n\t var formats = (0, _block.bubbleFormats)(blots.shift());\n\t while (Object.keys(formats).length > 0) {\n\t var blot = blots.shift();\n\t if (blot == null) return formats;\n\t formats = combineFormats((0, _block.bubbleFormats)(blot), formats);\n\t }\n\t return formats;\n\t });\n\t return _extend2.default.apply(_extend2.default, formatsArr);\n\t }\n\t }, {\n\t key: 'getText',\n\t value: function getText(index, length) {\n\t return this.getContents(index, length).filter(function (op) {\n\t return typeof op.insert === 'string';\n\t }).map(function (op) {\n\t return op.insert;\n\t }).join('');\n\t }\n\t }, {\n\t key: 'insertEmbed',\n\t value: function insertEmbed(index, embed, value) {\n\t this.scroll.insertAt(index, embed, value);\n\t return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value)));\n\t }\n\t }, {\n\t key: 'insertText',\n\t value: function insertText(index, text) {\n\t var _this4 = this;\n\t\n\t var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t\n\t text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n\t this.scroll.insertAt(index, text);\n\t Object.keys(formats).forEach(function (format) {\n\t _this4.scroll.formatAt(index, text.length, format, formats[format]);\n\t });\n\t return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats)));\n\t }\n\t }, {\n\t key: 'isBlank',\n\t value: function isBlank() {\n\t if (this.scroll.children.length == 0) return true;\n\t if (this.scroll.children.length > 1) return false;\n\t var child = this.scroll.children.head;\n\t return child.length() <= 1 && Object.keys(child.formats()).length == 0;\n\t }\n\t }, {\n\t key: 'removeFormat',\n\t value: function removeFormat(index, length) {\n\t var text = this.getText(index, length);\n\t\n\t var _scroll$line3 = this.scroll.line(index + length),\n\t _scroll$line4 = _slicedToArray(_scroll$line3, 2),\n\t line = _scroll$line4[0],\n\t offset = _scroll$line4[1];\n\t\n\t var suffixLength = 0,\n\t suffix = new _quillDelta2.default();\n\t if (line != null) {\n\t if (!(line instanceof _code2.default)) {\n\t suffixLength = line.length() - offset;\n\t } else {\n\t suffixLength = line.newlineIndex(offset) - offset + 1;\n\t }\n\t suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n\t }\n\t var contents = this.getContents(index, length + suffixLength);\n\t var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix));\n\t var delta = new _quillDelta2.default().retain(index).concat(diff);\n\t return this.applyDelta(delta);\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update(change) {\n\t var _this5 = this;\n\t\n\t var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\t var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n\t\n\t var oldDelta = this.delta;\n\t if (mutations.length === 1 && mutations[0].type === 'characterData' && _parchment2.default.find(mutations[0].target)) {\n\t (function () {\n\t // Optimization for character changes\n\t var textBlot = _parchment2.default.find(mutations[0].target);\n\t var formats = (0, _block.bubbleFormats)(textBlot);\n\t var index = textBlot.offset(_this5.scroll);\n\t var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, '');\n\t var oldText = new _quillDelta2.default().insert(oldValue);\n\t var newText = new _quillDelta2.default().insert(textBlot.value());\n\t var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex));\n\t change = diffDelta.reduce(function (delta, op) {\n\t if (op.insert) {\n\t return delta.insert(op.insert, formats);\n\t } else {\n\t return delta.push(op);\n\t }\n\t }, new _quillDelta2.default());\n\t _this5.delta = oldDelta.compose(change);\n\t })();\n\t } else {\n\t this.delta = this.getDelta();\n\t if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) {\n\t change = oldDelta.diff(this.delta, cursorIndex);\n\t }\n\t }\n\t return change;\n\t }\n\t }]);\n\t\n\t return Editor;\n\t}();\n\t\n\tfunction combineFormats(formats, combined) {\n\t return Object.keys(combined).reduce(function (merged, name) {\n\t if (formats[name] == null) return merged;\n\t if (combined[name] === formats[name]) {\n\t merged[name] = combined[name];\n\t } else if (Array.isArray(combined[name])) {\n\t if (combined[name].indexOf(formats[name]) < 0) {\n\t merged[name] = combined[name].concat([formats[name]]);\n\t }\n\t } else {\n\t merged[name] = [combined[name], formats[name]];\n\t }\n\t return merged;\n\t }, {});\n\t}\n\t\n\tfunction normalizeDelta(delta) {\n\t return delta.reduce(function (delta, op) {\n\t if (op.insert === 1) {\n\t var attributes = (0, _clone2.default)(op.attributes);\n\t delete attributes['image'];\n\t return delta.insert({ image: op.attributes.image }, attributes);\n\t }\n\t if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n\t op = (0, _clone2.default)(op);\n\t if (op.attributes.list) {\n\t op.attributes.list = 'ordered';\n\t } else {\n\t op.attributes.list = 'bullet';\n\t delete op.attributes.bullet;\n\t }\n\t }\n\t if (typeof op.insert === 'string') {\n\t var text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n\t return delta.insert(text, op.attributes);\n\t }\n\t return delta.push(op);\n\t }, new _quillDelta2.default());\n\t}\n\t\n\texports.default = Editor;\n\n/***/ },\n/* 28 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.Code = undefined;\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tvar _text = __webpack_require__(34);\n\t\n\tvar _text2 = _interopRequireDefault(_text);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Code = function (_Inline) {\n\t _inherits(Code, _Inline);\n\t\n\t function Code() {\n\t _classCallCheck(this, Code);\n\t\n\t return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments));\n\t }\n\t\n\t return Code;\n\t}(_inline2.default);\n\t\n\tCode.blotName = 'code';\n\tCode.tagName = 'CODE';\n\t\n\tvar CodeBlock = function (_Block) {\n\t _inherits(CodeBlock, _Block);\n\t\n\t function CodeBlock() {\n\t _classCallCheck(this, CodeBlock);\n\t\n\t return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments));\n\t }\n\t\n\t _createClass(CodeBlock, [{\n\t key: 'delta',\n\t value: function delta() {\n\t var _this3 = this;\n\t\n\t var text = this.domNode.textContent;\n\t if (text.endsWith('\\n')) {\n\t // Should always be true\n\t text = text.slice(0, -1);\n\t }\n\t return text.split('\\n').reduce(function (delta, frag) {\n\t return delta.insert(frag).insert('\\n', _this3.formats());\n\t }, new _quillDelta2.default());\n\t }\n\t }, {\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (name === this.statics.blotName && value) return;\n\t\n\t var _descendant = this.descendant(_text2.default, this.length() - 1),\n\t _descendant2 = _slicedToArray(_descendant, 1),\n\t text = _descendant2[0];\n\t\n\t if (text != null) {\n\t text.deleteAt(text.length() - 1, 1);\n\t }\n\t _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value);\n\t }\n\t }, {\n\t key: 'formatAt',\n\t value: function formatAt(index, length, name, value) {\n\t if (length === 0) return;\n\t if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) {\n\t return;\n\t }\n\t var nextNewline = this.newlineIndex(index);\n\t if (nextNewline < 0 || nextNewline >= index + length) return;\n\t var prevNewline = this.newlineIndex(index, true) + 1;\n\t var isolateLength = nextNewline - prevNewline + 1;\n\t var blot = this.isolate(prevNewline, isolateLength);\n\t var next = blot.next;\n\t blot.format(name, value);\n\t if (next instanceof CodeBlock) {\n\t next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n\t }\n\t }\n\t }, {\n\t key: 'insertAt',\n\t value: function insertAt(index, value, def) {\n\t if (def != null) return;\n\t\n\t var _descendant3 = this.descendant(_text2.default, index),\n\t _descendant4 = _slicedToArray(_descendant3, 2),\n\t text = _descendant4[0],\n\t offset = _descendant4[1];\n\t\n\t text.insertAt(offset, value);\n\t }\n\t }, {\n\t key: 'length',\n\t value: function length() {\n\t var length = this.domNode.textContent.length;\n\t if (!this.domNode.textContent.endsWith('\\n')) {\n\t return length + 1;\n\t }\n\t return length;\n\t }\n\t }, {\n\t key: 'newlineIndex',\n\t value: function newlineIndex(searchIndex) {\n\t var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\t\n\t if (!reverse) {\n\t var offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n\t return offset > -1 ? searchIndex + offset : -1;\n\t } else {\n\t return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n\t }\n\t }\n\t }, {\n\t key: 'optimize',\n\t value: function optimize() {\n\t if (!this.domNode.textContent.endsWith('\\n')) {\n\t this.appendChild(_parchment2.default.create('text', '\\n'));\n\t }\n\t _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this);\n\t var next = this.next;\n\t if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n\t next.optimize();\n\t next.moveChildren(this);\n\t next.remove();\n\t }\n\t }\n\t }, {\n\t key: 'replace',\n\t value: function replace(target) {\n\t _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target);\n\t [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) {\n\t var blot = _parchment2.default.find(node);\n\t if (blot == null) {\n\t node.parentNode.removeChild(node);\n\t } else if (blot instanceof _parchment2.default.Embed) {\n\t blot.remove();\n\t } else {\n\t blot.unwrap();\n\t }\n\t });\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create(value) {\n\t var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value);\n\t domNode.setAttribute('spellcheck', false);\n\t return domNode;\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats() {\n\t return true;\n\t }\n\t }]);\n\t\n\t return CodeBlock;\n\t}(_block2.default);\n\t\n\tCodeBlock.blotName = 'code-block';\n\tCodeBlock.tagName = 'PRE';\n\tCodeBlock.TAB = ' ';\n\t\n\texports.Code = Code;\n\texports.default = CodeBlock;\n\n/***/ },\n/* 29 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.BlockEmbed = exports.bubbleFormats = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _break = __webpack_require__(31);\n\t\n\tvar _break2 = _interopRequireDefault(_break);\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tvar _text = __webpack_require__(34);\n\t\n\tvar _text2 = _interopRequireDefault(_text);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar NEWLINE_LENGTH = 1;\n\t\n\tvar BlockEmbed = function (_Embed) {\n\t _inherits(BlockEmbed, _Embed);\n\t\n\t function BlockEmbed() {\n\t _classCallCheck(this, BlockEmbed);\n\t\n\t return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments));\n\t }\n\t\n\t _createClass(BlockEmbed, [{\n\t key: 'attach',\n\t value: function attach() {\n\t _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this);\n\t this.attributes = new _parchment2.default.Attributor.Store(this.domNode);\n\t }\n\t }, {\n\t key: 'delta',\n\t value: function delta() {\n\t return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values()));\n\t }\n\t }, {\n\t key: 'format',\n\t value: function format(name, value) {\n\t var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE);\n\t if (attribute != null) {\n\t this.attributes.attribute(attribute, value);\n\t }\n\t }\n\t }, {\n\t key: 'formatAt',\n\t value: function formatAt(index, length, name, value) {\n\t this.format(name, value);\n\t }\n\t }, {\n\t key: 'insertAt',\n\t value: function insertAt(index, value, def) {\n\t if (typeof value === 'string' && value.endsWith('\\n')) {\n\t var block = _parchment2.default.create(Block.blotName);\n\t this.parent.insertBefore(block, index === 0 ? this : this.next);\n\t block.insertAt(0, value.slice(0, -1));\n\t } else {\n\t _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def);\n\t }\n\t }\n\t }]);\n\t\n\t return BlockEmbed;\n\t}(_embed2.default);\n\t\n\tBlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT;\n\t// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\t\n\t\n\tvar Block = function (_Parchment$Block) {\n\t _inherits(Block, _Parchment$Block);\n\t\n\t function Block(domNode) {\n\t _classCallCheck(this, Block);\n\t\n\t var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode));\n\t\n\t _this2.cache = {};\n\t return _this2;\n\t }\n\t\n\t _createClass(Block, [{\n\t key: 'delta',\n\t value: function delta() {\n\t if (this.cache.delta == null) {\n\t this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) {\n\t if (leaf.length() === 0) {\n\t return delta;\n\t } else {\n\t return delta.insert(leaf.value(), bubbleFormats(leaf));\n\t }\n\t }, new _quillDelta2.default()).insert('\\n', bubbleFormats(this));\n\t }\n\t return this.cache.delta;\n\t }\n\t }, {\n\t key: 'deleteAt',\n\t value: function deleteAt(index, length) {\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length);\n\t this.cache = {};\n\t }\n\t }, {\n\t key: 'formatAt',\n\t value: function formatAt(index, length, name, value) {\n\t if (length <= 0) return;\n\t if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {\n\t if (index + length === this.length()) {\n\t this.format(name, value);\n\t }\n\t } else {\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value);\n\t }\n\t this.cache = {};\n\t }\n\t }, {\n\t key: 'insertAt',\n\t value: function insertAt(index, value, def) {\n\t if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def);\n\t if (value.length === 0) return;\n\t var lines = value.split('\\n');\n\t var text = lines.shift();\n\t if (text.length > 0) {\n\t if (index < this.length() - 1 || this.children.tail == null) {\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text);\n\t } else {\n\t this.children.tail.insertAt(this.children.tail.length(), text);\n\t }\n\t this.cache = {};\n\t }\n\t var block = this;\n\t lines.reduce(function (index, line) {\n\t block = block.split(index, true);\n\t block.insertAt(0, line);\n\t return line.length;\n\t }, index + text.length);\n\t }\n\t }, {\n\t key: 'insertBefore',\n\t value: function insertBefore(blot, ref) {\n\t var head = this.children.head;\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref);\n\t if (head instanceof _break2.default) {\n\t head.remove();\n\t }\n\t this.cache = {};\n\t }\n\t }, {\n\t key: 'length',\n\t value: function length() {\n\t if (this.cache.length == null) {\n\t this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH;\n\t }\n\t return this.cache.length;\n\t }\n\t }, {\n\t key: 'moveChildren',\n\t value: function moveChildren(target, ref) {\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref);\n\t this.cache = {};\n\t }\n\t }, {\n\t key: 'optimize',\n\t value: function optimize() {\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this);\n\t this.cache = {};\n\t }\n\t }, {\n\t key: 'path',\n\t value: function path(index) {\n\t return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true);\n\t }\n\t }, {\n\t key: 'removeChild',\n\t value: function removeChild(child) {\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child);\n\t this.cache = {};\n\t }\n\t }, {\n\t key: 'split',\n\t value: function split(index) {\n\t var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\t\n\t if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n\t var clone = this.clone();\n\t if (index === 0) {\n\t this.parent.insertBefore(clone, this);\n\t return this;\n\t } else {\n\t this.parent.insertBefore(clone, this.next);\n\t return clone;\n\t }\n\t } else {\n\t var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force);\n\t this.cache = {};\n\t return next;\n\t }\n\t }\n\t }]);\n\t\n\t return Block;\n\t}(_parchment2.default.Block);\n\t\n\tBlock.blotName = 'block';\n\tBlock.tagName = 'P';\n\tBlock.defaultChild = 'break';\n\tBlock.allowedChildren = [_inline2.default, _embed2.default, _text2.default];\n\t\n\tfunction bubbleFormats(blot) {\n\t var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t\n\t if (blot == null) return formats;\n\t if (typeof blot.formats === 'function') {\n\t formats = (0, _extend2.default)(formats, blot.formats());\n\t }\n\t if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n\t return formats;\n\t }\n\t return bubbleFormats(blot.parent, formats);\n\t}\n\t\n\texports.bubbleFormats = bubbleFormats;\n\texports.BlockEmbed = BlockEmbed;\n\texports.default = Block;\n\n/***/ },\n/* 30 */\n25,\n/* 31 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Break = function (_Embed) {\n\t _inherits(Break, _Embed);\n\t\n\t function Break() {\n\t _classCallCheck(this, Break);\n\t\n\t return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Break, [{\n\t key: 'insertInto',\n\t value: function insertInto(parent, ref) {\n\t if (parent.children.length === 0) {\n\t _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref);\n\t } else {\n\t this.remove();\n\t }\n\t }\n\t }, {\n\t key: 'length',\n\t value: function length() {\n\t return 0;\n\t }\n\t }, {\n\t key: 'value',\n\t value: function value() {\n\t return '';\n\t }\n\t }], [{\n\t key: 'value',\n\t value: function value() {\n\t return undefined;\n\t }\n\t }]);\n\t\n\t return Break;\n\t}(_embed2.default);\n\t\n\tBreak.blotName = 'break';\n\tBreak.tagName = 'BR';\n\t\n\texports.default = Break;\n\n/***/ },\n/* 32 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Embed = function (_Parchment$Embed) {\n\t _inherits(Embed, _Parchment$Embed);\n\t\n\t function Embed() {\n\t _classCallCheck(this, Embed);\n\t\n\t return _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).apply(this, arguments));\n\t }\n\t\n\t return Embed;\n\t}(_parchment2.default.Embed);\n\t\n\texports.default = Embed;\n\n/***/ },\n/* 33 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tvar _text = __webpack_require__(34);\n\t\n\tvar _text2 = _interopRequireDefault(_text);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Inline = function (_Parchment$Inline) {\n\t _inherits(Inline, _Parchment$Inline);\n\t\n\t function Inline() {\n\t _classCallCheck(this, Inline);\n\t\n\t return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Inline, [{\n\t key: 'formatAt',\n\t value: function formatAt(index, length, name, value) {\n\t if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) {\n\t var blot = this.isolate(index, length);\n\t if (value) {\n\t blot.wrap(name, value);\n\t }\n\t } else {\n\t _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value);\n\t }\n\t }\n\t }, {\n\t key: 'optimize',\n\t value: function optimize() {\n\t _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this);\n\t if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n\t var parent = this.parent.isolate(this.offset(), this.length());\n\t this.moveChildren(parent);\n\t parent.wrap(this);\n\t }\n\t }\n\t }], [{\n\t key: 'compare',\n\t value: function compare(self, other) {\n\t var selfIndex = Inline.order.indexOf(self);\n\t var otherIndex = Inline.order.indexOf(other);\n\t if (selfIndex >= 0 || otherIndex >= 0) {\n\t return selfIndex - otherIndex;\n\t } else if (self === other) {\n\t return 0;\n\t } else if (self < other) {\n\t return -1;\n\t } else {\n\t return 1;\n\t }\n\t }\n\t }]);\n\t\n\t return Inline;\n\t}(_parchment2.default.Inline);\n\t\n\tInline.allowedChildren = [Inline, _embed2.default, _text2.default];\n\t// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\n\tInline.order = ['cursor', 'inline', // Must be lower\n\t'code', 'underline', 'strike', 'italic', 'bold', 'script', 'link' // Must be higher\n\t];\n\t\n\texports.default = Inline;\n\n/***/ },\n/* 34 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar TextBlot = function (_Parchment$Text) {\n\t _inherits(TextBlot, _Parchment$Text);\n\t\n\t function TextBlot() {\n\t _classCallCheck(this, TextBlot);\n\t\n\t return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments));\n\t }\n\t\n\t return TextBlot;\n\t}(_parchment2.default.Text);\n\t\n\texports.default = TextBlot;\n\n/***/ },\n/* 35 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tvar _text = __webpack_require__(34);\n\t\n\tvar _text2 = _interopRequireDefault(_text);\n\t\n\tvar _emitter = __webpack_require__(36);\n\t\n\tvar _emitter2 = _interopRequireDefault(_emitter);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Cursor = function (_Embed) {\n\t _inherits(Cursor, _Embed);\n\t\n\t _createClass(Cursor, null, [{\n\t key: 'value',\n\t value: function value() {\n\t return undefined;\n\t }\n\t }]);\n\t\n\t function Cursor(domNode, selection) {\n\t _classCallCheck(this, Cursor);\n\t\n\t var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode));\n\t\n\t _this.selection = selection;\n\t _this.textNode = document.createTextNode(Cursor.CONTENTS);\n\t _this.domNode.appendChild(_this.textNode);\n\t _this._length = 0;\n\t return _this;\n\t }\n\t\n\t _createClass(Cursor, [{\n\t key: 'detach',\n\t value: function detach() {\n\t // super.detach() will also clear domNode.__blot\n\t if (this.parent != null) this.parent.removeChild(this);\n\t }\n\t }, {\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (this._length !== 0) {\n\t return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value);\n\t }\n\t var target = this,\n\t index = 0;\n\t while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) {\n\t index += target.offset(target.parent);\n\t target = target.parent;\n\t }\n\t if (target != null) {\n\t this._length = Cursor.CONTENTS.length;\n\t target.optimize();\n\t target.formatAt(index, Cursor.CONTENTS.length, name, value);\n\t this._length = 0;\n\t }\n\t }\n\t }, {\n\t key: 'index',\n\t value: function index(node, offset) {\n\t if (node === this.textNode) return 0;\n\t return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset);\n\t }\n\t }, {\n\t key: 'length',\n\t value: function length() {\n\t return this._length;\n\t }\n\t }, {\n\t key: 'position',\n\t value: function position() {\n\t return [this.textNode, this.textNode.data.length];\n\t }\n\t }, {\n\t key: 'remove',\n\t value: function remove() {\n\t _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this);\n\t this.parent = null;\n\t }\n\t }, {\n\t key: 'restore',\n\t value: function restore() {\n\t var _this2 = this;\n\t\n\t if (this.selection.composing) return;\n\t if (this.parent == null) return;\n\t var textNode = this.textNode;\n\t var range = this.selection.getNativeRange();\n\t var restoreText = void 0,\n\t start = void 0,\n\t end = void 0;\n\t if (range != null && range.start.node === textNode && range.end.node === textNode) {\n\t var _ref = [textNode, range.start.offset, range.end.offset];\n\t restoreText = _ref[0];\n\t start = _ref[1];\n\t end = _ref[2];\n\t }\n\t // Link format will insert text outside of anchor tag\n\t while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n\t this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n\t }\n\t if (this.textNode.data !== Cursor.CONTENTS) {\n\t var text = this.textNode.data.split(Cursor.CONTENTS).join('');\n\t if (this.next instanceof _text2.default) {\n\t restoreText = this.next.domNode;\n\t this.next.insertAt(0, text);\n\t this.textNode.data = Cursor.CONTENTS;\n\t } else {\n\t this.textNode.data = text;\n\t this.parent.insertBefore(_parchment2.default.create(this.textNode), this);\n\t this.textNode = document.createTextNode(Cursor.CONTENTS);\n\t this.domNode.appendChild(this.textNode);\n\t }\n\t }\n\t this.remove();\n\t if (start == null) return;\n\t this.selection.emitter.once(_emitter2.default.events.SCROLL_OPTIMIZE, function () {\n\t var _map = [start, end].map(function (offset) {\n\t return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n\t });\n\t\n\t var _map2 = _slicedToArray(_map, 2);\n\t\n\t start = _map2[0];\n\t end = _map2[1];\n\t\n\t _this2.selection.setNativeRange(restoreText, start, restoreText, end);\n\t });\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update(mutations) {\n\t var _this3 = this;\n\t\n\t mutations.forEach(function (mutation) {\n\t if (mutation.type === 'characterData' && mutation.target === _this3.textNode) {\n\t _this3.restore();\n\t }\n\t });\n\t }\n\t }, {\n\t key: 'value',\n\t value: function value() {\n\t return '';\n\t }\n\t }]);\n\t\n\t return Cursor;\n\t}(_embed2.default);\n\t\n\tCursor.blotName = 'cursor';\n\tCursor.className = 'ql-cursor';\n\tCursor.tagName = 'span';\n\tCursor.CONTENTS = '\\uFEFF'; // Zero width no break space\n\t\n\t\n\texports.default = Cursor;\n\n/***/ },\n/* 36 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _eventemitter = __webpack_require__(37);\n\t\n\tvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\t\n\tvar _logger = __webpack_require__(38);\n\t\n\tvar _logger2 = _interopRequireDefault(_logger);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar debug = (0, _logger2.default)('quill:events');\n\t\n\tvar Emitter = function (_EventEmitter) {\n\t _inherits(Emitter, _EventEmitter);\n\t\n\t function Emitter() {\n\t _classCallCheck(this, Emitter);\n\t\n\t var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this));\n\t\n\t _this.on('error', debug.error);\n\t return _this;\n\t }\n\t\n\t _createClass(Emitter, [{\n\t key: 'emit',\n\t value: function emit() {\n\t debug.log.apply(debug, arguments);\n\t _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments);\n\t }\n\t }]);\n\t\n\t return Emitter;\n\t}(_eventemitter2.default);\n\t\n\tEmitter.events = {\n\t EDITOR_CHANGE: 'editor-change',\n\t SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n\t SCROLL_OPTIMIZE: 'scroll-optimize',\n\t SCROLL_UPDATE: 'scroll-update',\n\t SELECTION_CHANGE: 'selection-change',\n\t TEXT_CHANGE: 'text-change'\n\t};\n\tEmitter.sources = {\n\t API: 'api',\n\t SILENT: 'silent',\n\t USER: 'user'\n\t};\n\t\n\texports.default = Emitter;\n\n/***/ },\n/* 37 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar has = Object.prototype.hasOwnProperty\n\t , prefix = '~';\n\t\n\t/**\n\t * Constructor to create a storage for our `EE` objects.\n\t * An `Events` instance is a plain object whose properties are event names.\n\t *\n\t * @constructor\n\t * @api private\n\t */\n\tfunction Events() {}\n\t\n\t//\n\t// We try to not inherit from `Object.prototype`. In some engines creating an\n\t// instance in this way is faster than calling `Object.create(null)` directly.\n\t// If `Object.create(null)` is not supported we prefix the event names with a\n\t// character to make sure that the built-in object properties are not\n\t// overridden or used as an attack vector.\n\t//\n\tif (Object.create) {\n\t Events.prototype = Object.create(null);\n\t\n\t //\n\t // This hack is needed because the `__proto__` property is still inherited in\n\t // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n\t //\n\t if (!new Events().__proto__) prefix = false;\n\t}\n\t\n\t/**\n\t * Representation of a single event listener.\n\t *\n\t * @param {Function} fn The listener function.\n\t * @param {Mixed} context The context to invoke the listener with.\n\t * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n\t * @constructor\n\t * @api private\n\t */\n\tfunction EE(fn, context, once) {\n\t this.fn = fn;\n\t this.context = context;\n\t this.once = once || false;\n\t}\n\t\n\t/**\n\t * Minimal `EventEmitter` interface that is molded against the Node.js\n\t * `EventEmitter` interface.\n\t *\n\t * @constructor\n\t * @api public\n\t */\n\tfunction EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}\n\t\n\t/**\n\t * Return an array listing the events for which the emitter has registered\n\t * listeners.\n\t *\n\t * @returns {Array}\n\t * @api public\n\t */\n\tEventEmitter.prototype.eventNames = function eventNames() {\n\t var names = []\n\t , events\n\t , name;\n\t\n\t if (this._eventsCount === 0) return names;\n\t\n\t for (name in (events = this._events)) {\n\t if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n\t }\n\t\n\t if (Object.getOwnPropertySymbols) {\n\t return names.concat(Object.getOwnPropertySymbols(events));\n\t }\n\t\n\t return names;\n\t};\n\t\n\t/**\n\t * Return the listeners registered for a given event.\n\t *\n\t * @param {String|Symbol} event The event name.\n\t * @param {Boolean} exists Only check if there are listeners.\n\t * @returns {Array|Boolean}\n\t * @api public\n\t */\n\tEventEmitter.prototype.listeners = function listeners(event, exists) {\n\t var evt = prefix ? prefix + event : event\n\t , available = this._events[evt];\n\t\n\t if (exists) return !!available;\n\t if (!available) return [];\n\t if (available.fn) return [available.fn];\n\t\n\t for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n\t ee[i] = available[i].fn;\n\t }\n\t\n\t return ee;\n\t};\n\t\n\t/**\n\t * Calls each of the listeners registered for a given event.\n\t *\n\t * @param {String|Symbol} event The event name.\n\t * @returns {Boolean} `true` if the event had listeners, else `false`.\n\t * @api public\n\t */\n\tEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n\t var evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events[evt]) return false;\n\t\n\t var listeners = this._events[evt]\n\t , len = arguments.length\n\t , args\n\t , i;\n\t\n\t if (listeners.fn) {\n\t if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\t\n\t switch (len) {\n\t case 1: return listeners.fn.call(listeners.context), true;\n\t case 2: return listeners.fn.call(listeners.context, a1), true;\n\t case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n\t case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n\t case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n\t case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n\t }\n\t\n\t for (i = 1, args = new Array(len -1); i < len; i++) {\n\t args[i - 1] = arguments[i];\n\t }\n\t\n\t listeners.fn.apply(listeners.context, args);\n\t } else {\n\t var length = listeners.length\n\t , j;\n\t\n\t for (i = 0; i < length; i++) {\n\t if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\t\n\t switch (len) {\n\t case 1: listeners[i].fn.call(listeners[i].context); break;\n\t case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n\t case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n\t case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n\t default:\n\t if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n\t args[j - 1] = arguments[j];\n\t }\n\t\n\t listeners[i].fn.apply(listeners[i].context, args);\n\t }\n\t }\n\t }\n\t\n\t return true;\n\t};\n\t\n\t/**\n\t * Add a listener for a given event.\n\t *\n\t * @param {String|Symbol} event The event name.\n\t * @param {Function} fn The listener function.\n\t * @param {Mixed} [context=this] The context to invoke the listener with.\n\t * @returns {EventEmitter} `this`.\n\t * @api public\n\t */\n\tEventEmitter.prototype.on = function on(event, fn, context) {\n\t var listener = new EE(fn, context || this)\n\t , evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n\t else if (!this._events[evt].fn) this._events[evt].push(listener);\n\t else this._events[evt] = [this._events[evt], listener];\n\t\n\t return this;\n\t};\n\t\n\t/**\n\t * Add a one-time listener for a given event.\n\t *\n\t * @param {String|Symbol} event The event name.\n\t * @param {Function} fn The listener function.\n\t * @param {Mixed} [context=this] The context to invoke the listener with.\n\t * @returns {EventEmitter} `this`.\n\t * @api public\n\t */\n\tEventEmitter.prototype.once = function once(event, fn, context) {\n\t var listener = new EE(fn, context || this, true)\n\t , evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n\t else if (!this._events[evt].fn) this._events[evt].push(listener);\n\t else this._events[evt] = [this._events[evt], listener];\n\t\n\t return this;\n\t};\n\t\n\t/**\n\t * Remove the listeners of a given event.\n\t *\n\t * @param {String|Symbol} event The event name.\n\t * @param {Function} fn Only remove the listeners that match this function.\n\t * @param {Mixed} context Only remove the listeners that have this context.\n\t * @param {Boolean} once Only remove one-time listeners.\n\t * @returns {EventEmitter} `this`.\n\t * @api public\n\t */\n\tEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n\t var evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events[evt]) return this;\n\t if (!fn) {\n\t if (--this._eventsCount === 0) this._events = new Events();\n\t else delete this._events[evt];\n\t return this;\n\t }\n\t\n\t var listeners = this._events[evt];\n\t\n\t if (listeners.fn) {\n\t if (\n\t listeners.fn === fn\n\t && (!once || listeners.once)\n\t && (!context || listeners.context === context)\n\t ) {\n\t if (--this._eventsCount === 0) this._events = new Events();\n\t else delete this._events[evt];\n\t }\n\t } else {\n\t for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n\t if (\n\t listeners[i].fn !== fn\n\t || (once && !listeners[i].once)\n\t || (context && listeners[i].context !== context)\n\t ) {\n\t events.push(listeners[i]);\n\t }\n\t }\n\t\n\t //\n\t // Reset the array, or remove it completely if we have no more listeners.\n\t //\n\t if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n\t else if (--this._eventsCount === 0) this._events = new Events();\n\t else delete this._events[evt];\n\t }\n\t\n\t return this;\n\t};\n\t\n\t/**\n\t * Remove all listeners, or those of the specified event.\n\t *\n\t * @param {String|Symbol} [event] The event name.\n\t * @returns {EventEmitter} `this`.\n\t * @api public\n\t */\n\tEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n\t var evt;\n\t\n\t if (event) {\n\t evt = prefix ? prefix + event : event;\n\t if (this._events[evt]) {\n\t if (--this._eventsCount === 0) this._events = new Events();\n\t else delete this._events[evt];\n\t }\n\t } else {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t }\n\t\n\t return this;\n\t};\n\t\n\t//\n\t// Alias methods names because people roll like that.\n\t//\n\tEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\tEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\t\n\t//\n\t// This function doesn't apply anymore.\n\t//\n\tEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n\t return this;\n\t};\n\t\n\t//\n\t// Expose the prefix.\n\t//\n\tEventEmitter.prefixed = prefix;\n\t\n\t//\n\t// Allow `EventEmitter` to be imported as module namespace.\n\t//\n\tEventEmitter.EventEmitter = EventEmitter;\n\t\n\t//\n\t// Expose the module.\n\t//\n\tif ('undefined' !== typeof module) {\n\t module.exports = EventEmitter;\n\t}\n\n\n/***/ },\n/* 38 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar levels = ['error', 'warn', 'log', 'info'];\n\tvar level = 'warn';\n\t\n\tfunction debug(method) {\n\t if (levels.indexOf(method) <= levels.indexOf(level)) {\n\t for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t args[_key - 1] = arguments[_key];\n\t }\n\t\n\t console[method].apply(console, args); // eslint-disable-line no-console\n\t }\n\t}\n\t\n\tfunction namespace(ns) {\n\t return levels.reduce(function (logger, method) {\n\t logger[method] = debug.bind(console, method, ns);\n\t return logger;\n\t }, {});\n\t}\n\t\n\tdebug.level = namespace.level = function (newLevel) {\n\t level = newLevel;\n\t};\n\t\n\texports.default = namespace;\n\n/***/ },\n/* 39 */\n/***/ function(module, exports) {\n\n\tvar clone = (function() {\n\t'use strict';\n\t\n\tvar nativeMap;\n\ttry {\n\t nativeMap = Map;\n\t} catch(_) {\n\t // maybe a reference error because no `Map`. Give it a dummy value that no\n\t // value will ever be an instanceof.\n\t nativeMap = function() {};\n\t}\n\t\n\tvar nativeSet;\n\ttry {\n\t nativeSet = Set;\n\t} catch(_) {\n\t nativeSet = function() {};\n\t}\n\t\n\tvar nativePromise;\n\ttry {\n\t nativePromise = Promise;\n\t} catch(_) {\n\t nativePromise = function() {};\n\t}\n\t\n\t/**\n\t * Clones (copies) an Object using deep copying.\n\t *\n\t * This function supports circular references by default, but if you are certain\n\t * there are no circular references in your object, you can save some CPU time\n\t * by calling clone(obj, false).\n\t *\n\t * Caution: if `circular` is false and `parent` contains circular references,\n\t * your program may enter an infinite loop and crash.\n\t *\n\t * @param `parent` - the object to be cloned\n\t * @param `circular` - set to true if the object to be cloned may contain\n\t * circular references. (optional - true by default)\n\t * @param `depth` - set to a number if the object is only to be cloned to\n\t * a particular depth. (optional - defaults to Infinity)\n\t * @param `prototype` - sets the prototype to be used when cloning an object.\n\t * (optional - defaults to parent prototype).\n\t*/\n\tfunction clone(parent, circular, depth, prototype) {\n\t var filter;\n\t if (typeof circular === 'object') {\n\t depth = circular.depth;\n\t prototype = circular.prototype;\n\t filter = circular.filter;\n\t circular = circular.circular;\n\t }\n\t // maintain two arrays for circular references, where corresponding parents\n\t // and children have the same index\n\t var allParents = [];\n\t var allChildren = [];\n\t\n\t var useBuffer = typeof Buffer != 'undefined';\n\t\n\t if (typeof circular == 'undefined')\n\t circular = true;\n\t\n\t if (typeof depth == 'undefined')\n\t depth = Infinity;\n\t\n\t // recurse this function so we don't reset allParents and allChildren\n\t function _clone(parent, depth) {\n\t // cloning null always returns null\n\t if (parent === null)\n\t return null;\n\t\n\t if (depth === 0)\n\t return parent;\n\t\n\t var child;\n\t var proto;\n\t if (typeof parent != 'object') {\n\t return parent;\n\t }\n\t\n\t if (parent instanceof nativeMap) {\n\t child = new nativeMap();\n\t } else if (parent instanceof nativeSet) {\n\t child = new nativeSet();\n\t } else if (parent instanceof nativePromise) {\n\t child = new nativePromise(function (resolve, reject) {\n\t parent.then(function(value) {\n\t resolve(_clone(value, depth - 1));\n\t }, function(err) {\n\t reject(_clone(err, depth - 1));\n\t });\n\t });\n\t } else if (clone.__isArray(parent)) {\n\t child = [];\n\t } else if (clone.__isRegExp(parent)) {\n\t child = new RegExp(parent.source, __getRegExpFlags(parent));\n\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t } else if (clone.__isDate(parent)) {\n\t child = new Date(parent.getTime());\n\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t child = new Buffer(parent.length);\n\t parent.copy(child);\n\t return child;\n\t } else {\n\t if (typeof prototype == 'undefined') {\n\t proto = Object.getPrototypeOf(parent);\n\t child = Object.create(proto);\n\t }\n\t else {\n\t child = Object.create(prototype);\n\t proto = prototype;\n\t }\n\t }\n\t\n\t if (circular) {\n\t var index = allParents.indexOf(parent);\n\t\n\t if (index != -1) {\n\t return allChildren[index];\n\t }\n\t allParents.push(parent);\n\t allChildren.push(child);\n\t }\n\t\n\t if (parent instanceof nativeMap) {\n\t var keyIterator = parent.keys();\n\t while(true) {\n\t var next = keyIterator.next();\n\t if (next.done) {\n\t break;\n\t }\n\t var keyChild = _clone(next.value, depth - 1);\n\t var valueChild = _clone(parent.get(next.value), depth - 1);\n\t child.set(keyChild, valueChild);\n\t }\n\t }\n\t if (parent instanceof nativeSet) {\n\t var iterator = parent.keys();\n\t while(true) {\n\t var next = iterator.next();\n\t if (next.done) {\n\t break;\n\t }\n\t var entryChild = _clone(next.value, depth - 1);\n\t child.add(entryChild);\n\t }\n\t }\n\t\n\t for (var i in parent) {\n\t var attrs;\n\t if (proto) {\n\t attrs = Object.getOwnPropertyDescriptor(proto, i);\n\t }\n\t\n\t if (attrs && attrs.set == null) {\n\t continue;\n\t }\n\t child[i] = _clone(parent[i], depth - 1);\n\t }\n\t\n\t if (Object.getOwnPropertySymbols) {\n\t var symbols = Object.getOwnPropertySymbols(parent);\n\t for (var i = 0; i < symbols.length; i++) {\n\t // Don't need to worry about cloning a symbol because it is a primitive,\n\t // like a number or string.\n\t var symbol = symbols[i];\n\t child[symbol] = _clone(parent[symbol], depth - 1);\n\t }\n\t }\n\t\n\t return child;\n\t }\n\t\n\t return _clone(parent, depth);\n\t}\n\t\n\t/**\n\t * Simple flat clone using prototype, accepts only objects, usefull for property\n\t * override on FLAT configuration object (no nested props).\n\t *\n\t * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n\t * works.\n\t */\n\tclone.clonePrototype = function clonePrototype(parent) {\n\t if (parent === null)\n\t return null;\n\t\n\t var c = function () {};\n\t c.prototype = parent;\n\t return new c();\n\t};\n\t\n\t// private utility functions\n\t\n\tfunction __objToStr(o) {\n\t return Object.prototype.toString.call(o);\n\t}\n\tclone.__objToStr = __objToStr;\n\t\n\tfunction __isDate(o) {\n\t return typeof o === 'object' && __objToStr(o) === '[object Date]';\n\t}\n\tclone.__isDate = __isDate;\n\t\n\tfunction __isArray(o) {\n\t return typeof o === 'object' && __objToStr(o) === '[object Array]';\n\t}\n\tclone.__isArray = __isArray;\n\t\n\tfunction __isRegExp(o) {\n\t return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n\t}\n\tclone.__isRegExp = __isRegExp;\n\t\n\tfunction __getRegExpFlags(re) {\n\t var flags = '';\n\t if (re.global) flags += 'g';\n\t if (re.ignoreCase) flags += 'i';\n\t if (re.multiline) flags += 'm';\n\t return flags;\n\t}\n\tclone.__getRegExpFlags = __getRegExpFlags;\n\t\n\treturn clone;\n\t})();\n\t\n\tif (typeof module === 'object' && module.exports) {\n\t module.exports = clone;\n\t}\n\n\n/***/ },\n/* 40 */\n[112, 41, 42],\n/* 41 */\n23,\n/* 42 */\n24,\n/* 43 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Module = function Module(quill) {\n\t var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t\n\t _classCallCheck(this, Module);\n\t\n\t this.quill = quill;\n\t this.options = options;\n\t};\n\t\n\tModule.DEFAULTS = {};\n\t\n\texports.default = Module;\n\n/***/ },\n/* 44 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.Range = undefined;\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _clone = __webpack_require__(39);\n\t\n\tvar _clone2 = _interopRequireDefault(_clone);\n\t\n\tvar _deepEqual = __webpack_require__(40);\n\t\n\tvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\t\n\tvar _emitter3 = __webpack_require__(36);\n\t\n\tvar _emitter4 = _interopRequireDefault(_emitter3);\n\t\n\tvar _logger = __webpack_require__(38);\n\t\n\tvar _logger2 = _interopRequireDefault(_logger);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar debug = (0, _logger2.default)('quill:selection');\n\t\n\tvar Range = function Range(index) {\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\t\n\t _classCallCheck(this, Range);\n\t\n\t this.index = index;\n\t this.length = length;\n\t};\n\t\n\tvar Selection = function () {\n\t function Selection(scroll, emitter) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Selection);\n\t\n\t this.emitter = emitter;\n\t this.scroll = scroll;\n\t this.composing = false;\n\t this.root = this.scroll.domNode;\n\t this.root.addEventListener('compositionstart', function () {\n\t _this.composing = true;\n\t });\n\t this.root.addEventListener('compositionend', function () {\n\t _this.composing = false;\n\t });\n\t this.cursor = _parchment2.default.create('cursor', this);\n\t // savedRange is last non-null range\n\t this.lastRange = this.savedRange = new Range(0, 0);\n\t ['keyup', 'mouseup', 'mouseleave', 'touchend', 'touchleave', 'focus', 'blur'].forEach(function (eventName) {\n\t _this.root.addEventListener(eventName, function () {\n\t // When range used to be a selection and user click within the selection,\n\t // the range now being a cursor has not updated yet without setTimeout\n\t setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 100);\n\t });\n\t });\n\t this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) {\n\t if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) {\n\t _this.update(_emitter4.default.sources.SILENT);\n\t }\n\t });\n\t this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () {\n\t var native = _this.getNativeRange();\n\t if (native == null) return;\n\t if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle\n\t // TODO unclear if this has negative side effects\n\t _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () {\n\t try {\n\t _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);\n\t } catch (ignored) {}\n\t });\n\t });\n\t this.update(_emitter4.default.sources.SILENT);\n\t }\n\t\n\t _createClass(Selection, [{\n\t key: 'focus',\n\t value: function focus() {\n\t if (this.hasFocus()) return;\n\t var bodyTop = document.body.scrollTop;\n\t this.root.focus();\n\t document.body.scrollTop = bodyTop;\n\t this.setRange(this.savedRange);\n\t }\n\t }, {\n\t key: 'format',\n\t value: function format(_format, value) {\n\t this.scroll.update();\n\t var nativeRange = this.getNativeRange();\n\t if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return;\n\t if (nativeRange.start.node !== this.cursor.textNode) {\n\t var blot = _parchment2.default.find(nativeRange.start.node, false);\n\t if (blot == null) return;\n\t // TODO Give blot ability to not split\n\t if (blot instanceof _parchment2.default.Leaf) {\n\t var after = blot.split(nativeRange.start.offset);\n\t blot.parent.insertBefore(this.cursor, after);\n\t } else {\n\t blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n\t }\n\t this.cursor.attach();\n\t }\n\t this.cursor.format(_format, value);\n\t this.scroll.optimize();\n\t this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n\t this.update();\n\t }\n\t }, {\n\t key: 'getBounds',\n\t value: function getBounds(index) {\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\t\n\t var scrollLength = this.scroll.length();\n\t index = Math.min(index, scrollLength - 1);\n\t length = Math.min(index + length, scrollLength - 1) - index;\n\t var bounds = void 0,\n\t node = void 0,\n\t _scroll$leaf = this.scroll.leaf(index),\n\t _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2),\n\t leaf = _scroll$leaf2[0],\n\t offset = _scroll$leaf2[1];\n\t if (leaf == null) return null;\n\t\n\t var _leaf$position = leaf.position(offset, true);\n\t\n\t var _leaf$position2 = _slicedToArray(_leaf$position, 2);\n\t\n\t node = _leaf$position2[0];\n\t offset = _leaf$position2[1];\n\t\n\t var range = document.createRange();\n\t if (length > 0) {\n\t range.setStart(node, offset);\n\t\n\t var _scroll$leaf3 = this.scroll.leaf(index + length);\n\t\n\t var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2);\n\t\n\t leaf = _scroll$leaf4[0];\n\t offset = _scroll$leaf4[1];\n\t\n\t if (leaf == null) return null;\n\t\n\t var _leaf$position3 = leaf.position(offset, true);\n\t\n\t var _leaf$position4 = _slicedToArray(_leaf$position3, 2);\n\t\n\t node = _leaf$position4[0];\n\t offset = _leaf$position4[1];\n\t\n\t range.setEnd(node, offset);\n\t bounds = range.getBoundingClientRect();\n\t } else {\n\t var side = 'left';\n\t var rect = void 0;\n\t if (node instanceof Text) {\n\t if (offset < node.data.length) {\n\t range.setStart(node, offset);\n\t range.setEnd(node, offset + 1);\n\t } else {\n\t range.setStart(node, offset - 1);\n\t range.setEnd(node, offset);\n\t side = 'right';\n\t }\n\t rect = range.getBoundingClientRect();\n\t } else {\n\t rect = leaf.domNode.getBoundingClientRect();\n\t if (offset > 0) side = 'right';\n\t }\n\t bounds = {\n\t height: rect.height,\n\t left: rect[side],\n\t width: 0,\n\t top: rect.top\n\t };\n\t }\n\t var containerBounds = this.root.parentNode.getBoundingClientRect();\n\t return {\n\t left: bounds.left - containerBounds.left,\n\t right: bounds.left + bounds.width - containerBounds.left,\n\t top: bounds.top - containerBounds.top,\n\t bottom: bounds.top + bounds.height - containerBounds.top,\n\t height: bounds.height,\n\t width: bounds.width\n\t };\n\t }\n\t }, {\n\t key: 'getNativeRange',\n\t value: function getNativeRange() {\n\t var selection = document.getSelection();\n\t if (selection == null || selection.rangeCount <= 0) return null;\n\t var nativeRange = selection.getRangeAt(0);\n\t if (nativeRange == null) return null;\n\t if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) {\n\t return null;\n\t }\n\t var range = {\n\t start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n\t end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n\t native: nativeRange\n\t };\n\t [range.start, range.end].forEach(function (position) {\n\t var node = position.node,\n\t offset = position.offset;\n\t while (!(node instanceof Text) && node.childNodes.length > 0) {\n\t if (node.childNodes.length > offset) {\n\t node = node.childNodes[offset];\n\t offset = 0;\n\t } else if (node.childNodes.length === offset) {\n\t node = node.lastChild;\n\t offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n\t } else {\n\t break;\n\t }\n\t }\n\t position.node = node, position.offset = offset;\n\t });\n\t debug.info('getNativeRange', range);\n\t return range;\n\t }\n\t }, {\n\t key: 'getRange',\n\t value: function getRange() {\n\t var _this2 = this;\n\t\n\t var range = this.getNativeRange();\n\t if (range == null) return [null, null];\n\t var positions = [[range.start.node, range.start.offset]];\n\t if (!range.native.collapsed) {\n\t positions.push([range.end.node, range.end.offset]);\n\t }\n\t var indexes = positions.map(function (position) {\n\t var _position = _slicedToArray(position, 2),\n\t node = _position[0],\n\t offset = _position[1];\n\t\n\t var blot = _parchment2.default.find(node, true);\n\t var index = blot.offset(_this2.scroll);\n\t if (offset === 0) {\n\t return index;\n\t } else if (blot instanceof _parchment2.default.Container) {\n\t return index + blot.length();\n\t } else {\n\t return index + blot.index(node, offset);\n\t }\n\t });\n\t var start = Math.min.apply(Math, _toConsumableArray(indexes)),\n\t end = Math.max.apply(Math, _toConsumableArray(indexes));\n\t return [new Range(start, end - start), range];\n\t }\n\t }, {\n\t key: 'hasFocus',\n\t value: function hasFocus() {\n\t return document.activeElement === this.root;\n\t }\n\t }, {\n\t key: 'scrollIntoView',\n\t value: function scrollIntoView() {\n\t var range = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.lastRange;\n\t\n\t if (range == null) return;\n\t var bounds = this.getBounds(range.index, range.length);\n\t if (bounds == null) return;\n\t if (this.root.offsetHeight < bounds.bottom) {\n\t var _scroll$line = this.scroll.line(Math.min(range.index + range.length, this.scroll.length() - 1)),\n\t _scroll$line2 = _slicedToArray(_scroll$line, 1),\n\t line = _scroll$line2[0];\n\t\n\t this.root.scrollTop = line.domNode.offsetTop + line.domNode.offsetHeight - this.root.offsetHeight;\n\t } else if (bounds.top < 0) {\n\t var _scroll$line3 = this.scroll.line(Math.min(range.index, this.scroll.length() - 1)),\n\t _scroll$line4 = _slicedToArray(_scroll$line3, 1),\n\t _line = _scroll$line4[0];\n\t\n\t this.root.scrollTop = _line.domNode.offsetTop;\n\t }\n\t }\n\t }, {\n\t key: 'setNativeRange',\n\t value: function setNativeRange(startNode, startOffset) {\n\t var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode;\n\t var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset;\n\t var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\t\n\t debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n\t if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n\t return;\n\t }\n\t var selection = document.getSelection();\n\t if (selection == null) return;\n\t if (startNode != null) {\n\t if (!this.hasFocus()) this.root.focus();\n\t var nativeRange = this.getNativeRange();\n\t if (nativeRange == null || force || startNode !== nativeRange.start.node || startOffset !== nativeRange.start.offset || endNode !== nativeRange.end.node || endOffset !== nativeRange.end.offset) {\n\t var range = document.createRange();\n\t range.setStart(startNode, startOffset);\n\t range.setEnd(endNode, endOffset);\n\t selection.removeAllRanges();\n\t selection.addRange(range);\n\t }\n\t } else {\n\t selection.removeAllRanges();\n\t this.root.blur();\n\t document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n\t }\n\t }\n\t }, {\n\t key: 'setRange',\n\t value: function setRange(range) {\n\t var _this3 = this;\n\t\n\t var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\t var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;\n\t\n\t if (typeof force === 'string') {\n\t source = force;\n\t force = false;\n\t }\n\t debug.info('setRange', range);\n\t if (range != null) {\n\t (function () {\n\t var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n\t var args = [];\n\t var scrollLength = _this3.scroll.length();\n\t indexes.forEach(function (index, i) {\n\t index = Math.min(scrollLength - 1, index);\n\t var node = void 0,\n\t _scroll$leaf5 = _this3.scroll.leaf(index),\n\t _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2),\n\t leaf = _scroll$leaf6[0],\n\t offset = _scroll$leaf6[1];\n\t var _leaf$position5 = leaf.position(offset, i !== 0);\n\t\n\t var _leaf$position6 = _slicedToArray(_leaf$position5, 2);\n\t\n\t node = _leaf$position6[0];\n\t offset = _leaf$position6[1];\n\t\n\t args.push(node, offset);\n\t });\n\t if (args.length < 2) {\n\t args = args.concat(args);\n\t }\n\t _this3.setNativeRange.apply(_this3, _toConsumableArray(args).concat([force]));\n\t })();\n\t } else {\n\t this.setNativeRange(null);\n\t }\n\t this.update(source);\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update() {\n\t var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;\n\t\n\t var nativeRange = void 0,\n\t oldRange = this.lastRange;\n\t\n\t var _getRange = this.getRange();\n\t\n\t var _getRange2 = _slicedToArray(_getRange, 2);\n\t\n\t this.lastRange = _getRange2[0];\n\t nativeRange = _getRange2[1];\n\t\n\t if (this.lastRange != null) {\n\t this.savedRange = this.lastRange;\n\t }\n\t if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) {\n\t var _emitter;\n\t\n\t if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n\t this.cursor.restore();\n\t }\n\t var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source];\n\t (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n\t if (source !== _emitter4.default.sources.SILENT) {\n\t var _emitter2;\n\t\n\t (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return Selection;\n\t}();\n\t\n\tfunction contains(parent, descendant) {\n\t try {\n\t // Firefox inserts inaccessible nodes around video elements\n\t descendant.parentNode;\n\t } catch (e) {\n\t return false;\n\t }\n\t // IE11 has bug with Text nodes\n\t // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n\t if (descendant instanceof Text) {\n\t descendant = descendant.parentNode;\n\t }\n\t return parent.contains(descendant);\n\t}\n\t\n\texports.Range = Range;\n\texports.default = Selection;\n\n/***/ },\n/* 45 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Theme = function () {\n\t function Theme(quill, options) {\n\t _classCallCheck(this, Theme);\n\t\n\t this.quill = quill;\n\t this.options = options;\n\t this.modules = {};\n\t }\n\t\n\t _createClass(Theme, [{\n\t key: 'init',\n\t value: function init() {\n\t var _this = this;\n\t\n\t Object.keys(this.options.modules).forEach(function (name) {\n\t if (_this.modules[name] == null) {\n\t _this.addModule(name);\n\t }\n\t });\n\t }\n\t }, {\n\t key: 'addModule',\n\t value: function addModule(name) {\n\t var moduleClass = this.quill.constructor.import('modules/' + name);\n\t this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n\t return this.modules[name];\n\t }\n\t }]);\n\t\n\t return Theme;\n\t}();\n\t\n\tTheme.DEFAULTS = {\n\t modules: {}\n\t};\n\tTheme.themes = {\n\t 'default': Theme\n\t};\n\t\n\texports.default = Theme;\n\n/***/ },\n/* 46 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Container = function (_Parchment$Container) {\n\t _inherits(Container, _Parchment$Container);\n\t\n\t function Container() {\n\t _classCallCheck(this, Container);\n\t\n\t return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments));\n\t }\n\t\n\t return Container;\n\t}(_parchment2.default.Container);\n\t\n\tContainer.allowedChildren = [_block2.default, _block.BlockEmbed, Container];\n\t\n\texports.default = Container;\n\n/***/ },\n/* 47 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _emitter = __webpack_require__(36);\n\t\n\tvar _emitter2 = _interopRequireDefault(_emitter);\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tvar _break = __webpack_require__(31);\n\t\n\tvar _break2 = _interopRequireDefault(_break);\n\t\n\tvar _container = __webpack_require__(46);\n\t\n\tvar _container2 = _interopRequireDefault(_container);\n\t\n\tvar _code = __webpack_require__(28);\n\t\n\tvar _code2 = _interopRequireDefault(_code);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tfunction isLine(blot) {\n\t return blot instanceof _block2.default || blot instanceof _block.BlockEmbed;\n\t}\n\t\n\tvar Scroll = function (_Parchment$Scroll) {\n\t _inherits(Scroll, _Parchment$Scroll);\n\t\n\t function Scroll(domNode, config) {\n\t _classCallCheck(this, Scroll);\n\t\n\t var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode));\n\t\n\t _this.emitter = config.emitter;\n\t if (Array.isArray(config.whitelist)) {\n\t _this.whitelist = config.whitelist.reduce(function (whitelist, format) {\n\t whitelist[format] = true;\n\t return whitelist;\n\t }, {});\n\t }\n\t _this.optimize();\n\t _this.enable();\n\t return _this;\n\t }\n\t\n\t _createClass(Scroll, [{\n\t key: 'deleteAt',\n\t value: function deleteAt(index, length) {\n\t var _line = this.line(index),\n\t _line2 = _slicedToArray(_line, 2),\n\t first = _line2[0],\n\t offset = _line2[1];\n\t\n\t var _line3 = this.line(index + length),\n\t _line4 = _slicedToArray(_line3, 1),\n\t last = _line4[0];\n\t\n\t _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length);\n\t if (last != null && first !== last && offset > 0 && !(first instanceof _block.BlockEmbed) && !(last instanceof _block.BlockEmbed)) {\n\t if (last instanceof _code2.default) {\n\t last.deleteAt(last.length() - 1, 1);\n\t }\n\t var ref = last.children.head instanceof _break2.default ? null : last.children.head;\n\t first.moveChildren(last, ref);\n\t first.remove();\n\t }\n\t this.optimize();\n\t }\n\t }, {\n\t key: 'enable',\n\t value: function enable() {\n\t var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\t\n\t this.domNode.setAttribute('contenteditable', enabled);\n\t }\n\t }, {\n\t key: 'formatAt',\n\t value: function formatAt(index, length, format, value) {\n\t if (this.whitelist != null && !this.whitelist[format]) return;\n\t _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value);\n\t this.optimize();\n\t }\n\t }, {\n\t key: 'insertAt',\n\t value: function insertAt(index, value, def) {\n\t if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n\t if (index >= this.length()) {\n\t if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) {\n\t var blot = _parchment2.default.create(this.statics.defaultChild);\n\t this.appendChild(blot);\n\t if (def == null && value.endsWith('\\n')) {\n\t value = value.slice(0, -1);\n\t }\n\t blot.insertAt(0, value, def);\n\t } else {\n\t var embed = _parchment2.default.create(value, def);\n\t this.appendChild(embed);\n\t }\n\t } else {\n\t _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def);\n\t }\n\t this.optimize();\n\t }\n\t }, {\n\t key: 'insertBefore',\n\t value: function insertBefore(blot, ref) {\n\t if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) {\n\t var wrapper = _parchment2.default.create(this.statics.defaultChild);\n\t wrapper.appendChild(blot);\n\t blot = wrapper;\n\t }\n\t _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref);\n\t }\n\t }, {\n\t key: 'leaf',\n\t value: function leaf(index) {\n\t return this.path(index).pop() || [null, -1];\n\t }\n\t }, {\n\t key: 'line',\n\t value: function line(index) {\n\t if (index === this.length()) {\n\t return this.line(index - 1);\n\t }\n\t return this.descendant(isLine, index);\n\t }\n\t }, {\n\t key: 'lines',\n\t value: function lines() {\n\t var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\t\n\t var getLines = function getLines(blot, index, length) {\n\t var lines = [],\n\t lengthLeft = length;\n\t blot.children.forEachAt(index, length, function (child, index, length) {\n\t if (isLine(child)) {\n\t lines.push(child);\n\t } else if (child instanceof _parchment2.default.Container) {\n\t lines = lines.concat(getLines(child, index, lengthLeft));\n\t }\n\t lengthLeft -= length;\n\t });\n\t return lines;\n\t };\n\t return getLines(this, index, length);\n\t }\n\t }, {\n\t key: 'optimize',\n\t value: function optimize() {\n\t var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\t\n\t if (this.batch === true) return;\n\t _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations);\n\t if (mutations.length > 0) {\n\t this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations);\n\t }\n\t }\n\t }, {\n\t key: 'path',\n\t value: function path(index) {\n\t return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update(mutations) {\n\t if (this.batch === true) return;\n\t var source = _emitter2.default.sources.USER;\n\t if (typeof mutations === 'string') {\n\t source = mutations;\n\t }\n\t if (!Array.isArray(mutations)) {\n\t mutations = this.observer.takeRecords();\n\t }\n\t if (mutations.length > 0) {\n\t this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations);\n\t }\n\t _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy\n\t if (mutations.length > 0) {\n\t this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations);\n\t }\n\t }\n\t }]);\n\t\n\t return Scroll;\n\t}(_parchment2.default.Scroll);\n\t\n\tScroll.blotName = 'scroll';\n\tScroll.className = 'ql-editor';\n\tScroll.tagName = 'DIV';\n\tScroll.defaultChild = 'block';\n\tScroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default];\n\t\n\texports.default = Scroll;\n\n/***/ },\n/* 48 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined;\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tvar _logger = __webpack_require__(38);\n\t\n\tvar _logger2 = _interopRequireDefault(_logger);\n\t\n\tvar _module = __webpack_require__(43);\n\t\n\tvar _module2 = _interopRequireDefault(_module);\n\t\n\tvar _align = __webpack_require__(49);\n\t\n\tvar _background = __webpack_require__(50);\n\t\n\tvar _color = __webpack_require__(51);\n\t\n\tvar _direction = __webpack_require__(52);\n\t\n\tvar _font = __webpack_require__(53);\n\t\n\tvar _size = __webpack_require__(54);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar debug = (0, _logger2.default)('quill:clipboard');\n\t\n\tvar CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]];\n\t\n\tvar ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) {\n\t memo[attr.keyName] = attr;\n\t return memo;\n\t}, {});\n\t\n\tvar STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) {\n\t memo[attr.keyName] = attr;\n\t return memo;\n\t}, {});\n\t\n\tvar Clipboard = function (_Module) {\n\t _inherits(Clipboard, _Module);\n\t\n\t function Clipboard(quill, options) {\n\t _classCallCheck(this, Clipboard);\n\t\n\t var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options));\n\t\n\t _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this));\n\t _this.container = _this.quill.addContainer('ql-clipboard');\n\t _this.container.setAttribute('contenteditable', true);\n\t _this.container.setAttribute('tabindex', -1);\n\t _this.matchers = [];\n\t CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (pair) {\n\t _this.addMatcher.apply(_this, _toConsumableArray(pair));\n\t });\n\t return _this;\n\t }\n\t\n\t _createClass(Clipboard, [{\n\t key: 'addMatcher',\n\t value: function addMatcher(selector, matcher) {\n\t this.matchers.push([selector, matcher]);\n\t }\n\t }, {\n\t key: 'convert',\n\t value: function convert(html) {\n\t var _this2 = this;\n\t\n\t var DOM_KEY = '__ql-matcher';\n\t if (typeof html === 'string') {\n\t this.container.innerHTML = html;\n\t }\n\t var textMatchers = [],\n\t elementMatchers = [];\n\t this.matchers.forEach(function (pair) {\n\t var _pair = _slicedToArray(pair, 2),\n\t selector = _pair[0],\n\t matcher = _pair[1];\n\t\n\t switch (selector) {\n\t case Node.TEXT_NODE:\n\t textMatchers.push(matcher);\n\t break;\n\t case Node.ELEMENT_NODE:\n\t elementMatchers.push(matcher);\n\t break;\n\t default:\n\t [].forEach.call(_this2.container.querySelectorAll(selector), function (node) {\n\t // TODO use weakmap\n\t node[DOM_KEY] = node[DOM_KEY] || [];\n\t node[DOM_KEY].push(matcher);\n\t });\n\t break;\n\t }\n\t });\n\t var traverse = function traverse(node) {\n\t // Post-order\n\t if (node.nodeType === node.TEXT_NODE) {\n\t return textMatchers.reduce(function (delta, matcher) {\n\t return matcher(node, delta);\n\t }, new _quillDelta2.default());\n\t } else if (node.nodeType === node.ELEMENT_NODE) {\n\t return [].reduce.call(node.childNodes || [], function (delta, childNode) {\n\t var childrenDelta = traverse(childNode);\n\t if (childNode.nodeType === node.ELEMENT_NODE) {\n\t childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) {\n\t return matcher(childNode, childrenDelta);\n\t }, childrenDelta);\n\t childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) {\n\t return matcher(childNode, childrenDelta);\n\t }, childrenDelta);\n\t }\n\t return delta.concat(childrenDelta);\n\t }, new _quillDelta2.default());\n\t } else {\n\t return new _quillDelta2.default();\n\t }\n\t };\n\t var delta = traverse(this.container);\n\t // Remove trailing newline\n\t if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n\t delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1));\n\t }\n\t debug.log('convert', this.container.innerHTML, delta);\n\t this.container.innerHTML = '';\n\t return delta;\n\t }\n\t }, {\n\t key: 'dangerouslyPasteHTML',\n\t value: function dangerouslyPasteHTML(index, html) {\n\t var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API;\n\t\n\t if (typeof index === 'string') {\n\t return this.quill.setContents(this.convert(index), html);\n\t } else {\n\t var paste = this.convert(html);\n\t return this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source);\n\t }\n\t }\n\t }, {\n\t key: 'onPaste',\n\t value: function onPaste(e) {\n\t var _this3 = this;\n\t\n\t if (e.defaultPrevented || !this.quill.isEnabled()) return;\n\t var range = this.quill.getSelection();\n\t var delta = new _quillDelta2.default().retain(range.index).delete(range.length);\n\t var bodyTop = document.body.scrollTop;\n\t this.container.focus();\n\t setTimeout(function () {\n\t _this3.quill.selection.update(_quill2.default.sources.SILENT);\n\t delta = delta.concat(_this3.convert());\n\t _this3.quill.updateContents(delta, _quill2.default.sources.USER);\n\t // range.length contributes to delta.length()\n\t _this3.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);\n\t document.body.scrollTop = bodyTop;\n\t _this3.quill.selection.scrollIntoView();\n\t }, 1);\n\t }\n\t }]);\n\t\n\t return Clipboard;\n\t}(_module2.default);\n\t\n\tClipboard.DEFAULTS = {\n\t matchers: []\n\t};\n\t\n\tfunction computeStyle(node) {\n\t if (node.nodeType !== Node.ELEMENT_NODE) return {};\n\t var DOM_KEY = '__ql-computed-style';\n\t return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n\t}\n\t\n\tfunction deltaEndsWith(delta, text) {\n\t var endText = \"\";\n\t for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n\t var op = delta.ops[i];\n\t if (typeof op.insert !== 'string') break;\n\t endText = op.insert + endText;\n\t }\n\t return endText.slice(-1 * text.length) === text;\n\t}\n\t\n\tfunction isLine(node) {\n\t if (node.childNodes.length === 0) return false; // Exclude embed blocks\n\t var style = computeStyle(node);\n\t return ['block', 'list-item'].indexOf(style.display) > -1;\n\t}\n\t\n\tfunction matchAlias(format, node, delta) {\n\t return delta.compose(new _quillDelta2.default().retain(delta.length(), _defineProperty({}, format, true)));\n\t}\n\t\n\tfunction matchAttributor(node, delta) {\n\t var attributes = _parchment2.default.Attributor.Attribute.keys(node);\n\t var classes = _parchment2.default.Attributor.Class.keys(node);\n\t var styles = _parchment2.default.Attributor.Style.keys(node);\n\t var formats = {};\n\t attributes.concat(classes).concat(styles).forEach(function (name) {\n\t var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE);\n\t if (attr != null) {\n\t formats[attr.attrName] = attr.value(node);\n\t if (formats[attr.attrName]) return;\n\t }\n\t if (ATTRIBUTE_ATTRIBUTORS[name] != null) {\n\t attr = ATTRIBUTE_ATTRIBUTORS[name];\n\t formats[attr.attrName] = attr.value(node);\n\t }\n\t if (STYLE_ATTRIBUTORS[name] != null) {\n\t attr = STYLE_ATTRIBUTORS[name];\n\t formats[attr.attrName] = attr.value(node);\n\t }\n\t });\n\t if (Object.keys(formats).length > 0) {\n\t delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats));\n\t }\n\t return delta;\n\t}\n\t\n\tfunction matchBlot(node, delta) {\n\t var match = _parchment2.default.query(node);\n\t if (match == null) return delta;\n\t if (match.prototype instanceof _parchment2.default.Embed) {\n\t var embed = {};\n\t var value = match.value(node);\n\t if (value != null) {\n\t embed[match.blotName] = value;\n\t delta = new _quillDelta2.default().insert(embed, match.formats(node));\n\t }\n\t } else if (typeof match.formats === 'function') {\n\t var formats = _defineProperty({}, match.blotName, match.formats(node));\n\t delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats));\n\t }\n\t return delta;\n\t}\n\t\n\tfunction matchBreak(node, delta) {\n\t if (!deltaEndsWith(delta, '\\n')) {\n\t delta.insert('\\n');\n\t }\n\t return delta;\n\t}\n\t\n\tfunction matchIgnore() {\n\t return new _quillDelta2.default();\n\t}\n\t\n\tfunction matchNewline(node, delta) {\n\t if (isLine(node) && !deltaEndsWith(delta, '\\n')) {\n\t delta.insert('\\n');\n\t }\n\t return delta;\n\t}\n\t\n\tfunction matchSpacing(node, delta) {\n\t if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\\n\\n')) {\n\t var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);\n\t if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) {\n\t delta.insert('\\n');\n\t }\n\t }\n\t return delta;\n\t}\n\t\n\tfunction matchStyles(node, delta) {\n\t var formats = {};\n\t var style = node.style || {};\n\t if (style.fontWeight && computeStyle(node).fontWeight === 'bold') {\n\t formats.bold = true;\n\t }\n\t if (Object.keys(formats).length > 0) {\n\t delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats));\n\t }\n\t if (parseFloat(style.textIndent || 0) > 0) {\n\t // Could be 0.5in\n\t delta = new _quillDelta2.default().insert('\\t').concat(delta);\n\t }\n\t return delta;\n\t}\n\t\n\tfunction matchText(node, delta) {\n\t var text = node.data;\n\t // Word represents empty line with  \n\t if (node.parentNode.tagName === 'O:P') {\n\t return delta.insert(text.trim());\n\t }\n\t if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n\t // eslint-disable-next-line func-style\n\t var replacer = function replacer(collapse, match) {\n\t match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n\t return match.length < 1 && collapse ? ' ' : match;\n\t };\n\t text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n\t text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n\t if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) {\n\t text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n\t }\n\t if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) {\n\t text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n\t }\n\t }\n\t return delta.insert(text);\n\t}\n\t\n\texports.default = Clipboard;\n\texports.matchAttributor = matchAttributor;\n\texports.matchBlot = matchBlot;\n\texports.matchNewline = matchNewline;\n\texports.matchSpacing = matchSpacing;\n\texports.matchText = matchText;\n\n/***/ },\n/* 49 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined;\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar config = {\n\t scope: _parchment2.default.Scope.BLOCK,\n\t whitelist: ['right', 'center', 'justify']\n\t};\n\t\n\tvar AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config);\n\tvar AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config);\n\tvar AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config);\n\t\n\texports.AlignAttribute = AlignAttribute;\n\texports.AlignClass = AlignClass;\n\texports.AlignStyle = AlignStyle;\n\n/***/ },\n/* 50 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.BackgroundStyle = exports.BackgroundClass = undefined;\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _color = __webpack_require__(51);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', {\n\t scope: _parchment2.default.Scope.INLINE\n\t});\n\tvar BackgroundStyle = new _color.ColorAttributor('background', 'background-color', {\n\t scope: _parchment2.default.Scope.INLINE\n\t});\n\t\n\texports.BackgroundClass = BackgroundClass;\n\texports.BackgroundStyle = BackgroundStyle;\n\n/***/ },\n/* 51 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ColorAttributor = function (_Parchment$Attributor) {\n\t _inherits(ColorAttributor, _Parchment$Attributor);\n\t\n\t function ColorAttributor() {\n\t _classCallCheck(this, ColorAttributor);\n\t\n\t return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments));\n\t }\n\t\n\t _createClass(ColorAttributor, [{\n\t key: 'value',\n\t value: function value(domNode) {\n\t var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode);\n\t if (!value.startsWith('rgb(')) return value;\n\t value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n\t return '#' + value.split(',').map(function (component) {\n\t return ('00' + parseInt(component).toString(16)).slice(-2);\n\t }).join('');\n\t }\n\t }]);\n\t\n\t return ColorAttributor;\n\t}(_parchment2.default.Attributor.Style);\n\t\n\tvar ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', {\n\t scope: _parchment2.default.Scope.INLINE\n\t});\n\tvar ColorStyle = new ColorAttributor('color', 'color', {\n\t scope: _parchment2.default.Scope.INLINE\n\t});\n\t\n\texports.ColorAttributor = ColorAttributor;\n\texports.ColorClass = ColorClass;\n\texports.ColorStyle = ColorStyle;\n\n/***/ },\n/* 52 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined;\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar config = {\n\t scope: _parchment2.default.Scope.BLOCK,\n\t whitelist: ['rtl']\n\t};\n\t\n\tvar DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config);\n\tvar DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config);\n\tvar DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config);\n\t\n\texports.DirectionAttribute = DirectionAttribute;\n\texports.DirectionClass = DirectionClass;\n\texports.DirectionStyle = DirectionStyle;\n\n/***/ },\n/* 53 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.FontClass = exports.FontStyle = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar config = {\n\t scope: _parchment2.default.Scope.INLINE,\n\t whitelist: ['serif', 'monospace']\n\t};\n\t\n\tvar FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config);\n\t\n\tvar FontStyleAttributor = function (_Parchment$Attributor) {\n\t _inherits(FontStyleAttributor, _Parchment$Attributor);\n\t\n\t function FontStyleAttributor() {\n\t _classCallCheck(this, FontStyleAttributor);\n\t\n\t return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments));\n\t }\n\t\n\t _createClass(FontStyleAttributor, [{\n\t key: 'value',\n\t value: function value(node) {\n\t return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/[\"']/g, '');\n\t }\n\t }]);\n\t\n\t return FontStyleAttributor;\n\t}(_parchment2.default.Attributor.Style);\n\t\n\tvar FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\t\n\texports.FontStyle = FontStyle;\n\texports.FontClass = FontClass;\n\n/***/ },\n/* 54 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SizeStyle = exports.SizeClass = undefined;\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', {\n\t scope: _parchment2.default.Scope.INLINE,\n\t whitelist: ['small', 'large', 'huge']\n\t});\n\tvar SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', {\n\t scope: _parchment2.default.Scope.INLINE,\n\t whitelist: ['10px', '18px', '32px']\n\t});\n\t\n\texports.SizeClass = SizeClass;\n\texports.SizeStyle = SizeStyle;\n\n/***/ },\n/* 55 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.getLastChangeIndex = exports.default = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tvar _module = __webpack_require__(43);\n\t\n\tvar _module2 = _interopRequireDefault(_module);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar History = function (_Module) {\n\t _inherits(History, _Module);\n\t\n\t function History(quill, options) {\n\t _classCallCheck(this, History);\n\t\n\t var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options));\n\t\n\t _this.lastRecorded = 0;\n\t _this.ignoreChange = false;\n\t _this.clear();\n\t _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) {\n\t if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return;\n\t if (!_this.options.userOnly || source === _quill2.default.sources.USER) {\n\t _this.record(delta, oldDelta);\n\t } else {\n\t _this.transform(delta);\n\t }\n\t });\n\t _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this));\n\t _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this));\n\t if (/Win/i.test(navigator.platform)) {\n\t _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this));\n\t }\n\t return _this;\n\t }\n\t\n\t _createClass(History, [{\n\t key: 'change',\n\t value: function change(source, dest) {\n\t if (this.stack[source].length === 0) return;\n\t var delta = this.stack[source].pop();\n\t this.lastRecorded = 0;\n\t this.ignoreChange = true;\n\t this.quill.updateContents(delta[source], _quill2.default.sources.USER);\n\t this.ignoreChange = false;\n\t var index = getLastChangeIndex(delta[source]);\n\t this.quill.setSelection(index);\n\t this.quill.selection.scrollIntoView();\n\t this.stack[dest].push(delta);\n\t }\n\t }, {\n\t key: 'clear',\n\t value: function clear() {\n\t this.stack = { undo: [], redo: [] };\n\t }\n\t }, {\n\t key: 'record',\n\t value: function record(changeDelta, oldDelta) {\n\t if (changeDelta.ops.length === 0) return;\n\t this.stack.redo = [];\n\t var undoDelta = this.quill.getContents().diff(oldDelta);\n\t var timestamp = Date.now();\n\t if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n\t var delta = this.stack.undo.pop();\n\t undoDelta = undoDelta.compose(delta.undo);\n\t changeDelta = delta.redo.compose(changeDelta);\n\t } else {\n\t this.lastRecorded = timestamp;\n\t }\n\t this.stack.undo.push({\n\t redo: changeDelta,\n\t undo: undoDelta\n\t });\n\t if (this.stack.undo.length > this.options.maxStack) {\n\t this.stack.undo.shift();\n\t }\n\t }\n\t }, {\n\t key: 'redo',\n\t value: function redo() {\n\t this.change('redo', 'undo');\n\t }\n\t }, {\n\t key: 'transform',\n\t value: function transform(delta) {\n\t this.stack.undo.forEach(function (change) {\n\t change.undo = delta.transform(change.undo, true);\n\t change.redo = delta.transform(change.redo, true);\n\t });\n\t this.stack.redo.forEach(function (change) {\n\t change.undo = delta.transform(change.undo, true);\n\t change.redo = delta.transform(change.redo, true);\n\t });\n\t }\n\t }, {\n\t key: 'undo',\n\t value: function undo() {\n\t this.change('undo', 'redo');\n\t }\n\t }]);\n\t\n\t return History;\n\t}(_module2.default);\n\t\n\tHistory.DEFAULTS = {\n\t delay: 1000,\n\t maxStack: 100,\n\t userOnly: false\n\t};\n\t\n\tfunction endsWithNewlineChange(delta) {\n\t var lastOp = delta.ops[delta.ops.length - 1];\n\t if (lastOp == null) return false;\n\t if (lastOp.insert != null) {\n\t return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n\t }\n\t if (lastOp.attributes != null) {\n\t return Object.keys(lastOp.attributes).some(function (attr) {\n\t return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null;\n\t });\n\t }\n\t return false;\n\t}\n\t\n\tfunction getLastChangeIndex(delta) {\n\t var deleteLength = delta.reduce(function (length, op) {\n\t length += op.delete || 0;\n\t return length;\n\t }, 0);\n\t var changeIndex = delta.length() - deleteLength;\n\t if (endsWithNewlineChange(delta)) {\n\t changeIndex -= 1;\n\t }\n\t return changeIndex;\n\t}\n\t\n\texports.default = History;\n\texports.getLastChangeIndex = getLastChangeIndex;\n\n/***/ },\n/* 56 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _clone = __webpack_require__(39);\n\t\n\tvar _clone2 = _interopRequireDefault(_clone);\n\t\n\tvar _deepEqual = __webpack_require__(40);\n\t\n\tvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _op = __webpack_require__(26);\n\t\n\tvar _op2 = _interopRequireDefault(_op);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tvar _logger = __webpack_require__(38);\n\t\n\tvar _logger2 = _interopRequireDefault(_logger);\n\t\n\tvar _module = __webpack_require__(43);\n\t\n\tvar _module2 = _interopRequireDefault(_module);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar debug = (0, _logger2.default)('quill:keyboard');\n\t\n\tvar SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\t\n\tvar Keyboard = function (_Module) {\n\t _inherits(Keyboard, _Module);\n\t\n\t _createClass(Keyboard, null, [{\n\t key: 'match',\n\t value: function match(evt, binding) {\n\t binding = normalize(binding);\n\t if (!!binding.shortKey !== evt[SHORTKEY] && binding.shortKey !== null) return false;\n\t if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) {\n\t return key != SHORTKEY && !!binding[key] !== evt[key] && binding[key] !== null;\n\t })) {\n\t return false;\n\t }\n\t return binding.key === (evt.which || evt.keyCode);\n\t }\n\t }]);\n\t\n\t function Keyboard(quill, options) {\n\t _classCallCheck(this, Keyboard);\n\t\n\t var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options));\n\t\n\t _this.bindings = {};\n\t Object.keys(_this.options.bindings).forEach(function (name) {\n\t if (_this.options.bindings[name]) {\n\t _this.addBinding(_this.options.bindings[name]);\n\t }\n\t });\n\t _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n\t _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {});\n\t _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n\t _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^$/ }, handleDelete);\n\t _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n\t _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n\t if (/Trident/i.test(navigator.userAgent)) {\n\t _this.addBinding({ key: Keyboard.keys.BACKSPACE, shortKey: true }, handleBackspace);\n\t _this.addBinding({ key: Keyboard.keys.DELETE, shortKey: true }, handleDelete);\n\t }\n\t _this.listen();\n\t return _this;\n\t }\n\t\n\t _createClass(Keyboard, [{\n\t key: 'addBinding',\n\t value: function addBinding(key) {\n\t var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t\n\t var binding = normalize(key);\n\t if (binding == null || binding.key == null) {\n\t return debug.warn('Attempted to add invalid keyboard binding', binding);\n\t }\n\t if (typeof context === 'function') {\n\t context = { handler: context };\n\t }\n\t if (typeof handler === 'function') {\n\t handler = { handler: handler };\n\t }\n\t binding = (0, _extend2.default)(binding, context, handler);\n\t this.bindings[binding.key] = this.bindings[binding.key] || [];\n\t this.bindings[binding.key].push(binding);\n\t }\n\t }, {\n\t key: 'listen',\n\t value: function listen() {\n\t var _this2 = this;\n\t\n\t this.quill.root.addEventListener('keydown', function (evt) {\n\t if (evt.defaultPrevented) return;\n\t var which = evt.which || evt.keyCode;\n\t var bindings = (_this2.bindings[which] || []).filter(function (binding) {\n\t return Keyboard.match(evt, binding);\n\t });\n\t if (bindings.length === 0) return;\n\t var range = _this2.quill.getSelection();\n\t if (range == null || !_this2.quill.hasFocus()) return;\n\t\n\t var _quill$scroll$line = _this2.quill.scroll.line(range.index),\n\t _quill$scroll$line2 = _slicedToArray(_quill$scroll$line, 2),\n\t line = _quill$scroll$line2[0],\n\t offset = _quill$scroll$line2[1];\n\t\n\t var _quill$scroll$leaf = _this2.quill.scroll.leaf(range.index),\n\t _quill$scroll$leaf2 = _slicedToArray(_quill$scroll$leaf, 2),\n\t leafStart = _quill$scroll$leaf2[0],\n\t offsetStart = _quill$scroll$leaf2[1];\n\t\n\t var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.scroll.leaf(range.index + range.length),\n\t _ref2 = _slicedToArray(_ref, 2),\n\t leafEnd = _ref2[0],\n\t offsetEnd = _ref2[1];\n\t\n\t var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : '';\n\t var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : '';\n\t var curContext = {\n\t collapsed: range.length === 0,\n\t empty: range.length === 0 && line.length() <= 1,\n\t format: _this2.quill.getFormat(range),\n\t offset: offset,\n\t prefix: prefixText,\n\t suffix: suffixText\n\t };\n\t var prevented = bindings.some(function (binding) {\n\t if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n\t if (binding.empty != null && binding.empty !== curContext.empty) return false;\n\t if (binding.offset != null && binding.offset !== curContext.offset) return false;\n\t if (Array.isArray(binding.format)) {\n\t // any format is present\n\t if (binding.format.every(function (name) {\n\t return curContext.format[name] == null;\n\t })) {\n\t return false;\n\t }\n\t } else if (_typeof(binding.format) === 'object') {\n\t // all formats must match\n\t if (!Object.keys(binding.format).every(function (name) {\n\t if (binding.format[name] === true) return curContext.format[name] != null;\n\t if (binding.format[name] === false) return curContext.format[name] == null;\n\t return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]);\n\t })) {\n\t return false;\n\t }\n\t }\n\t if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n\t if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n\t return binding.handler.call(_this2, range, curContext) !== true;\n\t });\n\t if (prevented) {\n\t evt.preventDefault();\n\t }\n\t });\n\t }\n\t }]);\n\t\n\t return Keyboard;\n\t}(_module2.default);\n\t\n\tKeyboard.keys = {\n\t BACKSPACE: 8,\n\t TAB: 9,\n\t ENTER: 13,\n\t ESCAPE: 27,\n\t LEFT: 37,\n\t UP: 38,\n\t RIGHT: 39,\n\t DOWN: 40,\n\t DELETE: 46\n\t};\n\t\n\tKeyboard.DEFAULTS = {\n\t bindings: {\n\t 'bold': makeFormatHandler('bold'),\n\t 'italic': makeFormatHandler('italic'),\n\t 'underline': makeFormatHandler('underline'),\n\t 'indent': {\n\t // highlight tab or tab at beginning of list, indent or blockquote\n\t key: Keyboard.keys.TAB,\n\t format: ['blockquote', 'indent', 'list'],\n\t handler: function handler(range, context) {\n\t if (context.collapsed && context.offset !== 0) return true;\n\t this.quill.format('indent', '+1', _quill2.default.sources.USER);\n\t }\n\t },\n\t 'outdent': {\n\t key: Keyboard.keys.TAB,\n\t shiftKey: true,\n\t format: ['blockquote', 'indent', 'list'],\n\t // highlight tab or tab at beginning of list, indent or blockquote\n\t handler: function handler(range, context) {\n\t if (context.collapsed && context.offset !== 0) return true;\n\t this.quill.format('indent', '-1', _quill2.default.sources.USER);\n\t }\n\t },\n\t 'outdent backspace': {\n\t key: Keyboard.keys.BACKSPACE,\n\t collapsed: true,\n\t format: ['blockquote', 'indent', 'list'],\n\t offset: 0,\n\t handler: function handler(range, context) {\n\t if (context.format.indent != null) {\n\t this.quill.format('indent', '-1', _quill2.default.sources.USER);\n\t } else if (context.format.blockquote != null) {\n\t this.quill.format('blockquote', false, _quill2.default.sources.USER);\n\t } else if (context.format.list != null) {\n\t this.quill.format('list', false, _quill2.default.sources.USER);\n\t }\n\t }\n\t },\n\t 'indent code-block': makeCodeBlockHandler(true),\n\t 'outdent code-block': makeCodeBlockHandler(false),\n\t 'remove tab': {\n\t key: Keyboard.keys.TAB,\n\t shiftKey: true,\n\t collapsed: true,\n\t prefix: /\\t$/,\n\t handler: function handler(range) {\n\t this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);\n\t }\n\t },\n\t 'tab': {\n\t key: Keyboard.keys.TAB,\n\t handler: function handler(range, context) {\n\t if (!context.collapsed) {\n\t this.quill.scroll.deleteAt(range.index, range.length);\n\t }\n\t this.quill.insertText(range.index, '\\t', _quill2.default.sources.USER);\n\t this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n\t }\n\t },\n\t 'list empty enter': {\n\t key: Keyboard.keys.ENTER,\n\t collapsed: true,\n\t format: ['list'],\n\t empty: true,\n\t handler: function handler(range, context) {\n\t this.quill.format('list', false, _quill2.default.sources.USER);\n\t if (context.format.indent) {\n\t this.quill.format('indent', false, _quill2.default.sources.USER);\n\t }\n\t }\n\t },\n\t 'header enter': {\n\t key: Keyboard.keys.ENTER,\n\t collapsed: true,\n\t format: ['header'],\n\t suffix: /^$/,\n\t handler: function handler(range) {\n\t this.quill.scroll.insertAt(range.index, '\\n');\n\t this.quill.formatText(range.index + 1, 1, 'header', false, _quill2.default.sources.USER);\n\t this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n\t this.quill.selection.scrollIntoView();\n\t }\n\t },\n\t 'list autofill': {\n\t key: ' ',\n\t collapsed: true,\n\t format: { list: false },\n\t prefix: /^(1\\.|-)$/,\n\t handler: function handler(range, context) {\n\t var length = context.prefix.length;\n\t this.quill.scroll.deleteAt(range.index - length, length);\n\t this.quill.formatLine(range.index - length, 1, 'list', length === 1 ? 'bullet' : 'ordered', _quill2.default.sources.USER);\n\t this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT);\n\t }\n\t }\n\t }\n\t};\n\t\n\tfunction handleBackspace(range, context) {\n\t if (range.index === 0) return;\n\t\n\t var _quill$scroll$line3 = this.quill.scroll.line(range.index),\n\t _quill$scroll$line4 = _slicedToArray(_quill$scroll$line3, 1),\n\t line = _quill$scroll$line4[0];\n\t\n\t var formats = {};\n\t if (context.offset === 0) {\n\t var curFormats = line.formats();\n\t var prevFormats = this.quill.getFormat(range.index - 1, 1);\n\t formats = _op2.default.attributes.diff(curFormats, prevFormats) || {};\n\t }\n\t this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);\n\t if (Object.keys(formats).length > 0) {\n\t this.quill.formatLine(range.index - 1, 1, formats, _quill2.default.sources.USER);\n\t }\n\t this.quill.selection.scrollIntoView();\n\t}\n\t\n\tfunction handleDelete(range) {\n\t if (range.index >= this.quill.getLength() - 1) return;\n\t this.quill.deleteText(range.index, 1, _quill2.default.sources.USER);\n\t}\n\t\n\tfunction handleDeleteRange(range) {\n\t this.quill.deleteText(range, _quill2.default.sources.USER);\n\t this.quill.setSelection(range.index, _quill2.default.sources.SILENT);\n\t this.quill.selection.scrollIntoView();\n\t}\n\t\n\tfunction handleEnter(range, context) {\n\t var _this3 = this;\n\t\n\t if (range.length > 0) {\n\t this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n\t }\n\t var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) {\n\t if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n\t lineFormats[format] = context.format[format];\n\t }\n\t return lineFormats;\n\t }, {});\n\t this.quill.insertText(range.index, '\\n', lineFormats, _quill2.default.sources.USER);\n\t this.quill.selection.scrollIntoView();\n\t Object.keys(context.format).forEach(function (name) {\n\t if (lineFormats[name] != null) return;\n\t if (Array.isArray(context.format[name])) return;\n\t if (name === 'link') return;\n\t _this3.quill.format(name, context.format[name], _quill2.default.sources.USER);\n\t });\n\t}\n\t\n\tfunction makeCodeBlockHandler(indent) {\n\t return {\n\t key: Keyboard.keys.TAB,\n\t shiftKey: !indent,\n\t format: { 'code-block': true },\n\t handler: function handler(range) {\n\t var CodeBlock = _parchment2.default.query('code-block');\n\t var index = range.index,\n\t length = range.length;\n\t\n\t var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index),\n\t _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),\n\t block = _quill$scroll$descend2[0],\n\t offset = _quill$scroll$descend2[1];\n\t\n\t if (block == null) return;\n\t var scrollOffset = this.quill.scroll.offset(block);\n\t var start = block.newlineIndex(offset, true) + 1;\n\t var end = block.newlineIndex(scrollOffset + offset + length);\n\t var lines = block.domNode.textContent.slice(start, end).split('\\n');\n\t offset = 0;\n\t lines.forEach(function (line, i) {\n\t if (indent) {\n\t block.insertAt(start + offset, CodeBlock.TAB);\n\t offset += CodeBlock.TAB.length;\n\t if (i === 0) {\n\t index += CodeBlock.TAB.length;\n\t } else {\n\t length += CodeBlock.TAB.length;\n\t }\n\t } else if (line.startsWith(CodeBlock.TAB)) {\n\t block.deleteAt(start + offset, CodeBlock.TAB.length);\n\t offset -= CodeBlock.TAB.length;\n\t if (i === 0) {\n\t index -= CodeBlock.TAB.length;\n\t } else {\n\t length -= CodeBlock.TAB.length;\n\t }\n\t }\n\t offset += line.length + 1;\n\t });\n\t this.quill.update(_quill2.default.sources.USER);\n\t this.quill.setSelection(index, length, _quill2.default.sources.SILENT);\n\t }\n\t };\n\t}\n\t\n\tfunction makeFormatHandler(format) {\n\t return {\n\t key: format[0].toUpperCase(),\n\t shortKey: true,\n\t handler: function handler(range, context) {\n\t this.quill.format(format, !context.format[format], _quill2.default.sources.USER);\n\t }\n\t };\n\t}\n\t\n\tfunction normalize(binding) {\n\t if (typeof binding === 'string' || typeof binding === 'number') {\n\t return normalize({ key: binding });\n\t }\n\t if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') {\n\t binding = (0, _clone2.default)(binding, false);\n\t }\n\t if (typeof binding.key === 'string') {\n\t if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n\t binding.key = Keyboard.keys[binding.key.toUpperCase()];\n\t } else if (binding.key.length === 1) {\n\t binding.key = binding.key.toUpperCase().charCodeAt(0);\n\t } else {\n\t return null;\n\t }\n\t }\n\t return binding;\n\t}\n\t\n\texports.default = Keyboard;\n\n/***/ },\n/* 57 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.IndentClass = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar IdentAttributor = function (_Parchment$Attributor) {\n\t _inherits(IdentAttributor, _Parchment$Attributor);\n\t\n\t function IdentAttributor() {\n\t _classCallCheck(this, IdentAttributor);\n\t\n\t return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments));\n\t }\n\t\n\t _createClass(IdentAttributor, [{\n\t key: 'add',\n\t value: function add(node, value) {\n\t if (value === '+1' || value === '-1') {\n\t var indent = this.value(node) || 0;\n\t value = value === '+1' ? indent + 1 : indent - 1;\n\t }\n\t if (value === 0) {\n\t this.remove(node);\n\t return true;\n\t } else {\n\t return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value);\n\t }\n\t }\n\t }, {\n\t key: 'value',\n\t value: function value(node) {\n\t return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN\n\t }\n\t }]);\n\t\n\t return IdentAttributor;\n\t}(_parchment2.default.Attributor.Class);\n\t\n\tvar IndentClass = new IdentAttributor('indent', 'ql-indent', {\n\t scope: _parchment2.default.Scope.BLOCK,\n\t whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n\t});\n\t\n\texports.IndentClass = IndentClass;\n\n/***/ },\n/* 58 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Blockquote = function (_Block) {\n\t _inherits(Blockquote, _Block);\n\t\n\t function Blockquote() {\n\t _classCallCheck(this, Blockquote);\n\t\n\t return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments));\n\t }\n\t\n\t return Blockquote;\n\t}(_block2.default);\n\t\n\tBlockquote.blotName = 'blockquote';\n\tBlockquote.tagName = 'blockquote';\n\t\n\texports.default = Blockquote;\n\n/***/ },\n/* 59 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Header = function (_Block) {\n\t _inherits(Header, _Block);\n\t\n\t function Header() {\n\t _classCallCheck(this, Header);\n\t\n\t return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Header, null, [{\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t return this.tagName.indexOf(domNode.tagName) + 1;\n\t }\n\t }]);\n\t\n\t return Header;\n\t}(_block2.default);\n\t\n\tHeader.blotName = 'header';\n\tHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\t\n\texports.default = Header;\n\n/***/ },\n/* 60 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.ListItem = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tvar _container = __webpack_require__(46);\n\t\n\tvar _container2 = _interopRequireDefault(_container);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ListItem = function (_Block) {\n\t _inherits(ListItem, _Block);\n\t\n\t function ListItem() {\n\t _classCallCheck(this, ListItem);\n\t\n\t return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments));\n\t }\n\t\n\t _createClass(ListItem, [{\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (name === List.blotName && !value) {\n\t this.replaceWith(_parchment2.default.create(this.statics.scope));\n\t } else {\n\t _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value);\n\t }\n\t }\n\t }, {\n\t key: 'remove',\n\t value: function remove() {\n\t if (this.prev == null && this.next == null) {\n\t this.parent.remove();\n\t } else {\n\t _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this);\n\t }\n\t }\n\t }, {\n\t key: 'replaceWith',\n\t value: function replaceWith(name, value) {\n\t this.parent.isolate(this.offset(this.parent), this.length());\n\t if (name === this.parent.statics.blotName) {\n\t this.parent.replaceWith(name, value);\n\t return this;\n\t } else {\n\t this.parent.unwrap();\n\t return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value);\n\t }\n\t }\n\t }], [{\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode);\n\t }\n\t }]);\n\t\n\t return ListItem;\n\t}(_block2.default);\n\t\n\tListItem.blotName = 'list-item';\n\tListItem.tagName = 'LI';\n\t\n\tvar List = function (_Container) {\n\t _inherits(List, _Container);\n\t\n\t function List() {\n\t _classCallCheck(this, List);\n\t\n\t return _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).apply(this, arguments));\n\t }\n\t\n\t _createClass(List, [{\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (this.children.length > 0) {\n\t this.children.tail.format(name, value);\n\t }\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats() {\n\t // We don't inherit from FormatBlot\n\t return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode));\n\t }\n\t }, {\n\t key: 'insertBefore',\n\t value: function insertBefore(blot, ref) {\n\t if (blot instanceof ListItem) {\n\t _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref);\n\t } else {\n\t var index = ref == null ? this.length() : ref.offset(this);\n\t var after = this.split(index);\n\t after.parent.insertBefore(blot, after);\n\t }\n\t }\n\t }, {\n\t key: 'optimize',\n\t value: function optimize() {\n\t _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this);\n\t var next = this.next;\n\t if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName) {\n\t next.moveChildren(this);\n\t next.remove();\n\t }\n\t }\n\t }, {\n\t key: 'replace',\n\t value: function replace(target) {\n\t if (target.statics.blotName !== this.statics.blotName) {\n\t var item = _parchment2.default.create(this.statics.defaultChild);\n\t target.moveChildren(item);\n\t this.appendChild(item);\n\t }\n\t _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target);\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create(value) {\n\t if (value === 'ordered') {\n\t value = 'OL';\n\t } else if (value === 'bullet') {\n\t value = 'UL';\n\t }\n\t return _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, value);\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t if (domNode.tagName === 'OL') return 'ordered';\n\t if (domNode.tagName === 'UL') return 'bullet';\n\t return undefined;\n\t }\n\t }]);\n\t\n\t return List;\n\t}(_container2.default);\n\t\n\tList.blotName = 'list';\n\tList.scope = _parchment2.default.Scope.BLOCK_BLOT;\n\tList.tagName = ['OL', 'UL'];\n\tList.defaultChild = 'list-item';\n\tList.allowedChildren = [ListItem];\n\t\n\texports.ListItem = ListItem;\n\texports.default = List;\n\n/***/ },\n/* 61 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Bold = function (_Inline) {\n\t _inherits(Bold, _Inline);\n\t\n\t function Bold() {\n\t _classCallCheck(this, Bold);\n\t\n\t return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Bold, [{\n\t key: 'optimize',\n\t value: function optimize() {\n\t _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this);\n\t if (this.domNode.tagName !== this.statics.tagName[0]) {\n\t this.replaceWith(this.statics.blotName);\n\t }\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create() {\n\t return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this);\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats() {\n\t return true;\n\t }\n\t }]);\n\t\n\t return Bold;\n\t}(_inline2.default);\n\t\n\tBold.blotName = 'bold';\n\tBold.tagName = ['STRONG', 'B'];\n\t\n\texports.default = Bold;\n\n/***/ },\n/* 62 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _bold = __webpack_require__(61);\n\t\n\tvar _bold2 = _interopRequireDefault(_bold);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Italic = function (_Bold) {\n\t _inherits(Italic, _Bold);\n\t\n\t function Italic() {\n\t _classCallCheck(this, Italic);\n\t\n\t return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments));\n\t }\n\t\n\t return Italic;\n\t}(_bold2.default);\n\t\n\tItalic.blotName = 'italic';\n\tItalic.tagName = ['EM', 'I'];\n\t\n\texports.default = Italic;\n\n/***/ },\n/* 63 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.sanitize = exports.default = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Link = function (_Inline) {\n\t _inherits(Link, _Inline);\n\t\n\t function Link() {\n\t _classCallCheck(this, Link);\n\t\n\t return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Link, [{\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value);\n\t value = this.constructor.sanitize(value);\n\t this.domNode.setAttribute('href', value);\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create(value) {\n\t var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value);\n\t value = this.sanitize(value);\n\t node.setAttribute('href', value);\n\t node.setAttribute('target', '_blank');\n\t return node;\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t return domNode.getAttribute('href');\n\t }\n\t }, {\n\t key: 'sanitize',\n\t value: function sanitize(url) {\n\t return _sanitize(url, ['http', 'https', 'mailto']) ? url : this.SANITIZED_URL;\n\t }\n\t }]);\n\t\n\t return Link;\n\t}(_inline2.default);\n\t\n\tLink.blotName = 'link';\n\tLink.tagName = 'A';\n\tLink.SANITIZED_URL = 'about:blank';\n\t\n\tfunction _sanitize(url, protocols) {\n\t var anchor = document.createElement('a');\n\t anchor.href = url;\n\t var protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n\t return protocols.indexOf(protocol) > -1;\n\t}\n\t\n\texports.default = Link;\n\texports.sanitize = _sanitize;\n\n/***/ },\n/* 64 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Script = function (_Inline) {\n\t _inherits(Script, _Inline);\n\t\n\t function Script() {\n\t _classCallCheck(this, Script);\n\t\n\t return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Script, null, [{\n\t key: 'create',\n\t value: function create(value) {\n\t if (value === 'super') {\n\t return document.createElement('sup');\n\t } else if (value === 'sub') {\n\t return document.createElement('sub');\n\t } else {\n\t return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value);\n\t }\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t if (domNode.tagName === 'SUB') return 'sub';\n\t if (domNode.tagName === 'SUP') return 'super';\n\t return undefined;\n\t }\n\t }]);\n\t\n\t return Script;\n\t}(_inline2.default);\n\t\n\tScript.blotName = 'script';\n\tScript.tagName = ['SUB', 'SUP'];\n\t\n\texports.default = Script;\n\n/***/ },\n/* 65 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Strike = function (_Inline) {\n\t _inherits(Strike, _Inline);\n\t\n\t function Strike() {\n\t _classCallCheck(this, Strike);\n\t\n\t return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments));\n\t }\n\t\n\t return Strike;\n\t}(_inline2.default);\n\t\n\tStrike.blotName = 'strike';\n\tStrike.tagName = 'S';\n\t\n\texports.default = Strike;\n\n/***/ },\n/* 66 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Underline = function (_Inline) {\n\t _inherits(Underline, _Inline);\n\t\n\t function Underline() {\n\t _classCallCheck(this, Underline);\n\t\n\t return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments));\n\t }\n\t\n\t return Underline;\n\t}(_inline2.default);\n\t\n\tUnderline.blotName = 'underline';\n\tUnderline.tagName = 'U';\n\t\n\texports.default = Underline;\n\n/***/ },\n/* 67 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tvar _link = __webpack_require__(63);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ATTRIBUTES = ['alt', 'height', 'width'];\n\t\n\tvar Image = function (_Embed) {\n\t _inherits(Image, _Embed);\n\t\n\t function Image() {\n\t _classCallCheck(this, Image);\n\t\n\t return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Image, [{\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (ATTRIBUTES.indexOf(name) > -1) {\n\t if (value) {\n\t this.domNode.setAttribute(name, value);\n\t } else {\n\t this.domNode.removeAttribute(name);\n\t }\n\t } else {\n\t _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value);\n\t }\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create(value) {\n\t var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value);\n\t if (typeof value === 'string') {\n\t node.setAttribute('src', this.sanitize(value));\n\t }\n\t return node;\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t return ATTRIBUTES.reduce(function (formats, attribute) {\n\t if (domNode.hasAttribute(attribute)) {\n\t formats[attribute] = domNode.getAttribute(attribute);\n\t }\n\t return formats;\n\t }, {});\n\t }\n\t }, {\n\t key: 'match',\n\t value: function match(url) {\n\t return (/\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url)\n\t );\n\t }\n\t }, {\n\t key: 'sanitize',\n\t value: function sanitize(url) {\n\t return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0';\n\t }\n\t }, {\n\t key: 'value',\n\t value: function value(domNode) {\n\t return domNode.getAttribute('src');\n\t }\n\t }]);\n\t\n\t return Image;\n\t}(_embed2.default);\n\t\n\tImage.blotName = 'image';\n\tImage.tagName = 'IMG';\n\t\n\texports.default = Image;\n\n/***/ },\n/* 68 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _link = __webpack_require__(63);\n\t\n\tvar _link2 = _interopRequireDefault(_link);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ATTRIBUTES = ['height', 'width'];\n\t\n\tvar Video = function (_BlockEmbed) {\n\t _inherits(Video, _BlockEmbed);\n\t\n\t function Video() {\n\t _classCallCheck(this, Video);\n\t\n\t return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Video, [{\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (ATTRIBUTES.indexOf(name) > -1) {\n\t if (value) {\n\t this.domNode.setAttribute(name, value);\n\t } else {\n\t this.domNode.removeAttribute(name);\n\t }\n\t } else {\n\t _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value);\n\t }\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create(value) {\n\t var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value);\n\t node.setAttribute('frameborder', '0');\n\t node.setAttribute('allowfullscreen', true);\n\t node.setAttribute('src', this.sanitize(value));\n\t return node;\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t return ATTRIBUTES.reduce(function (formats, attribute) {\n\t if (domNode.hasAttribute(attribute)) {\n\t formats[attribute] = domNode.getAttribute(attribute);\n\t }\n\t return formats;\n\t }, {});\n\t }\n\t }, {\n\t key: 'sanitize',\n\t value: function sanitize(url) {\n\t return _link2.default.sanitize(url);\n\t }\n\t }, {\n\t key: 'value',\n\t value: function value(domNode) {\n\t return domNode.getAttribute('src');\n\t }\n\t }]);\n\t\n\t return Video;\n\t}(_block.BlockEmbed);\n\t\n\tVideo.blotName = 'video';\n\tVideo.className = 'ql-video';\n\tVideo.tagName = 'IFRAME';\n\t\n\texports.default = Video;\n\n/***/ },\n/* 69 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.FormulaBlot = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar FormulaBlot = function (_Embed) {\n\t _inherits(FormulaBlot, _Embed);\n\t\n\t function FormulaBlot() {\n\t _classCallCheck(this, FormulaBlot);\n\t\n\t return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments));\n\t }\n\t\n\t _createClass(FormulaBlot, [{\n\t key: 'index',\n\t value: function index() {\n\t return 1;\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create(value) {\n\t var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value);\n\t if (typeof value === 'string') {\n\t window.katex.render(value, node);\n\t node.setAttribute('data-value', value);\n\t }\n\t node.setAttribute('contenteditable', false);\n\t return node;\n\t }\n\t }, {\n\t key: 'value',\n\t value: function value(domNode) {\n\t return domNode.getAttribute('data-value');\n\t }\n\t }]);\n\t\n\t return FormulaBlot;\n\t}(_embed2.default);\n\t\n\tFormulaBlot.blotName = 'formula';\n\tFormulaBlot.className = 'ql-formula';\n\tFormulaBlot.tagName = 'SPAN';\n\t\n\tfunction Formula() {\n\t if (window.katex == null) {\n\t throw new Error('Formula module requires KaTeX.');\n\t }\n\t _quill2.default.register(FormulaBlot, true);\n\t}\n\t\n\texports.FormulaBlot = FormulaBlot;\n\texports.default = Formula;\n\n/***/ },\n/* 70 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.CodeToken = exports.CodeBlock = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tvar _module = __webpack_require__(43);\n\t\n\tvar _module2 = _interopRequireDefault(_module);\n\t\n\tvar _code = __webpack_require__(28);\n\t\n\tvar _code2 = _interopRequireDefault(_code);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar SyntaxCodeBlock = function (_CodeBlock) {\n\t _inherits(SyntaxCodeBlock, _CodeBlock);\n\t\n\t function SyntaxCodeBlock() {\n\t _classCallCheck(this, SyntaxCodeBlock);\n\t\n\t return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments));\n\t }\n\t\n\t _createClass(SyntaxCodeBlock, [{\n\t key: 'replaceWith',\n\t value: function replaceWith(block) {\n\t this.domNode.textContent = this.domNode.textContent;\n\t this.attach();\n\t _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block);\n\t }\n\t }, {\n\t key: 'highlight',\n\t value: function highlight(_highlight) {\n\t if (this.cachedHTML !== this.domNode.innerHTML) {\n\t var text = this.domNode.textContent;\n\t if (text.trim().length > 0 || this.cachedHTML == null) {\n\t this.domNode.innerHTML = _highlight(text);\n\t this.attach();\n\t }\n\t this.cachedHTML = this.domNode.innerHTML;\n\t }\n\t }\n\t }]);\n\t\n\t return SyntaxCodeBlock;\n\t}(_code2.default);\n\t\n\tSyntaxCodeBlock.className = 'ql-syntax';\n\t\n\tvar CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', {\n\t scope: _parchment2.default.Scope.INLINE\n\t});\n\t\n\tvar Syntax = function (_Module) {\n\t _inherits(Syntax, _Module);\n\t\n\t function Syntax(quill, options) {\n\t _classCallCheck(this, Syntax);\n\t\n\t var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options));\n\t\n\t if (typeof _this2.options.highlight !== 'function') {\n\t throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');\n\t }\n\t _quill2.default.register(CodeToken, true);\n\t _quill2.default.register(SyntaxCodeBlock, true);\n\t var timer = null;\n\t _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {\n\t if (timer != null) return;\n\t timer = setTimeout(function () {\n\t _this2.highlight();\n\t timer = null;\n\t }, 100);\n\t });\n\t _this2.highlight();\n\t return _this2;\n\t }\n\t\n\t _createClass(Syntax, [{\n\t key: 'highlight',\n\t value: function highlight() {\n\t var _this3 = this;\n\t\n\t if (this.quill.selection.composing) return;\n\t var range = this.quill.getSelection();\n\t this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) {\n\t code.highlight(_this3.options.highlight);\n\t });\n\t this.quill.update(_quill2.default.sources.SILENT);\n\t if (range != null) {\n\t this.quill.setSelection(range, _quill2.default.sources.SILENT);\n\t }\n\t }\n\t }]);\n\t\n\t return Syntax;\n\t}(_module2.default);\n\t\n\tSyntax.DEFAULTS = {\n\t highlight: function () {\n\t if (window.hljs == null) return null;\n\t return function (text) {\n\t var result = window.hljs.highlightAuto(text);\n\t return result.value;\n\t };\n\t }()\n\t};\n\t\n\texports.CodeBlock = SyntaxCodeBlock;\n\texports.CodeToken = CodeToken;\n\texports.default = Syntax;\n\n/***/ },\n/* 71 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.addControls = exports.default = undefined;\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tvar _logger = __webpack_require__(38);\n\t\n\tvar _logger2 = _interopRequireDefault(_logger);\n\t\n\tvar _module = __webpack_require__(43);\n\t\n\tvar _module2 = _interopRequireDefault(_module);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar debug = (0, _logger2.default)('quill:toolbar');\n\t\n\tvar Toolbar = function (_Module) {\n\t _inherits(Toolbar, _Module);\n\t\n\t function Toolbar(quill, options) {\n\t _classCallCheck(this, Toolbar);\n\t\n\t var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options));\n\t\n\t if (Array.isArray(_this.options.container)) {\n\t var container = document.createElement('div');\n\t addControls(container, _this.options.container);\n\t quill.container.parentNode.insertBefore(container, quill.container);\n\t _this.container = container;\n\t } else if (typeof _this.options.container === 'string') {\n\t _this.container = document.querySelector(_this.options.container);\n\t } else {\n\t _this.container = _this.options.container;\n\t }\n\t if (!(_this.container instanceof HTMLElement)) {\n\t var _ret;\n\t\n\t return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret);\n\t }\n\t _this.container.classList.add('ql-toolbar');\n\t _this.controls = [];\n\t _this.handlers = {};\n\t Object.keys(_this.options.handlers).forEach(function (format) {\n\t _this.addHandler(format, _this.options.handlers[format]);\n\t });\n\t [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) {\n\t _this.attach(input);\n\t });\n\t _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) {\n\t if (type === _quill2.default.events.SELECTION_CHANGE) {\n\t _this.update(range);\n\t }\n\t });\n\t _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {\n\t var _this$quill$selection = _this.quill.selection.getRange(),\n\t _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1),\n\t range = _this$quill$selection2[0]; // quill.getSelection triggers update\n\t\n\t\n\t _this.update(range);\n\t });\n\t return _this;\n\t }\n\t\n\t _createClass(Toolbar, [{\n\t key: 'addHandler',\n\t value: function addHandler(format, handler) {\n\t this.handlers[format] = handler;\n\t }\n\t }, {\n\t key: 'attach',\n\t value: function attach(input) {\n\t var _this2 = this;\n\t\n\t var format = [].find.call(input.classList, function (className) {\n\t return className.indexOf('ql-') === 0;\n\t });\n\t if (!format) return;\n\t format = format.slice('ql-'.length);\n\t if (input.tagName === 'BUTTON') {\n\t input.setAttribute('type', 'button');\n\t }\n\t if (this.handlers[format] == null) {\n\t if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n\t debug.warn('ignoring attaching to disabled format', format, input);\n\t return;\n\t }\n\t if (_parchment2.default.query(format) == null) {\n\t debug.warn('ignoring attaching to nonexistent format', format, input);\n\t return;\n\t }\n\t }\n\t var eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n\t input.addEventListener(eventName, function (e) {\n\t var value = void 0;\n\t if (input.tagName === 'SELECT') {\n\t if (input.selectedIndex < 0) return;\n\t var selected = input.options[input.selectedIndex];\n\t if (selected.hasAttribute('selected')) {\n\t value = false;\n\t } else {\n\t value = selected.value || false;\n\t }\n\t } else {\n\t if (input.classList.contains('ql-active')) {\n\t value = false;\n\t } else {\n\t value = input.value || !input.hasAttribute('value');\n\t }\n\t e.preventDefault();\n\t }\n\t _this2.quill.focus();\n\t\n\t var _quill$selection$getR = _this2.quill.selection.getRange(),\n\t _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1),\n\t range = _quill$selection$getR2[0];\n\t\n\t if (_this2.handlers[format] != null) {\n\t _this2.handlers[format].call(_this2, value);\n\t } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) {\n\t value = prompt('Enter ' + format);\n\t if (!value) return;\n\t _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER);\n\t } else {\n\t _this2.quill.format(format, value, _quill2.default.sources.USER);\n\t }\n\t _this2.update(range);\n\t });\n\t // TODO use weakmap\n\t this.controls.push([format, input]);\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update(range) {\n\t var formats = range == null ? {} : this.quill.getFormat(range);\n\t this.controls.forEach(function (pair) {\n\t var _pair = _slicedToArray(pair, 2),\n\t format = _pair[0],\n\t input = _pair[1];\n\t\n\t if (input.tagName === 'SELECT') {\n\t var option = void 0;\n\t if (range == null) {\n\t option = null;\n\t } else if (formats[format] == null) {\n\t option = input.querySelector('option[selected]');\n\t } else if (!Array.isArray(formats[format])) {\n\t var value = formats[format];\n\t if (typeof value === 'string') {\n\t value = value.replace(/\\\"/g, '\\\\\"');\n\t }\n\t option = input.querySelector('option[value=\"' + value + '\"]');\n\t }\n\t if (option == null) {\n\t input.value = ''; // TODO make configurable?\n\t input.selectedIndex = -1;\n\t } else {\n\t option.selected = true;\n\t }\n\t } else {\n\t if (range == null) {\n\t input.classList.remove('ql-active');\n\t } else if (input.hasAttribute('value')) {\n\t // both being null should match (default values)\n\t // '1' should match with 1 (headers)\n\t var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value');\n\t input.classList.toggle('ql-active', isActive);\n\t } else {\n\t input.classList.toggle('ql-active', formats[format] != null);\n\t }\n\t }\n\t });\n\t }\n\t }]);\n\t\n\t return Toolbar;\n\t}(_module2.default);\n\t\n\tToolbar.DEFAULTS = {};\n\t\n\tfunction addButton(container, format, value) {\n\t var input = document.createElement('button');\n\t input.setAttribute('type', 'button');\n\t input.classList.add('ql-' + format);\n\t if (value != null) {\n\t input.value = value;\n\t }\n\t container.appendChild(input);\n\t}\n\t\n\tfunction addControls(container, groups) {\n\t if (!Array.isArray(groups[0])) {\n\t groups = [groups];\n\t }\n\t groups.forEach(function (controls) {\n\t var group = document.createElement('span');\n\t group.classList.add('ql-formats');\n\t controls.forEach(function (control) {\n\t if (typeof control === 'string') {\n\t addButton(group, control);\n\t } else {\n\t var format = Object.keys(control)[0];\n\t var value = control[format];\n\t if (Array.isArray(value)) {\n\t addSelect(group, format, value);\n\t } else {\n\t addButton(group, format, value);\n\t }\n\t }\n\t });\n\t container.appendChild(group);\n\t });\n\t}\n\t\n\tfunction addSelect(container, format, values) {\n\t var input = document.createElement('select');\n\t input.classList.add('ql-' + format);\n\t values.forEach(function (value) {\n\t var option = document.createElement('option');\n\t if (value !== false) {\n\t option.setAttribute('value', value);\n\t } else {\n\t option.setAttribute('selected', 'selected');\n\t }\n\t input.appendChild(option);\n\t });\n\t container.appendChild(input);\n\t}\n\t\n\tToolbar.DEFAULTS = {\n\t container: null,\n\t handlers: {\n\t clean: function clean() {\n\t var _this3 = this;\n\t\n\t var range = this.quill.getSelection();\n\t if (range == null) return;\n\t if (range.length == 0) {\n\t var formats = this.quill.getFormat();\n\t Object.keys(formats).forEach(function (name) {\n\t // Clean functionality in existing apps only clean inline formats\n\t if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) {\n\t _this3.quill.format(name, false);\n\t }\n\t });\n\t } else {\n\t this.quill.removeFormat(range, _quill2.default.sources.USER);\n\t }\n\t },\n\t direction: function direction(value) {\n\t var align = this.quill.getFormat()['align'];\n\t if (value === 'rtl' && align == null) {\n\t this.quill.format('align', 'right', _quill2.default.sources.USER);\n\t } else if (!value && align === 'right') {\n\t this.quill.format('align', false, _quill2.default.sources.USER);\n\t }\n\t this.quill.format('direction', value, _quill2.default.sources.USER);\n\t },\n\t link: function link(value) {\n\t if (value === true) {\n\t value = prompt('Enter link URL:');\n\t }\n\t this.quill.format('link', value, _quill2.default.sources.USER);\n\t },\n\t indent: function indent(value) {\n\t var range = this.quill.getSelection();\n\t var formats = this.quill.getFormat(range);\n\t var indent = parseInt(formats.indent || 0);\n\t if (value === '+1' || value === '-1') {\n\t var modifier = value === '+1' ? 1 : -1;\n\t if (formats.direction === 'rtl') modifier *= -1;\n\t this.quill.format('indent', indent + modifier, _quill2.default.sources.USER);\n\t }\n\t }\n\t }\n\t};\n\t\n\texports.default = Toolbar;\n\texports.addControls = addControls;\n\n/***/ },\n/* 72 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t 'align': {\n\t '': __webpack_require__(73),\n\t 'center': __webpack_require__(74),\n\t 'right': __webpack_require__(75),\n\t 'justify': __webpack_require__(76)\n\t },\n\t 'background': __webpack_require__(77),\n\t 'blockquote': __webpack_require__(78),\n\t 'bold': __webpack_require__(79),\n\t 'clean': __webpack_require__(80),\n\t 'code': __webpack_require__(81),\n\t 'code-block': __webpack_require__(81),\n\t 'color': __webpack_require__(82),\n\t 'direction': {\n\t '': __webpack_require__(83),\n\t 'rtl': __webpack_require__(84)\n\t },\n\t 'float': {\n\t 'center': __webpack_require__(85),\n\t 'full': __webpack_require__(86),\n\t 'left': __webpack_require__(87),\n\t 'right': __webpack_require__(88)\n\t },\n\t 'formula': __webpack_require__(89),\n\t 'header': {\n\t '1': __webpack_require__(90),\n\t '2': __webpack_require__(91)\n\t },\n\t 'italic': __webpack_require__(92),\n\t 'image': __webpack_require__(93),\n\t 'indent': {\n\t '+1': __webpack_require__(94),\n\t '-1': __webpack_require__(95)\n\t },\n\t 'link': __webpack_require__(96),\n\t 'list': {\n\t 'ordered': __webpack_require__(97),\n\t 'bullet': __webpack_require__(98)\n\t },\n\t 'script': {\n\t 'sub': __webpack_require__(99),\n\t 'super': __webpack_require__(100)\n\t },\n\t 'strike': __webpack_require__(101),\n\t 'underline': __webpack_require__(102),\n\t 'video': __webpack_require__(103)\n\t};\n\n/***/ },\n/* 73 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 74 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 75 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 76 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 77 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 78 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 79 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 80 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 81 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 82 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 83 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 84 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 85 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 86 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 87 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 88 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 89 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 90 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 91 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 92 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 93 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 94 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 95 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 96 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 97 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 98 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 99 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 100 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 101 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 102 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 103 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 104 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _dropdown = __webpack_require__(105);\n\t\n\tvar _dropdown2 = _interopRequireDefault(_dropdown);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Picker = function () {\n\t function Picker(select) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Picker);\n\t\n\t this.select = select;\n\t this.container = document.createElement('span');\n\t this.buildPicker();\n\t this.select.style.display = 'none';\n\t this.select.parentNode.insertBefore(this.container, this.select);\n\t this.label.addEventListener('click', function () {\n\t _this.container.classList.toggle('ql-expanded');\n\t });\n\t this.select.addEventListener('change', this.update.bind(this));\n\t }\n\t\n\t _createClass(Picker, [{\n\t key: 'buildItem',\n\t value: function buildItem(option) {\n\t var _this2 = this;\n\t\n\t var item = document.createElement('span');\n\t item.classList.add('ql-picker-item');\n\t if (option.hasAttribute('value')) {\n\t item.setAttribute('data-value', option.getAttribute('value'));\n\t }\n\t if (option.textContent) {\n\t item.setAttribute('data-label', option.textContent);\n\t }\n\t item.addEventListener('click', function () {\n\t _this2.selectItem(item, true);\n\t });\n\t return item;\n\t }\n\t }, {\n\t key: 'buildLabel',\n\t value: function buildLabel() {\n\t var label = document.createElement('span');\n\t label.classList.add('ql-picker-label');\n\t label.innerHTML = _dropdown2.default;\n\t this.container.appendChild(label);\n\t return label;\n\t }\n\t }, {\n\t key: 'buildOptions',\n\t value: function buildOptions() {\n\t var _this3 = this;\n\t\n\t var options = document.createElement('span');\n\t options.classList.add('ql-picker-options');\n\t [].slice.call(this.select.options).forEach(function (option) {\n\t var item = _this3.buildItem(option);\n\t options.appendChild(item);\n\t if (option.hasAttribute('selected')) {\n\t _this3.selectItem(item);\n\t }\n\t });\n\t this.container.appendChild(options);\n\t }\n\t }, {\n\t key: 'buildPicker',\n\t value: function buildPicker() {\n\t var _this4 = this;\n\t\n\t [].slice.call(this.select.attributes).forEach(function (item) {\n\t _this4.container.setAttribute(item.name, item.value);\n\t });\n\t this.container.classList.add('ql-picker');\n\t this.label = this.buildLabel();\n\t this.buildOptions();\n\t }\n\t }, {\n\t key: 'close',\n\t value: function close() {\n\t this.container.classList.remove('ql-expanded');\n\t }\n\t }, {\n\t key: 'selectItem',\n\t value: function selectItem(item) {\n\t var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\t\n\t var selected = this.container.querySelector('.ql-selected');\n\t if (item === selected) return;\n\t if (selected != null) {\n\t selected.classList.remove('ql-selected');\n\t }\n\t if (item != null) {\n\t item.classList.add('ql-selected');\n\t this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);\n\t if (item.hasAttribute('data-value')) {\n\t this.label.setAttribute('data-value', item.getAttribute('data-value'));\n\t } else {\n\t this.label.removeAttribute('data-value');\n\t }\n\t if (item.hasAttribute('data-label')) {\n\t this.label.setAttribute('data-label', item.getAttribute('data-label'));\n\t } else {\n\t this.label.removeAttribute('data-label');\n\t }\n\t if (trigger) {\n\t if (typeof Event === 'function') {\n\t this.select.dispatchEvent(new Event('change'));\n\t } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') {\n\t // IE11\n\t var event = document.createEvent('Event');\n\t event.initEvent('change', true, true);\n\t this.select.dispatchEvent(event);\n\t }\n\t this.close();\n\t }\n\t } else {\n\t this.label.removeAttribute('data-value');\n\t this.label.removeAttribute('data-label');\n\t }\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update() {\n\t var option = void 0;\n\t if (this.select.selectedIndex > -1) {\n\t var item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex];\n\t option = this.select.options[this.select.selectedIndex];\n\t this.selectItem(item);\n\t } else {\n\t this.selectItem(null);\n\t }\n\t var isActive = option != null && option !== this.select.querySelector('option[selected]');\n\t this.label.classList.toggle('ql-active', isActive);\n\t }\n\t }]);\n\t\n\t return Picker;\n\t}();\n\t\n\texports.default = Picker;\n\n/***/ },\n/* 105 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 106 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _picker = __webpack_require__(104);\n\t\n\tvar _picker2 = _interopRequireDefault(_picker);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ColorPicker = function (_Picker) {\n\t _inherits(ColorPicker, _Picker);\n\t\n\t function ColorPicker(select, label) {\n\t _classCallCheck(this, ColorPicker);\n\t\n\t var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select));\n\t\n\t _this.label.innerHTML = label;\n\t _this.container.classList.add('ql-color-picker');\n\t [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) {\n\t item.classList.add('ql-primary');\n\t });\n\t return _this;\n\t }\n\t\n\t _createClass(ColorPicker, [{\n\t key: 'buildItem',\n\t value: function buildItem(option) {\n\t var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option);\n\t item.style.backgroundColor = option.getAttribute('value') || '';\n\t return item;\n\t }\n\t }, {\n\t key: 'selectItem',\n\t value: function selectItem(item, trigger) {\n\t _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger);\n\t var colorLabel = this.label.querySelector('.ql-color-label');\n\t var value = item ? item.getAttribute('data-value') || '' : '';\n\t if (colorLabel) {\n\t if (colorLabel.tagName === 'line') {\n\t colorLabel.style.stroke = value;\n\t } else {\n\t colorLabel.style.fill = value;\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return ColorPicker;\n\t}(_picker2.default);\n\t\n\texports.default = ColorPicker;\n\n/***/ },\n/* 107 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _picker = __webpack_require__(104);\n\t\n\tvar _picker2 = _interopRequireDefault(_picker);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar IconPicker = function (_Picker) {\n\t _inherits(IconPicker, _Picker);\n\t\n\t function IconPicker(select, icons) {\n\t _classCallCheck(this, IconPicker);\n\t\n\t var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select));\n\t\n\t _this.container.classList.add('ql-icon-picker');\n\t [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) {\n\t item.innerHTML = icons[item.getAttribute('data-value') || ''];\n\t });\n\t _this.defaultItem = _this.container.querySelector('.ql-selected');\n\t _this.selectItem(_this.defaultItem);\n\t return _this;\n\t }\n\t\n\t _createClass(IconPicker, [{\n\t key: 'selectItem',\n\t value: function selectItem(item, trigger) {\n\t _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger);\n\t item = item || this.defaultItem;\n\t this.label.innerHTML = item.innerHTML;\n\t }\n\t }]);\n\t\n\t return IconPicker;\n\t}(_picker2.default);\n\t\n\texports.default = IconPicker;\n\n/***/ },\n/* 108 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Tooltip = function () {\n\t function Tooltip(quill, boundsContainer) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Tooltip);\n\t\n\t this.quill = quill;\n\t this.boundsContainer = boundsContainer || document.body;\n\t this.root = quill.addContainer('ql-tooltip');\n\t this.root.innerHTML = this.constructor.TEMPLATE;\n\t var offset = parseInt(window.getComputedStyle(this.root).marginTop);\n\t this.quill.root.addEventListener('scroll', function () {\n\t _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + offset + 'px';\n\t _this.checkBounds();\n\t });\n\t this.hide();\n\t }\n\t\n\t _createClass(Tooltip, [{\n\t key: 'checkBounds',\n\t value: function checkBounds() {\n\t this.root.classList.toggle('ql-out-top', this.root.offsetTop <= 0);\n\t this.root.classList.remove('ql-out-bottom');\n\t this.root.classList.toggle('ql-out-bottom', this.root.offsetTop + this.root.offsetHeight >= this.quill.root.offsetHeight);\n\t }\n\t }, {\n\t key: 'hide',\n\t value: function hide() {\n\t this.root.classList.add('ql-hidden');\n\t }\n\t }, {\n\t key: 'position',\n\t value: function position(reference) {\n\t var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n\t var top = reference.bottom + this.quill.root.scrollTop;\n\t this.root.style.left = left + 'px';\n\t this.root.style.top = top + 'px';\n\t var containerBounds = this.boundsContainer.getBoundingClientRect();\n\t var rootBounds = this.root.getBoundingClientRect();\n\t var shift = 0;\n\t if (rootBounds.right > containerBounds.right) {\n\t shift = containerBounds.right - rootBounds.right;\n\t this.root.style.left = left + shift + 'px';\n\t }\n\t if (rootBounds.left < containerBounds.left) {\n\t shift = containerBounds.left - rootBounds.left;\n\t this.root.style.left = left + shift + 'px';\n\t }\n\t this.checkBounds();\n\t return shift;\n\t }\n\t }, {\n\t key: 'show',\n\t value: function show() {\n\t this.root.classList.remove('ql-editing');\n\t this.root.classList.remove('ql-hidden');\n\t }\n\t }]);\n\t\n\t return Tooltip;\n\t}();\n\t\n\texports.default = Tooltip;\n\n/***/ },\n/* 109 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.BubbleTooltip = undefined;\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _emitter = __webpack_require__(36);\n\t\n\tvar _emitter2 = _interopRequireDefault(_emitter);\n\t\n\tvar _base = __webpack_require__(110);\n\t\n\tvar _base2 = _interopRequireDefault(_base);\n\t\n\tvar _selection = __webpack_require__(44);\n\t\n\tvar _icons = __webpack_require__(72);\n\t\n\tvar _icons2 = _interopRequireDefault(_icons);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']];\n\t\n\tvar BubbleTheme = function (_BaseTheme) {\n\t _inherits(BubbleTheme, _BaseTheme);\n\t\n\t function BubbleTheme(quill, options) {\n\t _classCallCheck(this, BubbleTheme);\n\t\n\t if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n\t options.modules.toolbar.container = TOOLBAR_CONFIG;\n\t }\n\t\n\t var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options));\n\t\n\t _this.quill.container.classList.add('ql-bubble');\n\t return _this;\n\t }\n\t\n\t _createClass(BubbleTheme, [{\n\t key: 'extendToolbar',\n\t value: function extendToolbar(toolbar) {\n\t this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n\t this.tooltip.root.appendChild(toolbar.container);\n\t this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);\n\t this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);\n\t }\n\t }]);\n\t\n\t return BubbleTheme;\n\t}(_base2.default);\n\t\n\tBubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {\n\t modules: {\n\t toolbar: {\n\t handlers: {\n\t link: function link(value) {\n\t if (!value) {\n\t this.quill.format('link', false);\n\t } else {\n\t this.quill.theme.tooltip.edit();\n\t }\n\t }\n\t }\n\t }\n\t }\n\t});\n\t\n\tvar BubbleTooltip = function (_BaseTooltip) {\n\t _inherits(BubbleTooltip, _BaseTooltip);\n\t\n\t function BubbleTooltip(quill, bounds) {\n\t _classCallCheck(this, BubbleTooltip);\n\t\n\t var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds));\n\t\n\t _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range) {\n\t if (type !== _emitter2.default.events.SELECTION_CHANGE) return;\n\t if (range != null && range.length > 0) {\n\t _this2.show();\n\t // Lock our width so we will expand beyond our offsetParent boundaries\n\t _this2.root.style.left = '0px';\n\t _this2.root.style.width = '';\n\t _this2.root.style.width = _this2.root.offsetWidth + 'px';\n\t var lines = _this2.quill.scroll.lines(range.index, range.length);\n\t if (lines.length === 1) {\n\t _this2.position(_this2.quill.getBounds(range));\n\t } else {\n\t var lastLine = lines[lines.length - 1];\n\t var index = lastLine.offset(_this2.quill.scroll);\n\t var length = Math.min(lastLine.length() - 1, range.index + range.length - index);\n\t var _bounds = _this2.quill.getBounds(new _selection.Range(index, length));\n\t _this2.position(_bounds);\n\t }\n\t } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) {\n\t _this2.hide();\n\t }\n\t });\n\t return _this2;\n\t }\n\t\n\t _createClass(BubbleTooltip, [{\n\t key: 'listen',\n\t value: function listen() {\n\t var _this3 = this;\n\t\n\t _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this);\n\t this.root.querySelector('.ql-close').addEventListener('click', function () {\n\t _this3.root.classList.remove('ql-editing');\n\t });\n\t this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () {\n\t // Let selection be restored by toolbar handlers before repositioning\n\t setTimeout(function () {\n\t if (_this3.root.classList.contains('ql-hidden')) return;\n\t var range = _this3.quill.getSelection();\n\t if (range != null) {\n\t _this3.position(_this3.quill.getBounds(range));\n\t }\n\t }, 1);\n\t });\n\t }\n\t }, {\n\t key: 'cancel',\n\t value: function cancel() {\n\t this.show();\n\t }\n\t }, {\n\t key: 'position',\n\t value: function position(reference) {\n\t var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference);\n\t var arrow = this.root.querySelector('.ql-tooltip-arrow');\n\t arrow.style.marginLeft = '';\n\t if (shift === 0) return shift;\n\t arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px';\n\t }\n\t }]);\n\t\n\t return BubbleTooltip;\n\t}(_base.BaseTooltip);\n\t\n\tBubbleTooltip.TEMPLATE = ['', '
    ', '', '', '
    '].join('');\n\t\n\texports.BubbleTooltip = BubbleTooltip;\n\texports.default = BubbleTheme;\n\n/***/ },\n/* 110 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.BaseTooltip = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _emitter = __webpack_require__(36);\n\t\n\tvar _emitter2 = _interopRequireDefault(_emitter);\n\t\n\tvar _keyboard = __webpack_require__(56);\n\t\n\tvar _keyboard2 = _interopRequireDefault(_keyboard);\n\t\n\tvar _theme = __webpack_require__(45);\n\t\n\tvar _theme2 = _interopRequireDefault(_theme);\n\t\n\tvar _colorPicker = __webpack_require__(106);\n\t\n\tvar _colorPicker2 = _interopRequireDefault(_colorPicker);\n\t\n\tvar _iconPicker = __webpack_require__(107);\n\t\n\tvar _iconPicker2 = _interopRequireDefault(_iconPicker);\n\t\n\tvar _picker = __webpack_require__(104);\n\t\n\tvar _picker2 = _interopRequireDefault(_picker);\n\t\n\tvar _tooltip = __webpack_require__(108);\n\t\n\tvar _tooltip2 = _interopRequireDefault(_tooltip);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ALIGNS = [false, 'center', 'right', 'justify'];\n\t\n\tvar 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\"];\n\t\n\tvar FONTS = [false, 'serif', 'monospace'];\n\t\n\tvar HEADERS = ['1', '2', '3', false];\n\t\n\tvar SIZES = ['small', false, 'large', 'huge'];\n\t\n\tvar BaseTheme = function (_Theme) {\n\t _inherits(BaseTheme, _Theme);\n\t\n\t function BaseTheme(quill, options) {\n\t _classCallCheck(this, BaseTheme);\n\t\n\t var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options));\n\t\n\t var listener = function listener(e) {\n\t if (!document.body.contains(quill.root)) {\n\t return document.body.removeEventListener('click', listener);\n\t }\n\t if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) {\n\t _this.tooltip.hide();\n\t }\n\t if (_this.pickers != null) {\n\t _this.pickers.forEach(function (picker) {\n\t if (!picker.container.contains(e.target)) {\n\t picker.close();\n\t }\n\t });\n\t }\n\t };\n\t document.body.addEventListener('click', listener);\n\t return _this;\n\t }\n\t\n\t _createClass(BaseTheme, [{\n\t key: 'addModule',\n\t value: function addModule(name) {\n\t var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name);\n\t if (name === 'toolbar') {\n\t this.extendToolbar(module);\n\t }\n\t return module;\n\t }\n\t }, {\n\t key: 'buildButtons',\n\t value: function buildButtons(buttons, icons) {\n\t buttons.forEach(function (button) {\n\t var className = button.getAttribute('class') || '';\n\t className.split(/\\s+/).forEach(function (name) {\n\t if (!name.startsWith('ql-')) return;\n\t name = name.slice('ql-'.length);\n\t if (icons[name] == null) return;\n\t if (name === 'direction') {\n\t button.innerHTML = icons[name][''] + icons[name]['rtl'];\n\t } else if (typeof icons[name] === 'string') {\n\t button.innerHTML = icons[name];\n\t } else {\n\t var value = button.value || '';\n\t if (value != null && icons[name][value]) {\n\t button.innerHTML = icons[name][value];\n\t }\n\t }\n\t });\n\t });\n\t }\n\t }, {\n\t key: 'buildPickers',\n\t value: function buildPickers(selects, icons) {\n\t var _this2 = this;\n\t\n\t this.pickers = selects.map(function (select) {\n\t if (select.classList.contains('ql-align')) {\n\t if (select.querySelector('option') == null) {\n\t fillSelect(select, ALIGNS);\n\t }\n\t return new _iconPicker2.default(select, icons.align);\n\t } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {\n\t var format = select.classList.contains('ql-background') ? 'background' : 'color';\n\t if (select.querySelector('option') == null) {\n\t fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');\n\t }\n\t return new _colorPicker2.default(select, icons[format]);\n\t } else {\n\t if (select.querySelector('option') == null) {\n\t if (select.classList.contains('ql-font')) {\n\t fillSelect(select, FONTS);\n\t } else if (select.classList.contains('ql-header')) {\n\t fillSelect(select, HEADERS);\n\t } else if (select.classList.contains('ql-size')) {\n\t fillSelect(select, SIZES);\n\t }\n\t }\n\t return new _picker2.default(select);\n\t }\n\t });\n\t var update = function update() {\n\t _this2.pickers.forEach(function (picker) {\n\t picker.update();\n\t });\n\t };\n\t this.quill.on(_emitter2.default.events.SELECTION_CHANGE, update).on(_emitter2.default.events.SCROLL_OPTIMIZE, update);\n\t }\n\t }]);\n\t\n\t return BaseTheme;\n\t}(_theme2.default);\n\t\n\tBaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, {\n\t modules: {\n\t toolbar: {\n\t handlers: {\n\t formula: function formula() {\n\t this.quill.theme.tooltip.edit('formula');\n\t },\n\t image: function image() {\n\t var _this3 = this;\n\t\n\t var fileInput = this.container.querySelector('input.ql-image[type=file]');\n\t if (fileInput == null) {\n\t fileInput = document.createElement('input');\n\t fileInput.setAttribute('type', 'file');\n\t fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon, image/svg+xml');\n\t fileInput.classList.add('ql-image');\n\t fileInput.addEventListener('change', function () {\n\t if (fileInput.files != null && fileInput.files[0] != null) {\n\t var reader = new FileReader();\n\t reader.onload = function (e) {\n\t var range = _this3.quill.getSelection(true);\n\t _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER);\n\t fileInput.value = \"\";\n\t };\n\t reader.readAsDataURL(fileInput.files[0]);\n\t }\n\t });\n\t this.container.appendChild(fileInput);\n\t }\n\t fileInput.click();\n\t },\n\t video: function video() {\n\t this.quill.theme.tooltip.edit('video');\n\t }\n\t }\n\t }\n\t }\n\t});\n\t\n\tvar BaseTooltip = function (_Tooltip) {\n\t _inherits(BaseTooltip, _Tooltip);\n\t\n\t function BaseTooltip(quill, boundsContainer) {\n\t _classCallCheck(this, BaseTooltip);\n\t\n\t var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer));\n\t\n\t _this4.textbox = _this4.root.querySelector('input[type=\"text\"]');\n\t _this4.listen();\n\t return _this4;\n\t }\n\t\n\t _createClass(BaseTooltip, [{\n\t key: 'listen',\n\t value: function listen() {\n\t var _this5 = this;\n\t\n\t this.textbox.addEventListener('keydown', function (event) {\n\t if (_keyboard2.default.match(event, 'enter')) {\n\t _this5.save();\n\t event.preventDefault();\n\t } else if (_keyboard2.default.match(event, 'escape')) {\n\t _this5.cancel();\n\t event.preventDefault();\n\t }\n\t });\n\t }\n\t }, {\n\t key: 'cancel',\n\t value: function cancel() {\n\t this.hide();\n\t }\n\t }, {\n\t key: 'edit',\n\t value: function edit() {\n\t var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link';\n\t var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\t\n\t this.root.classList.remove('ql-hidden');\n\t this.root.classList.add('ql-editing');\n\t if (preview != null) {\n\t this.textbox.value = preview;\n\t } else if (mode !== this.root.getAttribute('data-mode')) {\n\t this.textbox.value = '';\n\t }\n\t this.position(this.quill.getBounds(this.quill.selection.savedRange));\n\t this.textbox.select();\n\t this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || '');\n\t this.root.setAttribute('data-mode', mode);\n\t }\n\t }, {\n\t key: 'restoreFocus',\n\t value: function restoreFocus() {\n\t var scrollTop = this.quill.root.scrollTop;\n\t this.quill.focus();\n\t this.quill.root.scrollTop = scrollTop;\n\t }\n\t }, {\n\t key: 'save',\n\t value: function save() {\n\t var value = this.textbox.value;\n\t switch (this.root.getAttribute('data-mode')) {\n\t case 'link':\n\t {\n\t var scrollTop = this.quill.root.scrollTop;\n\t if (this.linkRange) {\n\t this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER);\n\t delete this.linkRange;\n\t } else {\n\t this.restoreFocus();\n\t this.quill.format('link', value, _emitter2.default.sources.USER);\n\t }\n\t this.quill.root.scrollTop = scrollTop;\n\t break;\n\t }\n\t case 'video':\n\t {\n\t var match = value.match(/^(https?):\\/\\/(www\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/) || value.match(/^(https?):\\/\\/(www\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n\t if (match) {\n\t value = match[1] + '://www.youtube.com/embed/' + match[3] + '?showinfo=0';\n\t } else if (match = value.match(/^(https?):\\/\\/(www\\.)?vimeo\\.com\\/(\\d+)/)) {\n\t // eslint-disable-line no-cond-assign\n\t value = match[1] + '://player.vimeo.com/video/' + match[3] + '/';\n\t }\n\t } // eslint-disable-next-line no-fallthrough\n\t case 'formula':\n\t {\n\t var range = this.quill.getSelection(true);\n\t var index = range.index + range.length;\n\t if (range != null) {\n\t this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER);\n\t if (this.root.getAttribute('data-mode') === 'formula') {\n\t this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER);\n\t }\n\t this.quill.setSelection(index + 2, _emitter2.default.sources.USER);\n\t }\n\t break;\n\t }\n\t default:\n\t }\n\t this.textbox.value = '';\n\t this.hide();\n\t }\n\t }]);\n\t\n\t return BaseTooltip;\n\t}(_tooltip2.default);\n\t\n\tfunction fillSelect(select, values) {\n\t var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\t\n\t values.forEach(function (value) {\n\t var option = document.createElement('option');\n\t if (value === defaultValue) {\n\t option.setAttribute('selected', 'selected');\n\t } else {\n\t option.setAttribute('value', value);\n\t }\n\t select.appendChild(option);\n\t });\n\t}\n\t\n\texports.BaseTooltip = BaseTooltip;\n\texports.default = BaseTheme;\n\n/***/ },\n/* 111 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _emitter = __webpack_require__(36);\n\t\n\tvar _emitter2 = _interopRequireDefault(_emitter);\n\t\n\tvar _base = __webpack_require__(110);\n\t\n\tvar _base2 = _interopRequireDefault(_base);\n\t\n\tvar _link = __webpack_require__(63);\n\t\n\tvar _link2 = _interopRequireDefault(_link);\n\t\n\tvar _selection = __webpack_require__(44);\n\t\n\tvar _icons = __webpack_require__(72);\n\t\n\tvar _icons2 = _interopRequireDefault(_icons);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']];\n\t\n\tvar SnowTheme = function (_BaseTheme) {\n\t _inherits(SnowTheme, _BaseTheme);\n\t\n\t function SnowTheme(quill, options) {\n\t _classCallCheck(this, SnowTheme);\n\t\n\t if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n\t options.modules.toolbar.container = TOOLBAR_CONFIG;\n\t }\n\t\n\t var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options));\n\t\n\t _this.quill.container.classList.add('ql-snow');\n\t return _this;\n\t }\n\t\n\t _createClass(SnowTheme, [{\n\t key: 'extendToolbar',\n\t value: function extendToolbar(toolbar) {\n\t toolbar.container.classList.add('ql-snow');\n\t this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);\n\t this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);\n\t this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n\t if (toolbar.container.querySelector('.ql-link')) {\n\t this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) {\n\t toolbar.handlers['link'].call(toolbar, !context.format.link);\n\t });\n\t }\n\t }\n\t }]);\n\t\n\t return SnowTheme;\n\t}(_base2.default);\n\t\n\tSnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {\n\t modules: {\n\t toolbar: {\n\t handlers: {\n\t link: function link(value) {\n\t if (value) {\n\t var range = this.quill.getSelection();\n\t if (range == null || range.length == 0) return;\n\t var preview = this.quill.getText(range);\n\t if (/^\\S+@\\S+\\.\\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {\n\t preview = 'mailto:' + preview;\n\t }\n\t var tooltip = this.quill.theme.tooltip;\n\t tooltip.edit('link', preview);\n\t } else {\n\t this.quill.format('link', false);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t});\n\t\n\tvar SnowTooltip = function (_BaseTooltip) {\n\t _inherits(SnowTooltip, _BaseTooltip);\n\t\n\t function SnowTooltip(quill, bounds) {\n\t _classCallCheck(this, SnowTooltip);\n\t\n\t var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds));\n\t\n\t _this2.preview = _this2.root.querySelector('a.ql-preview');\n\t return _this2;\n\t }\n\t\n\t _createClass(SnowTooltip, [{\n\t key: 'listen',\n\t value: function listen() {\n\t var _this3 = this;\n\t\n\t _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this);\n\t this.root.querySelector('a.ql-action').addEventListener('click', function (event) {\n\t if (_this3.root.classList.contains('ql-editing')) {\n\t _this3.save();\n\t } else {\n\t _this3.edit('link', _this3.preview.textContent);\n\t }\n\t event.preventDefault();\n\t });\n\t this.root.querySelector('a.ql-remove').addEventListener('click', function (event) {\n\t if (_this3.linkRange != null) {\n\t _this3.restoreFocus();\n\t _this3.quill.formatText(_this3.linkRange, 'link', false, _emitter2.default.sources.USER);\n\t delete _this3.linkRange;\n\t }\n\t event.preventDefault();\n\t _this3.hide();\n\t });\n\t this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range) {\n\t if (range == null) return;\n\t if (range.length === 0) {\n\t var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index),\n\t _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),\n\t link = _quill$scroll$descend2[0],\n\t offset = _quill$scroll$descend2[1];\n\t\n\t if (link != null) {\n\t _this3.linkRange = new _selection.Range(range.index - offset, link.length());\n\t var preview = _link2.default.formats(link.domNode);\n\t _this3.preview.textContent = preview;\n\t _this3.preview.setAttribute('href', preview);\n\t _this3.show();\n\t _this3.position(_this3.quill.getBounds(_this3.linkRange));\n\t return;\n\t }\n\t } else {\n\t delete _this3.linkRange;\n\t }\n\t _this3.hide();\n\t });\n\t }\n\t }, {\n\t key: 'show',\n\t value: function show() {\n\t _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this);\n\t this.root.removeAttribute('data-mode');\n\t }\n\t }]);\n\t\n\t return SnowTooltip;\n\t}(_base.BaseTooltip);\n\t\n\tSnowTooltip.TEMPLATE = ['', '', '', ''].join('');\n\t\n\texports.default = SnowTheme;\n\n/***/ },\n/* 112 */\n/***/ function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) {\n\n\tvar pSlice = Array.prototype.slice;\n\tvar objectKeys = __webpack_require__(__webpack_module_template_argument_0__);\n\tvar isArguments = __webpack_require__(__webpack_module_template_argument_1__);\n\t\n\tvar deepEqual = module.exports = function (actual, expected, opts) {\n\t if (!opts) opts = {};\n\t // 7.1. All identical values are equivalent, as determined by ===.\n\t if (actual === expected) {\n\t return true;\n\t\n\t } else if (actual instanceof Date && expected instanceof Date) {\n\t return actual.getTime() === expected.getTime();\n\t\n\t // 7.3. Other pairs that do not both pass typeof value == 'object',\n\t // equivalence is determined by ==.\n\t } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n\t return opts.strict ? actual === expected : actual == expected;\n\t\n\t // 7.4. For all other Object pairs, including Array objects, equivalence is\n\t // determined by having the same number of owned properties (as verified\n\t // with Object.prototype.hasOwnProperty.call), the same set of keys\n\t // (although not necessarily the same order), equivalent values for every\n\t // corresponding key, and an identical 'prototype' property. Note: this\n\t // accounts for both named and indexed properties on Arrays.\n\t } else {\n\t return objEquiv(actual, expected, opts);\n\t }\n\t}\n\t\n\tfunction isUndefinedOrNull(value) {\n\t return value === null || value === undefined;\n\t}\n\t\n\tfunction isBuffer (x) {\n\t if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n\t if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n\t return false;\n\t }\n\t if (x.length > 0 && typeof x[0] !== 'number') return false;\n\t return true;\n\t}\n\t\n\tfunction objEquiv(a, b, opts) {\n\t var i, key;\n\t if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n\t return false;\n\t // an identical 'prototype' property.\n\t if (a.prototype !== b.prototype) return false;\n\t //~~~I've managed to break Object.keys through screwy arguments passing.\n\t // Converting to array solves the problem.\n\t if (isArguments(a)) {\n\t if (!isArguments(b)) {\n\t return false;\n\t }\n\t a = pSlice.call(a);\n\t b = pSlice.call(b);\n\t return deepEqual(a, b, opts);\n\t }\n\t if (isBuffer(a)) {\n\t if (!isBuffer(b)) {\n\t return false;\n\t }\n\t if (a.length !== b.length) return false;\n\t for (i = 0; i < a.length; i++) {\n\t if (a[i] !== b[i]) return false;\n\t }\n\t return true;\n\t }\n\t try {\n\t var ka = objectKeys(a),\n\t kb = objectKeys(b);\n\t } catch (e) {//happens when one is a string literal and the other isn't\n\t return false;\n\t }\n\t // having the same number of owned properties (keys incorporates\n\t // hasOwnProperty)\n\t if (ka.length != kb.length)\n\t return false;\n\t //the same set of keys (although not necessarily the same order),\n\t ka.sort();\n\t kb.sort();\n\t //~~~cheap key test\n\t for (i = ka.length - 1; i >= 0; i--) {\n\t if (ka[i] != kb[i])\n\t return false;\n\t }\n\t //equivalent values for every corresponding key, and\n\t //~~~possibly expensive deep test\n\t for (i = ka.length - 1; i >= 0; i--) {\n\t key = ka[i];\n\t if (!deepEqual(a[key], b[key], opts)) return false;\n\t }\n\t return typeof a === typeof b;\n\t}\n\n\n/***/ }\n/******/ ])))\n});\n;\n\n\n// WEBPACK FOOTER //\n// quill.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 12da403d1f2adb6b6342","import Quill from './core';\n\nimport { AlignClass, AlignStyle } from './formats/align';\nimport { DirectionAttribute, DirectionClass, DirectionStyle } from './formats/direction';\nimport { IndentClass as Indent } from './formats/indent';\n\nimport Blockquote from './formats/blockquote';\nimport Header from './formats/header';\nimport List, { ListItem } from './formats/list';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background';\nimport { ColorClass, ColorStyle } from './formats/color';\nimport { FontClass, FontStyle } from './formats/font';\nimport { SizeClass, SizeStyle } from './formats/size';\n\nimport Bold from './formats/bold';\nimport Italic from './formats/italic';\nimport Link from './formats/link';\nimport Script from './formats/script';\nimport Strike from './formats/strike';\nimport Underline from './formats/underline';\n\nimport Image from './formats/image';\nimport Video from './formats/video';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code';\n\nimport Formula from './modules/formula';\nimport Syntax from './modules/syntax';\nimport Toolbar from './modules/toolbar';\n\nimport Icons from './ui/icons';\nimport Picker from './ui/picker';\nimport ColorPicker from './ui/color-picker';\nimport IconPicker from './ui/icon-picker';\nimport Tooltip from './ui/tooltip';\n\nimport BubbleTheme from './themes/bubble';\nimport SnowTheme from './themes/snow';\n\n\nQuill.register({\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle\n}, true);\n\n\nQuill.register({\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'formats/list/item': ListItem,\n\n 'modules/formula': Formula,\n 'modules/syntax': Syntax,\n 'modules/toolbar': Toolbar,\n\n 'themes/bubble': BubbleTheme,\n 'themes/snow': SnowTheme,\n\n 'ui/icons': Icons,\n 'ui/picker': Picker,\n 'ui/icon-picker': IconPicker,\n 'ui/color-picker': ColorPicker,\n 'ui/tooltip': Tooltip\n}, true);\n\n\nmodule.exports = Quill;\n\n\n\n// WEBPACK FOOTER //\n// ./quill.js","import Parchment from 'parchment';\nimport Quill from './core/quill';\n\nimport Block, { BlockEmbed } from './blots/block';\nimport Break from './blots/break';\nimport Container from './blots/container';\nimport Cursor from './blots/cursor';\nimport Embed from './blots/embed';\nimport Inline from './blots/inline';\nimport Scroll from './blots/scroll';\nimport TextBlot from './blots/text';\n\nimport Clipboard from './modules/clipboard';\nimport History from './modules/history';\nimport Keyboard from './modules/keyboard';\n\nQuill.register({\n 'blots/block' : Block,\n 'blots/block/embed' : BlockEmbed,\n 'blots/break' : Break,\n 'blots/container' : Container,\n 'blots/cursor' : Cursor,\n 'blots/embed' : Embed,\n 'blots/inline' : Inline,\n 'blots/scroll' : Scroll,\n 'blots/text' : TextBlot,\n\n 'modules/clipboard' : Clipboard,\n 'modules/history' : History,\n 'modules/keyboard' : Keyboard\n});\n\nParchment.register(Block, Break, Cursor, Inline, Scroll, TextBlot);\n\n\nmodule.exports = Quill;\n\n\n\n// WEBPACK FOOTER //\n// ./core.js","\"use strict\";\nvar container_1 = require('./blot/abstract/container');\nvar format_1 = require('./blot/abstract/format');\nvar leaf_1 = require('./blot/abstract/leaf');\nvar scroll_1 = require('./blot/scroll');\nvar inline_1 = require('./blot/inline');\nvar block_1 = require('./blot/block');\nvar embed_1 = require('./blot/embed');\nvar text_1 = require('./blot/text');\nvar attributor_1 = require('./attributor/attributor');\nvar class_1 = require('./attributor/class');\nvar style_1 = require('./attributor/style');\nvar store_1 = require('./attributor/store');\nvar Registry = require('./registry');\nvar Parchment = {\n Scope: Registry.Scope,\n create: Registry.create,\n find: Registry.find,\n query: Registry.query,\n register: Registry.register,\n Container: container_1.default,\n Format: format_1.default,\n Leaf: leaf_1.default,\n Embed: embed_1.default,\n Scroll: scroll_1.default,\n Block: block_1.default,\n Inline: inline_1.default,\n Text: text_1.default,\n Attributor: {\n Attribute: attributor_1.default,\n Class: class_1.default,\n Style: style_1.default,\n Store: store_1.default\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Parchment;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/parchment.ts\n// module id = 2\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar linked_list_1 = require('../../collection/linked-list');\nvar shadow_1 = require('./shadow');\nvar Registry = require('../../registry');\nvar ContainerBlot = (function (_super) {\n __extends(ContainerBlot, _super);\n function ContainerBlot() {\n _super.apply(this, arguments);\n }\n ContainerBlot.prototype.appendChild = function (other) {\n this.insertBefore(other);\n };\n ContainerBlot.prototype.attach = function () {\n var _this = this;\n _super.prototype.attach.call(this);\n this.children = new linked_list_1.default();\n // Need to be reversed for if DOM nodes already in order\n [].slice.call(this.domNode.childNodes).reverse().forEach(function (node) {\n try {\n var child = makeBlot(node);\n _this.insertBefore(child, _this.children.head);\n }\n catch (err) {\n if (err instanceof Registry.ParchmentError)\n return;\n else\n throw err;\n }\n });\n };\n ContainerBlot.prototype.deleteAt = function (index, length) {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.deleteAt(offset, length);\n });\n };\n ContainerBlot.prototype.descendant = function (criteria, index) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n return [child, offset];\n }\n else if (child instanceof ContainerBlot) {\n return child.descendant(criteria, offset);\n }\n else {\n return [null, -1];\n }\n };\n ContainerBlot.prototype.descendants = function (criteria, index, length) {\n if (index === void 0) { index = 0; }\n if (length === void 0) { length = Number.MAX_VALUE; }\n var descendants = [], lengthLeft = length;\n this.children.forEachAt(index, length, function (child, index, length) {\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n descendants.push(child);\n }\n if (child instanceof ContainerBlot) {\n descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return descendants;\n };\n ContainerBlot.prototype.detach = function () {\n this.children.forEach(function (child) {\n child.detach();\n });\n _super.prototype.detach.call(this);\n };\n ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.formatAt(offset, length, name, value);\n });\n };\n ContainerBlot.prototype.insertAt = function (index, value, def) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if (child) {\n child.insertAt(offset, value, def);\n }\n else {\n var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def);\n this.appendChild(blot);\n }\n };\n ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function (child) {\n return childBlot instanceof child;\n })) {\n throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n }\n childBlot.insertInto(this, refBlot);\n };\n ContainerBlot.prototype.length = function () {\n return this.children.reduce(function (memo, child) {\n return memo + child.length();\n }, 0);\n };\n ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n this.children.forEach(function (child) {\n targetParent.insertBefore(child, refNode);\n });\n };\n ContainerBlot.prototype.optimize = function () {\n _super.prototype.optimize.call(this);\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n var child = Registry.create(this.statics.defaultChild);\n this.appendChild(child);\n child.optimize();\n }\n else {\n this.remove();\n }\n }\n };\n ContainerBlot.prototype.path = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n var position = [[this, index]];\n if (child instanceof ContainerBlot) {\n return position.concat(child.path(offset, inclusive));\n }\n else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n };\n ContainerBlot.prototype.removeChild = function (child) {\n this.children.remove(child);\n };\n ContainerBlot.prototype.replace = function (target) {\n if (target instanceof ContainerBlot) {\n target.moveChildren(this);\n }\n _super.prototype.replace.call(this, target);\n };\n ContainerBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = this.clone();\n this.parent.insertBefore(after, this.next);\n this.children.forEachAt(index, this.length(), function (child, offset, length) {\n child = child.split(offset, force);\n after.appendChild(child);\n });\n return after;\n };\n ContainerBlot.prototype.unwrap = function () {\n this.moveChildren(this.parent, this.next);\n this.remove();\n };\n ContainerBlot.prototype.update = function (mutations) {\n var _this = this;\n var addedNodes = [], removedNodes = [];\n mutations.forEach(function (mutation) {\n if (mutation.target === _this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach(function (node) {\n if (node.parentNode != null &&\n (document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY)) {\n // Node has not actually been removed\n return;\n }\n var blot = Registry.find(node);\n if (blot == null)\n return;\n if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n blot.detach();\n }\n });\n addedNodes.filter(function (node) {\n return node.parentNode == _this.domNode;\n }).sort(function (a, b) {\n if (a === b)\n return 0;\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n }).forEach(function (node) {\n var refBlot = null;\n if (node.nextSibling != null) {\n refBlot = Registry.find(node.nextSibling);\n }\n var blot = makeBlot(node);\n if (blot.next != refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(_this);\n }\n _this.insertBefore(blot, refBlot);\n }\n });\n };\n return ContainerBlot;\n}(shadow_1.default));\nfunction makeBlot(node) {\n var blot = Registry.find(node);\n if (blot == null) {\n try {\n blot = Registry.create(node);\n }\n catch (e) {\n blot = Registry.create(Registry.Scope.INLINE);\n [].slice.call(node.childNodes).forEach(function (child) {\n blot.domNode.appendChild(child);\n });\n node.parentNode.replaceChild(blot.domNode, node);\n blot.attach();\n }\n }\n return blot;\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = ContainerBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/abstract/container.ts\n// module id = 3\n// module chunks = 0","\"use strict\";\nvar LinkedList = (function () {\n function LinkedList() {\n this.head = this.tail = undefined;\n this.length = 0;\n }\n LinkedList.prototype.append = function () {\n var nodes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodes[_i - 0] = arguments[_i];\n }\n this.insertBefore(nodes[0], undefined);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n };\n LinkedList.prototype.contains = function (node) {\n var cur, next = this.iterator();\n while (cur = next()) {\n if (cur === node)\n return true;\n }\n return false;\n };\n LinkedList.prototype.insertBefore = function (node, refNode) {\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n }\n else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n }\n else {\n node.prev = undefined;\n this.head = this.tail = node;\n }\n this.length += 1;\n };\n LinkedList.prototype.offset = function (target) {\n var index = 0, cur = this.head;\n while (cur != null) {\n if (cur === target)\n return index;\n index += cur.length();\n cur = cur.next;\n }\n return -1;\n };\n LinkedList.prototype.remove = function (node) {\n if (!this.contains(node))\n return;\n if (node.prev != null)\n node.prev.next = node.next;\n if (node.next != null)\n node.next.prev = node.prev;\n if (node === this.head)\n this.head = node.next;\n if (node === this.tail)\n this.tail = node.prev;\n this.length -= 1;\n };\n LinkedList.prototype.iterator = function (curNode) {\n if (curNode === void 0) { curNode = this.head; }\n // TODO use yield when we can\n return function () {\n var ret = curNode;\n if (curNode != null)\n curNode = curNode.next;\n return ret;\n };\n };\n LinkedList.prototype.find = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var cur, next = this.iterator();\n while (cur = next()) {\n var length_1 = cur.length();\n if (index < length_1 || (inclusive && index === length_1 && (cur.next == null || cur.next.length() !== 0))) {\n return [cur, index];\n }\n index -= length_1;\n }\n return [null, 0];\n };\n LinkedList.prototype.forEach = function (callback) {\n var cur, next = this.iterator();\n while (cur = next()) {\n callback(cur);\n }\n };\n LinkedList.prototype.forEachAt = function (index, length, callback) {\n if (length <= 0)\n return;\n var _a = this.find(index), startNode = _a[0], offset = _a[1];\n var cur, curIndex = index - offset, next = this.iterator(startNode);\n while ((cur = next()) && curIndex < index + length) {\n var curLength = cur.length();\n if (index > curIndex) {\n callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n }\n else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n }\n };\n LinkedList.prototype.map = function (callback) {\n return this.reduce(function (memo, cur) {\n memo.push(callback(cur));\n return memo;\n }, []);\n };\n LinkedList.prototype.reduce = function (callback, memo) {\n var cur, next = this.iterator();\n while (cur = next()) {\n memo = callback(memo, cur);\n }\n return memo;\n };\n return LinkedList;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = LinkedList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/collection/linked-list.ts\n// module id = 4\n// module chunks = 0","\"use strict\";\nvar Registry = require('../../registry');\nvar ShadowBlot = (function () {\n function ShadowBlot(domNode) {\n this.domNode = domNode;\n this.attach();\n }\n Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n // Hack for accessing inherited static methods\n get: function () {\n return this.constructor;\n },\n enumerable: true,\n configurable: true\n });\n ShadowBlot.create = function (value) {\n if (this.tagName == null) {\n throw new Registry.ParchmentError('Blot definition missing tagName');\n }\n var node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value).toString() === value) {\n value = parseInt(value);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n }\n else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n }\n else {\n node = document.createElement(this.tagName[0]);\n }\n }\n else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n };\n ShadowBlot.prototype.attach = function () {\n this.domNode[Registry.DATA_KEY] = { blot: this };\n };\n ShadowBlot.prototype.clone = function () {\n var domNode = this.domNode.cloneNode();\n return Registry.create(domNode);\n };\n ShadowBlot.prototype.detach = function () {\n if (this.parent != null)\n this.parent.removeChild(this);\n delete this.domNode[Registry.DATA_KEY];\n };\n ShadowBlot.prototype.deleteAt = function (index, length) {\n var blot = this.isolate(index, length);\n blot.remove();\n };\n ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n var blot = this.isolate(index, length);\n if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n }\n else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n var parent_1 = Registry.create(this.statics.scope);\n blot.wrap(parent_1);\n parent_1.format(name, value);\n }\n };\n ShadowBlot.prototype.insertAt = function (index, value, def) {\n var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def);\n var ref = this.split(index);\n this.parent.insertBefore(blot, ref);\n };\n ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n if (this.parent != null) {\n this.parent.children.remove(this);\n }\n parentBlot.children.insertBefore(this, refBlot);\n if (refBlot != null) {\n var refDomNode = refBlot.domNode;\n }\n if (this.next == null || this.domNode.nextSibling != refDomNode) {\n parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n }\n this.parent = parentBlot;\n };\n ShadowBlot.prototype.isolate = function (index, length) {\n var target = this.split(index);\n target.split(length);\n return target;\n };\n ShadowBlot.prototype.length = function () {\n return 1;\n };\n ;\n ShadowBlot.prototype.offset = function (root) {\n if (root === void 0) { root = this.parent; }\n if (this.parent == null || this == root)\n return 0;\n return this.parent.children.offset(this) + this.parent.offset(root);\n };\n ShadowBlot.prototype.optimize = function () {\n // TODO clean up once we use WeakMap\n if (this.domNode[Registry.DATA_KEY] != null) {\n delete this.domNode[Registry.DATA_KEY].mutations;\n }\n };\n ShadowBlot.prototype.remove = function () {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n };\n ShadowBlot.prototype.replace = function (target) {\n if (target.parent == null)\n return;\n target.parent.insertBefore(this, target.next);\n target.remove();\n };\n ShadowBlot.prototype.replaceWith = function (name, value) {\n var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n replacement.replace(this);\n return replacement;\n };\n ShadowBlot.prototype.split = function (index, force) {\n return index === 0 ? this : this.next;\n };\n ShadowBlot.prototype.update = function (mutations) {\n if (mutations === void 0) { mutations = []; }\n // Nothing to do by default\n };\n ShadowBlot.prototype.wrap = function (name, value) {\n var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next);\n }\n wrapper.appendChild(this);\n return wrapper;\n };\n ShadowBlot.blotName = 'abstract';\n return ShadowBlot;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = ShadowBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/abstract/shadow.ts\n// module id = 5\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar ParchmentError = (function (_super) {\n __extends(ParchmentError, _super);\n function ParchmentError(message) {\n message = '[Parchment] ' + message;\n _super.call(this, message);\n this.message = message;\n this.name = this.constructor.name;\n }\n return ParchmentError;\n}(Error));\nexports.ParchmentError = ParchmentError;\nvar attributes = {};\nvar classes = {};\nvar tags = {};\nvar types = {};\nexports.DATA_KEY = '__blot';\n(function (Scope) {\n Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n})(exports.Scope || (exports.Scope = {}));\nvar Scope = exports.Scope;\n;\nfunction create(input, value) {\n var match = query(input);\n if (match == null) {\n throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n }\n var BlotClass = match;\n var node = input instanceof Node ? input : BlotClass.create(value);\n return new BlotClass(node, value);\n}\nexports.create = create;\nfunction find(node, bubble) {\n if (bubble === void 0) { bubble = false; }\n if (node == null)\n return null;\n if (node[exports.DATA_KEY] != null)\n return node[exports.DATA_KEY].blot;\n if (bubble)\n return find(node.parentNode, bubble);\n return null;\n}\nexports.find = find;\nfunction query(query, scope) {\n if (scope === void 0) { scope = Scope.ANY; }\n var match;\n if (typeof query === 'string') {\n match = types[query] || attributes[query];\n }\n else if (query instanceof Text) {\n match = types['text'];\n }\n else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = types['block'];\n }\n else if (query & Scope.LEVEL & Scope.INLINE) {\n match = types['inline'];\n }\n }\n else if (query instanceof HTMLElement) {\n var names = (query.getAttribute('class') || '').split(/\\s+/);\n for (var i in names) {\n match = classes[names[i]];\n if (match)\n break;\n }\n match = match || tags[query.tagName];\n }\n if (match == null) {\n if (query instanceof Node) {\n console.log(query.nodeType);\n }\n }\n if (match == null)\n return null;\n if ((scope & Scope.LEVEL & match.scope) && (scope & Scope.TYPE & match.scope))\n return match;\n return null;\n}\nexports.query = query;\nfunction register() {\n var Definitions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n Definitions[_i - 0] = arguments[_i];\n }\n if (Definitions.length > 1) {\n return Definitions.map(function (d) {\n return register(d);\n });\n }\n var Definition = Definitions[0];\n if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n throw new ParchmentError('Invalid definition');\n }\n else if (Definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n types[Definition.blotName || Definition.attrName] = Definition;\n if (typeof Definition.keyName === 'string') {\n attributes[Definition.keyName] = Definition;\n }\n else {\n if (Definition.className != null) {\n classes[Definition.className] = Definition;\n }\n if (Definition.tagName != null) {\n if (Array.isArray(Definition.tagName)) {\n Definition.tagName = Definition.tagName.map(function (tagName) {\n return tagName.toUpperCase();\n });\n }\n else {\n Definition.tagName = Definition.tagName.toUpperCase();\n }\n var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n tagNames.forEach(function (tag) {\n if (tags[tag] == null || Definition.className == null) {\n tags[tag] = Definition;\n }\n });\n }\n }\n return Definition;\n}\nexports.register = register;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/registry.ts\n// module id = 6\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar attributor_1 = require('../../attributor/attributor');\nvar store_1 = require('../../attributor/store');\nvar container_1 = require('./container');\nvar Registry = require('../../registry');\nvar FormatBlot = (function (_super) {\n __extends(FormatBlot, _super);\n function FormatBlot() {\n _super.apply(this, arguments);\n }\n FormatBlot.formats = function (domNode) {\n if (typeof this.tagName === 'string') {\n return true;\n }\n else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n };\n FormatBlot.prototype.attach = function () {\n _super.prototype.attach.call(this);\n this.attributes = new store_1.default(this.domNode);\n };\n FormatBlot.prototype.format = function (name, value) {\n var format = Registry.query(name);\n if (format instanceof attributor_1.default) {\n this.attributes.attribute(format, value);\n }\n else if (value) {\n if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n this.replaceWith(name, value);\n }\n }\n };\n FormatBlot.prototype.formats = function () {\n var formats = this.attributes.values();\n var format = this.statics.formats(this.domNode);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n };\n FormatBlot.prototype.replaceWith = function (name, value) {\n var replacement = _super.prototype.replaceWith.call(this, name, value);\n this.attributes.copy(replacement);\n return replacement;\n };\n FormatBlot.prototype.update = function (mutations) {\n var _this = this;\n _super.prototype.update.call(this, mutations);\n if (mutations.some(function (mutation) {\n return mutation.target === _this.domNode && mutation.type === 'attributes';\n })) {\n this.attributes.build();\n }\n };\n FormatBlot.prototype.wrap = function (name, value) {\n var wrapper = _super.prototype.wrap.call(this, name, value);\n if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n };\n return FormatBlot;\n}(container_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = FormatBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/abstract/format.ts\n// module id = 7\n// module chunks = 0","\"use strict\";\nvar Registry = require('../registry');\nvar Attributor = (function () {\n function Attributor(attrName, keyName, options) {\n if (options === void 0) { options = {}; }\n this.attrName = attrName;\n this.keyName = keyName;\n var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n if (options.scope != null) {\n // Ignore type bits, force attribute bit\n this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n }\n else {\n this.scope = Registry.Scope.ATTRIBUTE;\n }\n if (options.whitelist != null)\n this.whitelist = options.whitelist;\n }\n Attributor.keys = function (node) {\n return [].map.call(node.attributes, function (item) {\n return item.name;\n });\n };\n Attributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.setAttribute(this.keyName, value);\n return true;\n };\n Attributor.prototype.canAdd = function (node, value) {\n var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n if (match != null && (this.whitelist == null || this.whitelist.indexOf(value) > -1)) {\n return true;\n }\n return false;\n };\n Attributor.prototype.remove = function (node) {\n node.removeAttribute(this.keyName);\n };\n Attributor.prototype.value = function (node) {\n return node.getAttribute(this.keyName);\n };\n return Attributor;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Attributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/attributor/attributor.ts\n// module id = 8\n// module chunks = 0","\"use strict\";\nvar attributor_1 = require('./attributor');\nvar class_1 = require('./class');\nvar style_1 = require('./style');\nvar Registry = require('../registry');\nvar AttributorStore = (function () {\n function AttributorStore(domNode) {\n this.attributes = {};\n this.domNode = domNode;\n this.build();\n }\n AttributorStore.prototype.attribute = function (attribute, value) {\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n }\n else {\n delete this.attributes[attribute.attrName];\n }\n }\n }\n else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n };\n AttributorStore.prototype.build = function () {\n var _this = this;\n this.attributes = {};\n var attributes = attributor_1.default.keys(this.domNode);\n var classes = class_1.default.keys(this.domNode);\n var styles = style_1.default.keys(this.domNode);\n attributes.concat(classes).concat(styles).forEach(function (name) {\n var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n if (attr instanceof attributor_1.default) {\n _this.attributes[attr.attrName] = attr;\n }\n });\n };\n AttributorStore.prototype.copy = function (target) {\n var _this = this;\n Object.keys(this.attributes).forEach(function (key) {\n var value = _this.attributes[key].value(_this.domNode);\n target.format(key, value);\n });\n };\n AttributorStore.prototype.move = function (target) {\n var _this = this;\n this.copy(target);\n Object.keys(this.attributes).forEach(function (key) {\n _this.attributes[key].remove(_this.domNode);\n });\n this.attributes = {};\n };\n AttributorStore.prototype.values = function () {\n var _this = this;\n return Object.keys(this.attributes).reduce(function (attributes, name) {\n attributes[name] = _this.attributes[name].value(_this.domNode);\n return attributes;\n }, {});\n };\n return AttributorStore;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = AttributorStore;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/attributor/store.ts\n// module id = 9\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar attributor_1 = require('./attributor');\nfunction match(node, prefix) {\n var className = node.getAttribute('class') || '';\n return className.split(/\\s+/).filter(function (name) {\n return name.indexOf(prefix + \"-\") === 0;\n });\n}\nvar ClassAttributor = (function (_super) {\n __extends(ClassAttributor, _super);\n function ClassAttributor() {\n _super.apply(this, arguments);\n }\n ClassAttributor.keys = function (node) {\n return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n return name.split('-').slice(0, -1).join('-');\n });\n };\n ClassAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n this.remove(node);\n node.classList.add(this.keyName + \"-\" + value);\n return true;\n };\n ClassAttributor.prototype.remove = function (node) {\n var matches = match(node, this.keyName);\n matches.forEach(function (name) {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n };\n ClassAttributor.prototype.value = function (node) {\n var result = match(node, this.keyName)[0] || '';\n return result.slice(this.keyName.length + 1); // +1 for hyphen\n };\n return ClassAttributor;\n}(attributor_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = ClassAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/attributor/class.ts\n// module id = 10\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar attributor_1 = require('./attributor');\nfunction camelize(name) {\n var parts = name.split('-');\n var rest = parts.slice(1).map(function (part) {\n return part[0].toUpperCase() + part.slice(1);\n }).join('');\n return parts[0] + rest;\n}\nvar StyleAttributor = (function (_super) {\n __extends(StyleAttributor, _super);\n function StyleAttributor() {\n _super.apply(this, arguments);\n }\n StyleAttributor.keys = function (node) {\n return (node.getAttribute('style') || '').split(';').map(function (value) {\n var arr = value.split(':');\n return arr[0].trim();\n });\n };\n StyleAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.style[camelize(this.keyName)] = value;\n return true;\n };\n StyleAttributor.prototype.remove = function (node) {\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n };\n StyleAttributor.prototype.value = function (node) {\n return node.style[camelize(this.keyName)];\n };\n return StyleAttributor;\n}(attributor_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = StyleAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/attributor/style.ts\n// module id = 11\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar shadow_1 = require('./shadow');\nvar Registry = require('../../registry');\nvar LeafBlot = (function (_super) {\n __extends(LeafBlot, _super);\n function LeafBlot() {\n _super.apply(this, arguments);\n }\n LeafBlot.value = function (domNode) {\n return true;\n };\n LeafBlot.prototype.index = function (node, offset) {\n if (node !== this.domNode)\n return -1;\n return Math.min(offset, 1);\n };\n LeafBlot.prototype.position = function (index, inclusive) {\n var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n if (index > 0)\n offset += 1;\n return [this.parent.domNode, offset];\n };\n LeafBlot.prototype.value = function () {\n return (_a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a);\n var _a;\n };\n LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n return LeafBlot;\n}(shadow_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = LeafBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/abstract/leaf.ts\n// module id = 12\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar container_1 = require('./abstract/container');\nvar Registry = require('../registry');\nvar OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true\n};\nvar MAX_OPTIMIZE_ITERATIONS = 100;\nvar ScrollBlot = (function (_super) {\n __extends(ScrollBlot, _super);\n function ScrollBlot(node) {\n var _this = this;\n _super.call(this, node);\n this.parent = null;\n this.observer = new MutationObserver(function (mutations) {\n _this.update(mutations);\n });\n this.observer.observe(this.domNode, OBSERVER_CONFIG);\n }\n ScrollBlot.prototype.detach = function () {\n _super.prototype.detach.call(this);\n this.observer.disconnect();\n };\n ScrollBlot.prototype.deleteAt = function (index, length) {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(function (child) {\n child.remove();\n });\n }\n else {\n _super.prototype.deleteAt.call(this, index, length);\n }\n };\n ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n this.update();\n _super.prototype.formatAt.call(this, index, length, name, value);\n };\n ScrollBlot.prototype.insertAt = function (index, value, def) {\n this.update();\n _super.prototype.insertAt.call(this, index, value, def);\n };\n ScrollBlot.prototype.optimize = function (mutations) {\n var _this = this;\n if (mutations === void 0) { mutations = []; }\n _super.prototype.optimize.call(this);\n mutations.push.apply(mutations, this.observer.takeRecords());\n // TODO use WeakMap\n var mark = function (blot, markParent) {\n if (markParent === void 0) { markParent = true; }\n if (blot == null || blot === _this)\n return;\n if (blot.domNode.parentNode == null)\n return;\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n blot.domNode[Registry.DATA_KEY].mutations = [];\n }\n if (markParent)\n mark(blot.parent);\n };\n var optimize = function (blot) {\n if (blot.domNode[Registry.DATA_KEY] == null || blot.domNode[Registry.DATA_KEY].mutations == null) {\n return;\n }\n if (blot instanceof container_1.default) {\n blot.children.forEach(optimize);\n }\n blot.optimize();\n };\n var remaining = mutations;\n for (var i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(Registry.find(mutation.previousSibling, false));\n [].forEach.call(mutation.addedNodes, function (node) {\n var child = Registry.find(node, false);\n mark(child, false);\n if (child instanceof container_1.default) {\n child.children.forEach(function (grandChild) {\n mark(grandChild, false);\n });\n }\n });\n }\n else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = this.observer.takeRecords();\n mutations.push.apply(mutations, remaining);\n }\n };\n ScrollBlot.prototype.update = function (mutations) {\n var _this = this;\n mutations = mutations || this.observer.takeRecords();\n // TODO use WeakMap\n mutations.map(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n return blot;\n }\n else {\n blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n return null;\n }\n }).forEach(function (blot) {\n if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null)\n return;\n blot.update(blot.domNode[Registry.DATA_KEY].mutations || []);\n });\n if (this.domNode[Registry.DATA_KEY].mutations != null) {\n _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations);\n }\n this.optimize(mutations);\n };\n ScrollBlot.blotName = 'scroll';\n ScrollBlot.defaultChild = 'block';\n ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n ScrollBlot.tagName = 'DIV';\n return ScrollBlot;\n}(container_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = ScrollBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/scroll.ts\n// module id = 13\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar format_1 = require('./abstract/format');\nvar Registry = require('../registry');\n// Shallow object comparison\nfunction isEqual(obj1, obj2) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length)\n return false;\n for (var prop in obj1) {\n if (obj1[prop] !== obj2[prop])\n return false;\n }\n return true;\n}\nvar InlineBlot = (function (_super) {\n __extends(InlineBlot, _super);\n function InlineBlot() {\n _super.apply(this, arguments);\n }\n InlineBlot.formats = function (domNode) {\n if (domNode.tagName === InlineBlot.tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n InlineBlot.prototype.format = function (name, value) {\n var _this = this;\n if (name === this.statics.blotName && !value) {\n this.children.forEach(function (child) {\n if (!(child instanceof format_1.default)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n _this.attributes.copy(child);\n });\n this.unwrap();\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n InlineBlot.prototype.formatAt = function (index, length, name, value) {\n if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n var blot = this.isolate(index, length);\n blot.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n InlineBlot.prototype.optimize = function () {\n _super.prototype.optimize.call(this);\n var formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n var next = this.next;\n if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n next.moveChildren(this);\n next.remove();\n }\n };\n InlineBlot.blotName = 'inline';\n InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n InlineBlot.tagName = 'SPAN';\n return InlineBlot;\n}(format_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = InlineBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/inline.ts\n// module id = 14\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar format_1 = require('./abstract/format');\nvar Registry = require('../registry');\nvar BlockBlot = (function (_super) {\n __extends(BlockBlot, _super);\n function BlockBlot() {\n _super.apply(this, arguments);\n }\n BlockBlot.formats = function (domNode) {\n var tagName = Registry.query(BlockBlot.blotName).tagName;\n if (domNode.tagName === tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n BlockBlot.prototype.format = function (name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n return;\n }\n else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n BlockBlot.prototype.formatAt = function (index, length, name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n BlockBlot.prototype.insertAt = function (index, value, def) {\n if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n // Insert text or inline\n _super.prototype.insertAt.call(this, index, value, def);\n }\n else {\n var after = this.split(index);\n var blot = Registry.create(value, def);\n after.parent.insertBefore(blot, after);\n }\n };\n BlockBlot.blotName = 'block';\n BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n BlockBlot.tagName = 'P';\n return BlockBlot;\n}(format_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = BlockBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/block.ts\n// module id = 15\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar leaf_1 = require('./abstract/leaf');\nvar EmbedBlot = (function (_super) {\n __extends(EmbedBlot, _super);\n function EmbedBlot() {\n _super.apply(this, arguments);\n }\n EmbedBlot.formats = function (domNode) {\n return undefined;\n };\n EmbedBlot.prototype.format = function (name, value) {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n };\n EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n EmbedBlot.prototype.formats = function () {\n return this.statics.formats(this.domNode);\n };\n return EmbedBlot;\n}(leaf_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = EmbedBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/embed.ts\n// module id = 16\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar leaf_1 = require('./abstract/leaf');\nvar Registry = require('../registry');\nvar TextBlot = (function (_super) {\n __extends(TextBlot, _super);\n function TextBlot(node) {\n _super.call(this, node);\n this.text = this.statics.value(this.domNode);\n }\n TextBlot.create = function (value) {\n return document.createTextNode(value);\n };\n TextBlot.value = function (domNode) {\n return domNode.data;\n };\n TextBlot.prototype.deleteAt = function (index, length) {\n this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n };\n TextBlot.prototype.index = function (node, offset) {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n };\n TextBlot.prototype.insertAt = function (index, value, def) {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n }\n else {\n _super.prototype.insertAt.call(this, index, value, def);\n }\n };\n TextBlot.prototype.length = function () {\n return this.text.length;\n };\n TextBlot.prototype.optimize = function () {\n _super.prototype.optimize.call(this);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n }\n else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), this.next.value());\n this.next.remove();\n }\n };\n TextBlot.prototype.position = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return [this.domNode, index];\n };\n TextBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = Registry.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next);\n this.text = this.statics.value(this.domNode);\n return after;\n };\n TextBlot.prototype.update = function (mutations) {\n var _this = this;\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this.domNode;\n })) {\n this.text = this.statics.value(this.domNode);\n }\n };\n TextBlot.prototype.value = function () {\n return this.text;\n };\n TextBlot.blotName = 'text';\n TextBlot.scope = Registry.Scope.INLINE_BLOT;\n return TextBlot;\n}(leaf_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = TextBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/text.ts\n// module id = 17\n// module chunks = 0","import './polyfill';\nimport Delta from 'quill-delta';\nimport Editor from './editor';\nimport Emitter from './emitter';\nimport Module from './module';\nimport Parchment from 'parchment';\nimport Selection, { Range } from './selection';\nimport extend from 'extend';\nimport logger from './logger';\nimport Theme from './theme';\n\nlet debug = logger('quill');\n\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(path, target, overwrite = false) {\n if (typeof path !== 'string') {\n let name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register('formats/' + name, path, target);\n } else {\n Object.keys(path).forEach((key) => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if ((path.startsWith('blots/') || path.startsWith('formats/')) &&\n target.blotName !== 'abstract') {\n Parchment.register(target);\n }\n }\n }\n\n constructor(container, options = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n let html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.emitter = new Emitter();\n this.scroll = Parchment.create(this.root, {\n emitter: this.emitter,\n whitelist: this.options.formats\n });\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options);\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n let range = this.selection.lastRange;\n let index = range && range.length === 0 ? range.index : undefined;\n modify.call(this, () => {\n return this.editor.update(null, mutations, index);\n }, source);\n });\n let contents = this.clipboard.convert(`
    ${html}


    `);\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n }\n\n addContainer(container, refNode = null) {\n if (typeof container === 'string') {\n let className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1*length);\n }\n\n disable() {\n this.enable(false);\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n if (!enabled) {\n this.blur();\n }\n }\n\n focus() {\n this.selection.focus();\n this.selection.scrollIntoView();\n }\n\n format(name, value, source = Emitter.sources.API) {\n return modify.call(this, () => {\n let range = this.getSelection(true);\n let change = new Delta();\n if (range == null) {\n return change;\n } else if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, { [name]: value });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, { [name]: value });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index, length = 0) {\n if (typeof index === 'number') {\n return this.selection.getBounds(index, length);\n } else {\n return this.selection.getBounds(index.index, index.length);\n }\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index = this.getSelection(), length = 0) {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n } else {\n return this.editor.getFormat(index.index, index.length);\n }\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection(focus = false) {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getText(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value, source = Quill.sources.API) {\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats;\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return !this.container.classList.contains('ql-disabled');\n }\n\n off() {\n return this.emitter.off.apply(this.emitter, arguments);\n }\n\n on() {\n return this.emitter.on.apply(this.emitter, arguments);\n }\n\n once() {\n return this.emitter.once.apply(this.emitter, arguments);\n }\n\n pasteHTML(index, html, source) {\n this.clipboard.dangerouslyPasteHTML(index, html, source);\n }\n\n removeFormat(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n setContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n let length = this.getLength();\n let deleted = this.editor.deleteText(0, length);\n let applied = this.editor.applyDelta(delta);\n let lastOp = applied.ops[applied.ops.length - 1];\n if (lastOp != null && typeof(lastOp.insert) === 'string' && lastOp.insert[lastOp.insert.length-1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n let ret = deleted.compose(applied);\n return ret;\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(index, length), source);\n }\n this.selection.scrollIntoView();\n }\n\n setText(text, source = Emitter.sources.API) {\n let delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source = Emitter.sources.USER) {\n let change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n return change;\n }\n\n updateContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n}\nQuill.DEFAULTS = {\n bounds: null,\n formats: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n strict: true,\n theme: 'default'\n};\nQuill.events = Emitter.events;\nQuill.sources = Emitter.sources;\n// eslint-disable-next-line no-undef\nQuill.version = typeof(QUILL_VERSION) === 'undefined' ? 'dev' : QUILL_VERSION;\n\nQuill.imports = {\n 'delta' : Delta,\n 'parchment' : Parchment,\n 'core/module' : Module,\n 'core/theme' : Theme\n};\n\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend(true, {\n container: container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true\n }\n }, userConfig);\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = Theme;\n } else {\n userConfig.theme = Quill.import(`themes/${userConfig.theme}`);\n if (userConfig.theme == null) {\n throw new Error(`Invalid theme ${userConfig.theme}. Did you register it?`);\n }\n }\n let themeConfig = extend(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(function(config) {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(function(module) {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n let moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n let moduleConfig = moduleNames.reduce(function(config, name) {\n let moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(`Cannot load ${name} module. Are you sure you registered it?`);\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (userConfig.modules != null && userConfig.modules.toolbar &&\n userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n userConfig = extend(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n ['bounds', 'container'].forEach(function(key) {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(function(config, name) {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n }, {});\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (!this.options.strict && !this.isEnabled() && source === Emitter.sources.USER) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n let oldDelta = this.editor.delta;\n let change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n let args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value, value = name, name = length, length = index.length, index = index.index;\n } else {\n length = index.length, index = index.index;\n }\n } else if (typeof length !== 'number') {\n source = value, value = name, name = length, length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start, end;\n if (index instanceof Delta) {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n return index.transformPosition(pos, source === Emitter.sources.USER);\n });\n } else {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n if (pos < index || (pos === index && source !== Emitter.sources.USER)) return pos;\n if (length >= 0) {\n return pos + length;\n } else {\n return Math.max(index, pos + length);\n }\n });\n }\n return new Range(start, end - start);\n}\n\n\nexport { expandConfig, overload, Quill as default };\n\n\n\n// WEBPACK FOOTER //\n// ./core/quill.js","let elem = document.createElement('div');\nelem.classList.toggle('test-class', false);\nif (elem.classList.contains('test-class')) {\n let _toggle = DOMTokenList.prototype.toggle;\n DOMTokenList.prototype.toggle = function(token, force) {\n if (arguments.length > 1 && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n}\n\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function(searchString, position){\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function(searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n}\n\nif (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, \"find\", {\n value: function(predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n }\n });\n}\n\n// Disable resizing in Firefox\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n document.execCommand(\"enableObjectResizing\", false, false);\n});\n\n\n\n// WEBPACK FOOTER //\n// ./core/polyfill.js","var diff = require('fast-diff');\nvar equal = require('deep-equal');\nvar extend = require('extend');\nvar op = require('./op');\n\n\nvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\n\nvar Delta = function (ops) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n};\n\n\nDelta.prototype.insert = function (text, attributes) {\n var newOp = {};\n if (text.length === 0) return this;\n newOp.insert = text;\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype['delete'] = function (length) {\n if (length <= 0) return this;\n return this.push({ 'delete': length });\n};\n\nDelta.prototype.retain = function (length, attributes) {\n if (length <= 0) return this;\n var newOp = { retain: length };\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype.push = function (newOp) {\n var index = this.ops.length;\n var lastOp = this.ops[index - 1];\n newOp = extend(true, {}, newOp);\n if (typeof lastOp === 'object') {\n if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {\n this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (equal(newOp.attributes, lastOp.attributes)) {\n if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n};\n\nDelta.prototype.filter = function (predicate) {\n return this.ops.filter(predicate);\n};\n\nDelta.prototype.forEach = function (predicate) {\n this.ops.forEach(predicate);\n};\n\nDelta.prototype.map = function (predicate) {\n return this.ops.map(predicate);\n};\n\nDelta.prototype.partition = function (predicate) {\n var passed = [], failed = [];\n this.forEach(function(op) {\n var target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n};\n\nDelta.prototype.reduce = function (predicate, initial) {\n return this.ops.reduce(predicate, initial);\n};\n\nDelta.prototype.chop = function () {\n var lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n};\n\nDelta.prototype.length = function () {\n return this.reduce(function (length, elem) {\n return length + op.length(elem);\n }, 0);\n};\n\nDelta.prototype.slice = function (start, end) {\n start = start || 0;\n if (typeof end !== 'number') end = Infinity;\n var ops = [];\n var iter = op.iterator(this.ops);\n var index = 0;\n while (index < end && iter.hasNext()) {\n var nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += op.length(nextOp);\n }\n return new Delta(ops);\n};\n\n\nDelta.prototype.compose = function (other) {\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (typeof otherOp.retain === 'number') {\n var newOp = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length;\n } else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n if (attributes) newOp.attributes = attributes;\n delta.push(newOp);\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.concat = function (other) {\n var delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n};\n\nDelta.prototype.diff = function (other, index) {\n if (this.ops === other.ops) {\n return new Delta();\n }\n var strings = [this, other].map(function (delta) {\n return delta.map(function (op) {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n var prep = (delta === other) ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n }).join('');\n });\n var delta = new Delta();\n var diffResult = diff(strings[0], strings[1], index);\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n diffResult.forEach(function (component) {\n var length = component[1].length;\n while (length > 0) {\n var opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n delta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n delta['delete'](opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n var thisOp = thisIter.next(opLength);\n var otherOp = otherIter.next(opLength);\n if (equal(thisOp.insert, otherOp.insert)) {\n delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));\n } else {\n delta.push(otherOp)['delete'](opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return delta.chop();\n};\n\nDelta.prototype.eachLine = function (predicate, newline) {\n newline = newline || '\\n';\n var iter = op.iterator(this.ops);\n var line = new Delta();\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') return;\n var thisOp = iter.peek();\n var start = op.length(thisOp) - iter.peekLength();\n var index = typeof thisOp.insert === 'string' ?\n thisOp.insert.indexOf(newline, start) - start : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n predicate(line, iter.next(1).attributes || {});\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {});\n }\n};\n\nDelta.prototype.transform = function (other, priority) {\n priority = !!priority;\n if (typeof other === 'number') {\n return this.transformPosition(other, priority);\n }\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {\n delta.retain(op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (thisOp['delete']) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp['delete']) {\n delta.push(otherOp);\n } else {\n // We retain either their retain or insert\n delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.transformPosition = function (index, priority) {\n priority = !!priority;\n var thisIter = op.iterator(this.ops);\n var offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n var length = thisIter.peekLength();\n var nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n};\n\n\nmodule.exports = Delta;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/lib/delta.js\n// module id = 20\n// module chunks = 0","/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int} cursor_pos Expected edit position in text1 (optional)\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos) {\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n // Check cursor_pos within bounds\n if (cursor_pos < 0 || text1.length < cursor_pos) {\n cursor_pos = null;\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs);\n if (cursor_pos != null) {\n diffs = fix_cursor(diffs, cursor_pos);\n }\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [[DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n */\nfunction diff_cleanupMerge(diffs) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL,\n text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n if (count_delete === 0) {\n diffs.splice(pointer - count_insert,\n count_delete + count_insert, [DIFF_INSERT, text_insert]);\n } else if (count_insert === 0) {\n diffs.splice(pointer - count_delete,\n count_delete + count_insert, [DIFF_DELETE, text_delete]);\n } else {\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert, [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]);\n }\n pointer = pointer - count_delete - count_insert +\n (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n};\n\n\nvar diff = diff_main;\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n\n/*\n * Modify a diff such that the cursor position points to the start of a change:\n * E.g.\n * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)\n * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]\n * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)\n * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} A tuple [cursor location in the modified diff, modified diff]\n */\nfunction cursor_normalize_diff (diffs, cursor_pos) {\n if (cursor_pos === 0) {\n return [DIFF_EQUAL, diffs];\n }\n for (var current_pos = 0, i = 0; i < diffs.length; i++) {\n var d = diffs[i];\n if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {\n var next_pos = current_pos + d[1].length;\n if (cursor_pos === next_pos) {\n return [i + 1, diffs];\n } else if (cursor_pos < next_pos) {\n // copy to prevent side effects\n diffs = diffs.slice();\n // split d into two diff changes\n var split_pos = cursor_pos - current_pos;\n var d_left = [d[0], d[1].slice(0, split_pos)];\n var d_right = [d[0], d[1].slice(split_pos)];\n diffs.splice(i, 1, d_left, d_right);\n return [i + 1, diffs];\n } else {\n current_pos = next_pos;\n }\n }\n }\n throw new Error('cursor_pos is out of bounds!')\n}\n\n/*\n * Modify a diff such that the edit position is \"shifted\" to the proposed edit location (cursor_position).\n *\n * Case 1)\n * Check if a naive shift is possible:\n * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)\n * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result\n * Case 2)\n * Check if the following shifts are possible:\n * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']\n * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']\n * ^ ^\n * d d_next\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} Array of diff tuples\n */\nfunction fix_cursor (diffs, cursor_pos) {\n var norm = cursor_normalize_diff(diffs, cursor_pos);\n var ndiffs = norm[1];\n var cursor_pointer = norm[0];\n var d = ndiffs[cursor_pointer];\n var d_next = ndiffs[cursor_pointer + 1];\n\n if (d == null) {\n // Text was deleted from end of original string,\n // cursor is now out of bounds in new string\n return diffs;\n } else if (d[0] !== DIFF_EQUAL) {\n // A modification happened at the cursor location.\n // This is the expected outcome, so we can return the original diff.\n return diffs;\n } else {\n if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {\n // Case 1)\n // It is possible to perform a naive shift\n ndiffs.splice(cursor_pointer, 2, d_next, d)\n return merge_tuples(ndiffs, cursor_pointer, 2)\n } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {\n // Case 2)\n // d[1] is a prefix of d_next[1]\n // We can assume that d_next[0] !== 0, since d[0] === 0\n // Shift edit locations..\n ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);\n var suffix = d_next[1].slice(d[1].length);\n if (suffix.length > 0) {\n ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);\n }\n return merge_tuples(ndiffs, cursor_pointer, 3)\n } else {\n // Not possible to perform any modification\n return diffs;\n }\n }\n\n}\n\n/*\n * Try to merge tuples with their neigbors in a given range.\n * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']\n *\n * @param {Array} diffs Array of diff tuples.\n * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).\n * @param {Int} length Number of consecutive elements to check.\n * @return {Array} Array of merged diff tuples.\n */\nfunction merge_tuples (diffs, start, length) {\n // Check from (start-1) to (start+length).\n for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {\n if (i + 1 < diffs.length) {\n var left_d = diffs[i];\n var right_d = diffs[i+1];\n if (left_d[0] === right_d[1]) {\n diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);\n }\n }\n }\n return diffs;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/~/fast-diff/diff.js\n// module id = 21\n// module chunks = 0","exports = module.exports = typeof Object.keys === 'function'\n ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/~/deep-equal/lib/keys.js\n// module id = 23\n// module chunks = 0","var supportsArgumentsClass = (function(){\n return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n return object &&\n typeof object == 'object' &&\n typeof object.length == 'number' &&\n Object.prototype.hasOwnProperty.call(object, 'callee') &&\n !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n false;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/~/deep-equal/lib/is_arguments.js\n// module id = 24\n// module chunks = 0","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[0],\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t} else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = target[name];\n\t\t\t\tcopy = options[name];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\ttarget[name] = extend(deep, clone, copy);\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/~/extend/index.js\n// module id = 25\n// module chunks = 0","var equal = require('deep-equal');\nvar extend = require('extend');\n\n\nvar lib = {\n attributes: {\n compose: function (a, b, keepNull) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = extend(true, {}, b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce(function (copy, key) {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (var key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n diff: function(a, b) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {\n if (!equal(a[key], b[key])) {\n attributes[key] = b[key] === undefined ? null : b[key];\n }\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n transform: function (a, b, priority) {\n if (typeof a !== 'object') return b;\n if (typeof b !== 'object') return undefined;\n if (!priority) return b; // b simply overwrites us without priority\n var attributes = Object.keys(b).reduce(function (attributes, key) {\n if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n },\n\n iterator: function (ops) {\n return new Iterator(ops);\n },\n\n length: function (op) {\n if (typeof op['delete'] === 'number') {\n return op['delete'];\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n};\n\n\nfunction Iterator(ops) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n};\n\nIterator.prototype.hasNext = function () {\n return this.peekLength() < Infinity;\n};\n\nIterator.prototype.next = function (length) {\n if (!length) length = Infinity;\n var nextOp = this.ops[this.index];\n if (nextOp) {\n var offset = this.offset;\n var opLength = lib.length(nextOp)\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp['delete'] === 'number') {\n return { 'delete': length };\n } else {\n var retOp = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n};\n\nIterator.prototype.peek = function () {\n return this.ops[this.index];\n};\n\nIterator.prototype.peekLength = function () {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return lib.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n};\n\nIterator.prototype.peekType = function () {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index]['delete'] === 'number') {\n return 'delete';\n } else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n};\n\n\nmodule.exports = lib;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/lib/op.js\n// module id = 26\n// module chunks = 0","import Delta from 'quill-delta';\nimport DeltaOp from 'quill-delta/lib/op';\nimport Parchment from 'parchment';\nimport CodeBlock from '../formats/code';\nimport CursorBlot from '../blots/cursor';\nimport Block, { bubbleFormats } from '../blots/block';\nimport clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\n\n\nclass Editor {\n constructor(scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta) {\n let consumeNextNewline = false;\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batch = true;\n delta = normalizeDelta(delta);\n delta.reduce((index, op) => {\n let length = op.retain || op.delete || op.insert.length || 1;\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n let text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (index >= scrollLength && !text.endsWith('\\n')) {\n consumeNextNewline = true;\n }\n this.scroll.insertAt(index, text);\n let [line, offset] = this.scroll.line(index);\n let formats = extend({}, bubbleFormats(line));\n if (line instanceof Block) {\n let [leaf, ] = line.descendant(Parchment.Leaf, offset);\n formats = extend(formats, bubbleFormats(leaf));\n }\n attributes = DeltaOp.attributes.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n let key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach((name) => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n delta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batch = false;\n this.scroll.optimize();\n return this.update(delta);\n }\n\n deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(index, length, formats = {}) {\n this.scroll.update();\n Object.keys(formats).forEach((format) => {\n let lines = this.scroll.lines(index, Math.max(length, 1));\n let lengthRemaining = length;\n lines.forEach((line) => {\n let lineLength = line.length();\n if (!(line instanceof CodeBlock)) {\n line.format(format, formats[format]);\n } else {\n let codeIndex = index - line.offset(this.scroll);\n let codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n line.formatAt(codeIndex, codeLength, format, formats[format]);\n }\n lengthRemaining -= lineLength;\n });\n });\n this.scroll.optimize();\n return this.update(new Delta().retain(index).retain(length, clone(formats)));\n }\n\n formatText(index, length, formats = {}) {\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).retain(length, clone(formats)));\n }\n\n getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n\n getDelta() {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index, length = 0) {\n let lines = [], leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(function(path) {\n let [blot, ] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof Parchment.Leaf) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(Parchment.Leaf, index, length);\n }\n let formatsArr = [lines, leaves].map(function(blots) {\n if (blots.length === 0) return {};\n let formats = bubbleFormats(blots.shift());\n while (Object.keys(formats).length > 0) {\n let blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return extend.apply(extend, formatsArr);\n }\n\n getText(index, length) {\n return this.getContents(index, length).filter(function(op) {\n return typeof op.insert === 'string';\n }).map(function(op) {\n return op.insert;\n }).join('');\n }\n\n insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(index, text, formats = {}) {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).insert(text, clone(formats)));\n }\n\n isBlank() {\n if (this.scroll.children.length == 0) return true;\n if (this.scroll.children.length > 1) return false;\n let child = this.scroll.children.head;\n return child.length() <= 1 && Object.keys(child.formats()).length == 0;\n }\n\n removeFormat(index, length) {\n let text = this.getText(index, length);\n let [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0, suffix = new Delta();\n if (line != null) {\n if (!(line instanceof CodeBlock)) {\n suffixLength = line.length() - offset;\n } else {\n suffixLength = line.newlineIndex(offset) - offset + 1;\n }\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n let contents = this.getContents(index, length + suffixLength);\n let diff = contents.diff(new Delta().insert(text).concat(suffix));\n let delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(change, mutations = [], cursorIndex = undefined) {\n let oldDelta = this.delta;\n if (mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n Parchment.find(mutations[0].target)) {\n // Optimization for character changes\n let textBlot = Parchment.find(mutations[0].target);\n let formats = bubbleFormats(textBlot);\n let index = textBlot.offset(this.scroll);\n let oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n let oldText = new Delta().insert(oldValue);\n let newText = new Delta().insert(textBlot.value());\n let diffDelta = new Delta().retain(index).concat(oldText.diff(newText, cursorIndex));\n change = diffDelta.reduce(function(delta, op) {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n } else {\n return delta.push(op);\n }\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !equal(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, cursorIndex);\n }\n }\n return change;\n }\n}\n\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce(function(merged, name) {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce(function(delta, op) {\n if (op.insert === 1) {\n let attributes = clone(op.attributes);\n delete attributes['image'];\n return delta.insert({ image: op.attributes.image }, attributes);\n }\n if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n op = clone(op);\n if (op.attributes.list) {\n op.attributes.list = 'ordered';\n } else {\n op.attributes.list = 'bullet';\n delete op.attributes.bullet;\n }\n }\n if (typeof op.insert === 'string') {\n let text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return delta.insert(text, op.attributes);\n }\n return delta.push(op);\n }, new Delta());\n}\n\n\nexport default Editor;\n\n\n\n// WEBPACK FOOTER //\n// ./core/editor.js","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Inline from '../blots/inline';\nimport TextBlot from '../blots/text';\n\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\n\nclass CodeBlock extends Block {\n static create(value) {\n let domNode = super.create(value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n\n static formats() {\n return true;\n }\n\n delta() {\n let text = this.domNode.textContent;\n if (text.endsWith('\\n')) { // Should always be true\n text = text.slice(0, -1);\n }\n return text.split('\\n').reduce((delta, frag) => {\n return delta.insert(frag).insert('\\n', this.formats());\n }, new Delta());\n }\n\n format(name, value) {\n if (name === this.statics.blotName && value) return;\n let [text, ] = this.descendant(TextBlot, this.length() - 1);\n if (text != null) {\n text.deleteAt(text.length() - 1, 1);\n }\n super.format(name, value);\n }\n\n formatAt(index, length, name, value) {\n if (length === 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK) == null ||\n (name === this.statics.blotName && value === this.statics.formats(this.domNode))) {\n return;\n }\n let nextNewline = this.newlineIndex(index);\n if (nextNewline < 0 || nextNewline >= index + length) return;\n let prevNewline = this.newlineIndex(index, true) + 1;\n let isolateLength = nextNewline - prevNewline + 1;\n let blot = this.isolate(prevNewline, isolateLength);\n let next = blot.next;\n blot.format(name, value);\n if (next instanceof CodeBlock) {\n next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n }\n }\n\n insertAt(index, value, def) {\n if (def != null) return;\n let [text, offset] = this.descendant(TextBlot, index);\n text.insertAt(offset, value);\n }\n\n length() {\n let length = this.domNode.textContent.length;\n if (!this.domNode.textContent.endsWith('\\n')) {\n return length + 1;\n }\n return length;\n }\n\n newlineIndex(searchIndex, reverse = false) {\n if (!reverse) {\n let offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n return offset > -1 ? searchIndex + offset : -1;\n } else {\n return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n }\n }\n\n optimize() {\n if (!this.domNode.textContent.endsWith('\\n')) {\n this.appendChild(Parchment.create('text', '\\n'));\n }\n super.optimize();\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n next.optimize();\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n super.replace(target);\n [].slice.call(this.domNode.querySelectorAll('*')).forEach(function(node) {\n let blot = Parchment.find(node);\n if (blot == null) {\n node.parentNode.removeChild(node);\n } else if (blot instanceof Parchment.Embed) {\n blot.remove();\n } else {\n blot.unwrap();\n }\n });\n }\n}\nCodeBlock.blotName = 'code-block';\nCodeBlock.tagName = 'PRE';\nCodeBlock.TAB = ' ';\n\n\nexport { Code, CodeBlock as default };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/code.js","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Break from './break';\nimport Embed from './embed';\nimport Inline from './inline';\nimport TextBlot from './text';\n\n\nconst NEWLINE_LENGTH = 1;\n\n\nclass BlockEmbed extends Embed {\n attach() {\n super.attach();\n this.attributes = new Parchment.Attributor.Store(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), extend(this.formats(), this.attributes.values()));\n }\n\n format(name, value) {\n let attribute = Parchment.query(name, Parchment.Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index, length, name, value) {\n this.format(name, value);\n }\n\n insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n let block = Parchment.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n super.insertAt(index, value, def);\n }\n }\n}\nBlockEmbed.scope = Parchment.Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\n\nclass Block extends Parchment.Block {\n constructor(domNode) {\n super(domNode);\n this.cache = {};\n }\n\n delta() {\n if (this.cache.delta == null) {\n this.cache.delta = this.descendants(Parchment.Leaf).reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n } else {\n return delta.insert(leaf.value(), bubbleFormats(leaf));\n }\n }, new Delta()).insert('\\n', bubbleFormats(this));\n }\n return this.cache.delta;\n }\n\n deleteAt(index, length) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(index, Math.min(length, this.length() - index - 1), name, value);\n }\n this.cache = {};\n }\n\n insertAt(index, value, def) {\n if (def != null) return super.insertAt(index, value, def);\n if (value.length === 0) return;\n let lines = value.split('\\n');\n let text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n let block = this;\n lines.reduce(function(index, line) {\n block = block.split(index, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot, ref) {\n let head = this.children.head;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target, ref) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize() {\n super.optimize();\n this.cache = {};\n }\n\n path(index) {\n return super.path(index, true);\n }\n\n removeChild(child) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index, force = false) {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n let clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n } else {\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n } else {\n let next = super.split(index, force);\n this.cache = {};\n return next;\n }\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = 'break';\nBlock.allowedChildren = [Inline, Embed, TextBlot];\n\n\nfunction bubbleFormats(blot, formats = {}) {\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = extend(formats, blot.formats());\n }\n if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats);\n}\n\n\nexport { bubbleFormats, BlockEmbed, Block as default };\n\n\n\n// WEBPACK FOOTER //\n// ./blots/block.js","import Embed from './embed';\n\n\nclass Break extends Embed {\n static value() {\n return undefined;\n }\n\n insertInto(parent, ref) {\n if (parent.children.length === 0) {\n super.insertInto(parent, ref);\n } else {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\n\nexport default Break;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/break.js","import Parchment from 'parchment';\n\nclass Embed extends Parchment.Embed { }\n\nexport default Embed;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/embed.js","import Embed from './embed';\nimport Text from './text';\nimport Parchment from 'parchment';\n\n\nclass Inline extends Parchment.Inline {\n static compare(self, other) {\n let selfIndex = Inline.order.indexOf(self);\n let otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n } else if (self === other) {\n return 0;\n } else if (self < other) {\n return -1;\n } else {\n return 1;\n }\n }\n\n formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && Parchment.query(name, Parchment.Scope.BLOT)) {\n let blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize() {\n super.optimize();\n if (this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n let parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\nInline.allowedChildren = [Inline, Embed, Text];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = [\n 'cursor', 'inline', // Must be lower\n 'code', 'underline', 'strike', 'italic', 'bold', 'script',\n 'link' // Must be higher\n];\n\n\nexport default Inline;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/inline.js","import Parchment from 'parchment';\n\nclass TextBlot extends Parchment.Text { }\n\nexport default TextBlot;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/text.js","import Parchment from 'parchment';\nimport Embed from './embed';\nimport TextBlot from './text';\nimport Emitter from '../core/emitter';\n\n\nclass Cursor extends Embed {\n static value() {\n return undefined;\n }\n\n constructor(domNode, selection) {\n super(domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this._length = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name, value) {\n if (this._length !== 0) {\n return super.format(name, value);\n }\n let target = this, index = 0;\n while (target != null && target.statics.scope !== Parchment.Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this._length = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this._length = 0;\n }\n }\n\n index(node, offset) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this._length;\n }\n\n position() {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n this.parent = null;\n }\n\n restore() {\n if (this.selection.composing) return;\n if (this.parent == null) return;\n let textNode = this.textNode;\n let range = this.selection.getNativeRange();\n let restoreText, start, end;\n if (range != null && range.start.node === textNode && range.end.node === textNode) {\n [restoreText, start, end] = [textNode, range.start.offset, range.end.offset];\n }\n // Link format will insert text outside of anchor tag\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n if (this.textNode.data !== Cursor.CONTENTS) {\n let text = this.textNode.data.split(Cursor.CONTENTS).join('');\n if (this.next instanceof TextBlot) {\n restoreText = this.next.domNode;\n this.next.insertAt(0, text);\n this.textNode.data = Cursor.CONTENTS;\n } else {\n this.textNode.data = text;\n this.parent.insertBefore(Parchment.create(this.textNode), this);\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n }\n }\n this.remove();\n if (start == null) return;\n this.selection.emitter.once(Emitter.events.SCROLL_OPTIMIZE, () => {\n [start, end] = [start, end].map(function(offset) {\n return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n });\n this.selection.setNativeRange(restoreText, start, restoreText, end);\n });\n }\n\n update(mutations) {\n mutations.forEach((mutation) => {\n if (mutation.type === 'characterData' && mutation.target === this.textNode) {\n this.restore();\n }\n });\n }\n\n value() {\n return '';\n }\n}\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = \"\\uFEFF\"; // Zero width no break space\n\n\nexport default Cursor;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/cursor.js","import EventEmitter from 'eventemitter3';\nimport logger from './logger';\n\nlet debug = logger('quill:events');\n\n\nclass Emitter extends EventEmitter {\n constructor() {\n super();\n this.on('error', debug.error);\n }\n\n emit() {\n debug.log.apply(debug, arguments);\n super.emit.apply(this, arguments);\n }\n}\n\nEmitter.events = {\n EDITOR_CHANGE : 'editor-change',\n SCROLL_BEFORE_UPDATE : 'scroll-before-update',\n SCROLL_OPTIMIZE : 'scroll-optimize',\n SCROLL_UPDATE : 'scroll-update',\n SELECTION_CHANGE : 'selection-change',\n TEXT_CHANGE : 'text-change'\n};\nEmitter.sources = {\n API : 'api',\n SILENT : 'silent',\n USER : 'user'\n};\n\n\nexport default Emitter;\n\n\n\n// WEBPACK FOOTER //\n// ./core/emitter.js","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/eventemitter3/index.js\n// module id = 37\n// module chunks = 0","let levels = ['error', 'warn', 'log', 'info'];\nlet level = 'warn';\n\nfunction debug(method, ...args) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method].apply(console, args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce(function(logger, method) {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\ndebug.level = namespace.level = function(newLevel) {\n level = newLevel;\n};\n\n\nexport default namespace;\n\n\n\n// WEBPACK FOOTER //\n// ./core/logger.js","var clone = (function() {\n'use strict';\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n*/\nfunction clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (parent instanceof nativeMap) {\n child = new nativeMap();\n } else if (parent instanceof nativeSet) {\n child = new nativeSet();\n } else if (parent instanceof nativePromise) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (parent instanceof nativeMap) {\n var keyIterator = parent.keys();\n while(true) {\n var next = keyIterator.next();\n if (next.done) {\n break;\n }\n var keyChild = _clone(next.value, depth - 1);\n var valueChild = _clone(parent.get(next.value), depth - 1);\n child.set(keyChild, valueChild);\n }\n }\n if (parent instanceof nativeSet) {\n var iterator = parent.keys();\n while(true) {\n var next = iterator.next();\n if (next.done) {\n break;\n }\n var entryChild = _clone(next.value, depth - 1);\n child.add(entryChild);\n }\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n child[symbol] = _clone(parent[symbol], depth - 1);\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/clone/clone.js\n// module id = 39\n// module chunks = 0","class Module {\n constructor(quill, options = {}) {\n this.quill = quill;\n this.options = options;\n }\n}\nModule.DEFAULTS = {};\n\n\nexport default Module;\n\n\n\n// WEBPACK FOOTER //\n// ./core/module.js","import Parchment from 'parchment';\nimport clone from 'clone';\nimport equal from 'deep-equal';\nimport Emitter from './emitter';\nimport logger from './logger';\n\nlet debug = logger('quill:selection');\n\n\nclass Range {\n constructor(index, length = 0) {\n this.index = index;\n this.length = length;\n }\n}\n\n\nclass Selection {\n constructor(scroll, emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.root = this.scroll.domNode;\n this.root.addEventListener('compositionstart', () => {\n this.composing = true;\n });\n this.root.addEventListener('compositionend', () => {\n this.composing = false;\n });\n this.cursor = Parchment.create('cursor', this);\n // savedRange is last non-null range\n this.lastRange = this.savedRange = new Range(0, 0);\n ['keyup', 'mouseup', 'mouseleave', 'touchend', 'touchleave', 'focus', 'blur'].forEach((eventName) => {\n this.root.addEventListener(eventName, () => {\n // When range used to be a selection and user click within the selection,\n // the range now being a cursor has not updated yet without setTimeout\n setTimeout(this.update.bind(this, Emitter.sources.USER), 100);\n });\n });\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type, delta) => {\n if (type === Emitter.events.TEXT_CHANGE && delta.length() > 0) {\n this.update(Emitter.sources.SILENT);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, () => {\n let native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n // TODO unclear if this has negative side effects\n this.emitter.once(Emitter.events.SCROLL_UPDATE, () => {\n try {\n this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);\n } catch (ignored) {}\n });\n });\n this.update(Emitter.sources.SILENT);\n }\n\n focus() {\n if (this.hasFocus()) return;\n let bodyTop = document.body.scrollTop;\n this.root.focus();\n document.body.scrollTop = bodyTop;\n this.setRange(this.savedRange);\n }\n\n format(format, value) {\n this.scroll.update();\n let nativeRange = this.getNativeRange();\n if (nativeRange == null || !nativeRange.native.collapsed || Parchment.query(format, Parchment.Scope.BLOCK)) return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n let blot = Parchment.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof Parchment.Leaf) {\n let after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index, length = 0) {\n let scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let bounds, node, [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n let range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n bounds = range.getBoundingClientRect();\n } else {\n let side = 'left';\n let rect;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n bounds = {\n height: rect.height,\n left: rect[side],\n width: 0,\n top: rect.top\n };\n }\n let containerBounds = this.root.parentNode.getBoundingClientRect();\n return {\n left: bounds.left - containerBounds.left,\n right: bounds.left + bounds.width - containerBounds.left,\n top: bounds.top - containerBounds.top,\n bottom: bounds.top + bounds.height - containerBounds.top,\n height: bounds.height,\n width: bounds.width\n };\n }\n\n getNativeRange() {\n let selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n let nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n if (!contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))) {\n return null;\n }\n let range = {\n start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange\n };\n [range.start, range.end].forEach(function(position) {\n let node = position.node, offset = position.offset;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n } else {\n break;\n }\n }\n position.node = node, position.offset = offset;\n });\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange() {\n let range = this.getNativeRange();\n if (range == null) return [null, null];\n let positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n let indexes = positions.map((position) => {\n let [node, offset] = position;\n let blot = Parchment.find(node, true);\n let index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n } else if (blot instanceof Parchment.Container) {\n return index + blot.length();\n } else {\n return index + blot.index(node, offset);\n }\n });\n let start = Math.min(...indexes), end = Math.max(...indexes);\n return [new Range(start, end-start), range];\n }\n\n hasFocus() {\n return document.activeElement === this.root;\n }\n\n scrollIntoView(range = this.lastRange) {\n if (range == null) return;\n let bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n if (this.root.offsetHeight < bounds.bottom) {\n let [line, ] = this.scroll.line(Math.min(range.index + range.length, this.scroll.length()-1));\n this.root.scrollTop = line.domNode.offsetTop + line.domNode.offsetHeight - this.root.offsetHeight;\n } else if (bounds.top < 0) {\n let [line, ] = this.scroll.line(Math.min(range.index, this.scroll.length()-1));\n this.root.scrollTop = line.domNode.offsetTop;\n }\n }\n\n setNativeRange(startNode, startOffset, endNode = startNode, endOffset = startOffset, force = false) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n return;\n }\n let selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n let nativeRange = this.getNativeRange();\n if (nativeRange == null || force ||\n startNode !== nativeRange.start.node || startOffset !== nativeRange.start.offset ||\n endNode !== nativeRange.end.node || endOffset !== nativeRange.end.offset) {\n let range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n }\n }\n\n setRange(range, force = false, source = Emitter.sources.API) {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n let indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n let args = [];\n let scrollLength = this.scroll.length();\n indexes.forEach((index, i) => {\n index = Math.min(scrollLength - 1, index);\n let node, [leaf, offset] = this.scroll.leaf(index);\n [node, offset] = leaf.position(offset, i !== 0);\n args.push(node, offset);\n });\n if (args.length < 2) {\n args = args.concat(args);\n }\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source = Emitter.sources.USER) {\n let nativeRange, oldRange = this.lastRange;\n [this.lastRange, nativeRange] = this.getRange();\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!equal(oldRange, this.lastRange)) {\n if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n this.cursor.restore();\n }\n let args = [Emitter.events.SELECTION_CHANGE, clone(this.lastRange), clone(oldRange), source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode;\n } catch (e) {\n return false;\n }\n // IE11 has bug with Text nodes\n // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n if (descendant instanceof Text) {\n descendant = descendant.parentNode;\n }\n return parent.contains(descendant);\n}\n\n\nexport { Range, Selection as default };\n\n\n\n// WEBPACK FOOTER //\n// ./core/selection.js","class Theme {\n constructor(quill, options) {\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n init() {\n Object.keys(this.options.modules).forEach((name) => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name) {\n let moduleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n return this.modules[name];\n }\n}\nTheme.DEFAULTS = {\n modules: {}\n};\nTheme.themes = {\n 'default': Theme\n};\n\n\nexport default Theme;\n\n\n\n// WEBPACK FOOTER //\n// ./core/theme.js","import Parchment from 'parchment';\nimport Block, { BlockEmbed } from './block';\n\n\nclass Container extends Parchment.Container { }\nContainer.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Container;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/container.js","import Parchment from 'parchment';\nimport Emitter from '../core/emitter';\nimport Block, { BlockEmbed } from './block';\nimport Break from './break';\nimport Container from './container';\nimport CodeBlock from '../formats/code';\n\n\nfunction isLine(blot) {\n return (blot instanceof Block || blot instanceof BlockEmbed);\n}\n\n\nclass Scroll extends Parchment.Scroll {\n constructor(domNode, config) {\n super(domNode);\n this.emitter = config.emitter;\n if (Array.isArray(config.whitelist)) {\n this.whitelist = config.whitelist.reduce(function(whitelist, format) {\n whitelist[format] = true;\n return whitelist;\n }, {});\n }\n this.optimize();\n this.enable();\n }\n\n deleteAt(index, length) {\n let [first, offset] = this.line(index);\n let [last, ] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0 &&\n !(first instanceof BlockEmbed) && !(last instanceof BlockEmbed)) {\n if (last instanceof CodeBlock) {\n last.deleteAt(last.length() - 1, 1);\n }\n let ref = last.children.head instanceof Break ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled);\n }\n\n formatAt(index, length, format, value) {\n if (this.whitelist != null && !this.whitelist[format]) return;\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index, value, def) {\n if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n if (index >= this.length()) {\n if (def == null || Parchment.query(value, Parchment.Scope.BLOCK) == null) {\n let blot = Parchment.create(this.statics.defaultChild);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n value = value.slice(0, -1);\n }\n blot.insertAt(0, value, def);\n } else {\n let embed = Parchment.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot, ref) {\n if (blot.statics.scope === Parchment.Scope.INLINE_BLOT) {\n let wrapper = Parchment.create(this.statics.defaultChild);\n wrapper.appendChild(blot);\n blot = wrapper;\n }\n super.insertBefore(blot, ref);\n }\n\n leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n\n line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE) {\n let getLines = (blot, index, length) => {\n let lines = [], lengthLeft = length;\n blot.children.forEachAt(index, length, function(child, index, length) {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof Parchment.Container) {\n lines = lines.concat(getLines(child, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(mutations = []) {\n if (this.batch === true) return;\n super.optimize(mutations);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations);\n }\n }\n\n path(index) {\n return super.path(index).slice(1); // Exclude self\n }\n\n update(mutations) {\n if (this.batch === true) return;\n let source = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n}\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = 'block';\nScroll.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Scroll;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/scroll.js","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nimport { AlignAttribute, AlignStyle } from '../formats/align';\nimport { BackgroundStyle } from '../formats/background';\nimport { ColorStyle } from '../formats/color';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction';\nimport { FontStyle } from '../formats/font';\nimport { SizeStyle } from '../formats/size';\n\nlet debug = logger('quill:clipboard');\n\nconst CLIPBOARD_CONFIG = [\n [Node.TEXT_NODE, matchText],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchSpacing],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['b', matchAlias.bind(matchAlias, 'bold')],\n ['i', matchAlias.bind(matchAlias, 'italic')],\n ['style', matchIgnore]\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [\n AlignAttribute,\n DirectionAttribute\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\n\nclass Clipboard extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.quill.root.addEventListener('paste', this.onPaste.bind(this));\n this.container = this.quill.addContainer('ql-clipboard');\n this.container.setAttribute('contenteditable', true);\n this.container.setAttribute('tabindex', -1);\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers).forEach((pair) => {\n this.addMatcher(...pair);\n });\n }\n\n addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert(html) {\n const DOM_KEY = '__ql-matcher';\n if (typeof html === 'string') {\n this.container.innerHTML = html;\n }\n let textMatchers = [], elementMatchers = [];\n this.matchers.forEach((pair) => {\n let [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n [].forEach.call(this.container.querySelectorAll(selector), (node) => {\n // TODO use weakmap\n node[DOM_KEY] = node[DOM_KEY] || [];\n node[DOM_KEY].push(matcher);\n });\n break;\n }\n });\n let traverse = (node) => { // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce(function(delta, matcher) {\n return matcher(node, delta);\n }, new Delta());\n } else if (node.nodeType === node.ELEMENT_NODE) {\n return [].reduce.call(node.childNodes || [], (delta, childNode) => {\n let childrenDelta = traverse(childNode);\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n childrenDelta = (childNode[DOM_KEY] || []).reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n } else {\n return new Delta();\n }\n };\n let delta = traverse(this.container);\n // Remove trailing newline\n if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n delta = delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n debug.log('convert', this.container.innerHTML, delta);\n this.container.innerHTML = '';\n return delta;\n }\n\n dangerouslyPasteHTML(index, html, source = Quill.sources.API) {\n if (typeof index === 'string') {\n return this.quill.setContents(this.convert(index), html);\n } else {\n let paste = this.convert(html);\n return this.quill.updateContents(new Delta().retain(index).concat(paste), source);\n }\n }\n\n onPaste(e) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n let range = this.quill.getSelection();\n let delta = new Delta().retain(range.index).delete(range.length);\n let bodyTop = document.body.scrollTop;\n this.container.focus();\n setTimeout(() => {\n this.quill.selection.update(Quill.sources.SILENT);\n delta = delta.concat(this.convert());\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(delta.length() - range.length, Quill.sources.SILENT);\n document.body.scrollTop = bodyTop;\n this.quill.selection.scrollIntoView();\n }, 1);\n }\n}\nClipboard.DEFAULTS = {\n matchers: []\n};\n\n\nfunction computeStyle(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) return {};\n const DOM_KEY = '__ql-computed-style';\n return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n}\n\nfunction deltaEndsWith(delta, text) {\n let endText = \"\";\n for (let i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n let op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1*text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n let style = computeStyle(node);\n return ['block', 'list-item'].indexOf(style.display) > -1;\n}\n\nfunction matchAlias(format, node, delta) {\n return delta.compose(new Delta().retain(delta.length(), { [format]: true }));\n}\n\nfunction matchAttributor(node, delta) {\n let attributes = Parchment.Attributor.Attribute.keys(node);\n let classes = Parchment.Attributor.Class.keys(node);\n let styles = Parchment.Attributor.Style.keys(node);\n let formats = {};\n attributes.concat(classes).concat(styles).forEach((name) => {\n let attr = Parchment.query(name, Parchment.Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n if (ATTRIBUTE_ATTRIBUTORS[name] != null) {\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node);\n }\n if (STYLE_ATTRIBUTORS[name] != null) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node);\n }\n });\n if (Object.keys(formats).length > 0) {\n delta = delta.compose(new Delta().retain(delta.length(), formats));\n }\n return delta;\n}\n\nfunction matchBlot(node, delta) {\n let match = Parchment.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof Parchment.Embed) {\n let embed = {};\n let value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n delta = new Delta().insert(embed, match.formats(node));\n }\n } else if (typeof match.formats === 'function') {\n let formats = { [match.blotName]: match.formats(node) };\n delta = delta.compose(new Delta().retain(delta.length(), formats));\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchNewline(node, delta) {\n if (isLine(node) && !deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchSpacing(node, delta) {\n if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\\n\\n')) {\n let nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);\n if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight*1.5) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n let formats = {};\n let style = node.style || {};\n if (style.fontWeight && computeStyle(node).fontWeight === 'bold') {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = delta.compose(new Delta().retain(delta.length(), formats));\n }\n if (parseFloat(style.textIndent || 0) > 0) { // Could be 0.5in\n delta = new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchText(node, delta) {\n let text = node.data;\n // Word represents empty line with  \n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n // eslint-disable-next-line func-style\n let replacer = function(collapse, match) {\n match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return match.length < 1 && collapse ? ' ' : match;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if ((node.previousSibling == null && isLine(node.parentNode)) ||\n (node.previousSibling != null && isLine(node.previousSibling))) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if ((node.nextSibling == null && isLine(node.parentNode)) ||\n (node.nextSibling != null && isLine(node.nextSibling))) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\n\nexport { Clipboard as default, matchAttributor, matchBlot, matchNewline, matchSpacing, matchText };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/clipboard.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['right', 'center', 'justify']\n};\n\nlet AlignAttribute = new Parchment.Attributor.Attribute('align', 'align', config);\nlet AlignClass = new Parchment.Attributor.Class('align', 'ql-align', config);\nlet AlignStyle = new Parchment.Attributor.Style('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/align.js","import Parchment from 'parchment';\nimport { ColorAttributor } from './color';\n\nlet BackgroundClass = new Parchment.Attributor.Class('background', 'ql-bg', {\n scope: Parchment.Scope.INLINE\n});\nlet BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { BackgroundClass, BackgroundStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/background.js","import Parchment from 'parchment';\n\nclass ColorAttributor extends Parchment.Attributor.Style {\n value(domNode) {\n let value = super.value(domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n return '#' + value.split(',').map(function(component) {\n return ('00' + parseInt(component).toString(16)).slice(-2);\n }).join('');\n }\n}\n\nlet ColorClass = new Parchment.Attributor.Class('color', 'ql-color', {\n scope: Parchment.Scope.INLINE\n});\nlet ColorStyle = new ColorAttributor('color', 'color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/color.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['rtl']\n};\n\nlet DirectionAttribute = new Parchment.Attributor.Attribute('direction', 'dir', config);\nlet DirectionClass = new Parchment.Attributor.Class('direction', 'ql-direction', config);\nlet DirectionStyle = new Parchment.Attributor.Style('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/direction.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.INLINE,\n whitelist: ['serif', 'monospace']\n};\n\nlet FontClass = new Parchment.Attributor.Class('font', 'ql-font', config);\n\nclass FontStyleAttributor extends Parchment.Attributor.Style {\n value(node) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nlet FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/font.js","import Parchment from 'parchment';\n\nlet SizeClass = new Parchment.Attributor.Class('size', 'ql-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['small', 'large', 'huge']\n});\nlet SizeStyle = new Parchment.Attributor.Style('size', 'font-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['10px', '18px', '32px']\n});\n\nexport { SizeClass, SizeStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/size.js","import Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\n\n\nclass History extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.lastRecorded = 0;\n this.ignoreChange = false;\n this.clear();\n this.quill.on(Quill.events.EDITOR_CHANGE, (eventName, delta, oldDelta, source) => {\n if (eventName !== Quill.events.TEXT_CHANGE || this.ignoreChange) return;\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(delta, oldDelta);\n } else {\n this.transform(delta);\n }\n });\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, this.undo.bind(this));\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, this.redo.bind(this));\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, this.redo.bind(this));\n }\n }\n\n change(source, dest) {\n if (this.stack[source].length === 0) return;\n let delta = this.stack[source].pop();\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta[source], Quill.sources.USER);\n this.ignoreChange = false;\n let index = getLastChangeIndex(delta[source]);\n this.quill.setSelection(index);\n this.quill.selection.scrollIntoView();\n this.stack[dest].push(delta);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = this.quill.getContents().diff(oldDelta);\n let timestamp = Date.now();\n if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n let delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta.undo);\n changeDelta = delta.redo.compose(changeDelta);\n } else {\n this.lastRecorded = timestamp;\n }\n this.stack.undo.push({\n redo: changeDelta,\n undo: undoDelta\n });\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta) {\n this.stack.undo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n this.stack.redo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n}\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false\n};\n\nfunction endsWithNewlineChange(delta) {\n let lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(function(attr) {\n return Parchment.query(attr, Parchment.Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(delta) {\n let deleteLength = delta.reduce(function(length, op) {\n length += (op.delete || 0);\n return length;\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\n\nexport { History as default, getLastChangeIndex };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/history.js","import clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\nimport DeltaOp from 'quill-delta/lib/op';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nlet debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\n\nclass Keyboard extends Module {\n static match(evt, binding) {\n binding = normalize(binding);\n if (!!binding.shortKey !== evt[SHORTKEY] && binding.shortKey !== null) return false;\n if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function(key) {\n return (key != SHORTKEY && !!binding[key] !== evt[key] && binding[key] !== null);\n })) {\n return false;\n }\n return binding.key === (evt.which || evt.keyCode);\n }\n\n constructor(quill, options) {\n super(quill, options);\n this.bindings = {};\n Object.keys(this.options.bindings).forEach((name) => {\n if (this.options.bindings[name]) {\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function() {});\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^$/ }, handleDelete);\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n if (/Trident/i.test(navigator.userAgent)) {\n this.addBinding({ key: Keyboard.keys.BACKSPACE, shortKey: true }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE, shortKey: true }, handleDelete);\n }\n this.listen();\n }\n\n addBinding(key, context = {}, handler = {}) {\n let binding = normalize(key);\n if (binding == null || binding.key == null) {\n return debug.warn('Attempted to add invalid keyboard binding', binding);\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler: handler };\n }\n binding = extend(binding, context, handler);\n this.bindings[binding.key] = this.bindings[binding.key] || [];\n this.bindings[binding.key].push(binding);\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', (evt) => {\n if (evt.defaultPrevented) return;\n let which = evt.which || evt.keyCode;\n let bindings = (this.bindings[which] || []).filter(function(binding) {\n return Keyboard.match(evt, binding);\n });\n if (bindings.length === 0) return;\n let range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n let [line, offset] = this.quill.scroll.line(range.index);\n let [leafStart, offsetStart] = this.quill.scroll.leaf(range.index);\n let [leafEnd, offsetEnd] = range.length === 0 ? [leafStart, offsetStart] : this.quill.scroll.leaf(range.index + range.length);\n let prefixText = leafStart instanceof Parchment.Text ? leafStart.value().slice(0, offsetStart) : '';\n let suffixText = leafEnd instanceof Parchment.Text ? leafEnd.value().slice(offsetEnd) : '';\n let curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n offset: offset,\n prefix: prefixText,\n suffix: suffixText\n };\n let prevented = bindings.some((binding) => {\n if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n if (binding.empty != null && binding.empty !== curContext.empty) return false;\n if (binding.offset != null && binding.offset !== curContext.offset) return false;\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(function(name) {\n return curContext.format[name] == null;\n })) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (!Object.keys(binding.format).every(function(name) {\n if (binding.format[name] === true) return curContext.format[name] != null;\n if (binding.format[name] === false) return curContext.format[name] == null;\n return equal(binding.format[name], curContext.format[name]);\n })) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n return binding.handler.call(this, range, curContext) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n}\n\nKeyboard.keys = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n DELETE: 46\n};\n\nKeyboard.DEFAULTS = {\n bindings: {\n 'bold' : makeFormatHandler('bold'),\n 'italic' : makeFormatHandler('italic'),\n 'underline' : makeFormatHandler('underline'),\n 'indent': {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: Keyboard.keys.TAB,\n format: ['blockquote', 'indent', 'list'],\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n }\n },\n 'outdent': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n }\n },\n 'outdent backspace': {\n key: Keyboard.keys.BACKSPACE,\n collapsed: true,\n format: ['blockquote', 'indent', 'list'],\n offset: 0,\n handler: function(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.blockquote != null) {\n this.quill.format('blockquote', false, Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n }\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler: function(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n }\n },\n 'tab': {\n key: Keyboard.keys.TAB,\n handler: function(range, context) {\n if (!context.collapsed) {\n this.quill.scroll.deleteAt(range.index, range.length);\n }\n this.quill.insertText(range.index, '\\t', Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n }\n },\n 'list empty enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['list'],\n empty: true,\n handler: function(range, context) {\n this.quill.format('list', false, Quill.sources.USER);\n if (context.format.indent) {\n this.quill.format('indent', false, Quill.sources.USER);\n }\n }\n },\n 'header enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler: function(range) {\n this.quill.scroll.insertAt(range.index, '\\n');\n this.quill.formatText(range.index + 1, 1, 'header', false, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.selection.scrollIntoView();\n }\n },\n 'list autofill': {\n key: ' ',\n collapsed: true,\n format: { list: false },\n prefix: /^(1\\.|-)$/,\n handler: function(range, context) {\n let length = context.prefix.length;\n this.quill.scroll.deleteAt(range.index - length, length);\n this.quill.formatLine(range.index - length, 1, 'list', length === 1 ? 'bullet' : 'ordered', Quill.sources.USER);\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n }\n }\n }\n};\n\n\nfunction handleBackspace(range, context) {\n if (range.index === 0) return;\n let [line, ] = this.quill.scroll.line(range.index);\n let formats = {};\n if (context.offset === 0) {\n let curFormats = line.formats();\n let prevFormats = this.quill.getFormat(range.index-1, 1);\n formats = DeltaOp.attributes.diff(curFormats, prevFormats) || {};\n }\n this.quill.deleteText(range.index-1, 1, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index-1, 1, formats, Quill.sources.USER);\n }\n this.quill.selection.scrollIntoView();\n}\n\nfunction handleDelete(range) {\n if (range.index >= this.quill.getLength() - 1) return;\n this.quill.deleteText(range.index, 1, Quill.sources.USER);\n}\n\nfunction handleDeleteRange(range) {\n this.quill.deleteText(range, Quill.sources.USER);\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.quill.selection.scrollIntoView();\n}\n\nfunction handleEnter(range, context) {\n if (range.length > 0) {\n this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n }\n let lineFormats = Object.keys(context.format).reduce(function(lineFormats, format) {\n if (Parchment.query(format, Parchment.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n lineFormats[format] = context.format[format];\n }\n return lineFormats;\n }, {});\n this.quill.insertText(range.index, '\\n', lineFormats, Quill.sources.USER);\n this.quill.selection.scrollIntoView();\n Object.keys(context.format).forEach((name) => {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'link') return;\n this.quill.format(name, context.format[name], Quill.sources.USER);\n });\n}\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: Keyboard.keys.TAB,\n shiftKey: !indent,\n format: {'code-block': true },\n handler: function(range) {\n let CodeBlock = Parchment.query('code-block');\n let index = range.index, length = range.length;\n let [block, offset] = this.quill.scroll.descendant(CodeBlock, index);\n if (block == null) return;\n let scrollOffset = this.quill.scroll.offset(block);\n let start = block.newlineIndex(offset, true) + 1;\n let end = block.newlineIndex(scrollOffset + offset + length);\n let lines = block.domNode.textContent.slice(start, end).split('\\n');\n offset = 0;\n lines.forEach((line, i) => {\n if (indent) {\n block.insertAt(start + offset, CodeBlock.TAB);\n offset += CodeBlock.TAB.length;\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.startsWith(CodeBlock.TAB)) {\n block.deleteAt(start + offset, CodeBlock.TAB.length);\n offset -= CodeBlock.TAB.length;\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n offset += line.length + 1;\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n }\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0].toUpperCase(),\n shortKey: true,\n handler: function(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n }\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n return normalize({ key: binding });\n }\n if (typeof binding === 'object') {\n binding = clone(binding, false);\n }\n if (typeof binding.key === 'string') {\n if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n binding.key = Keyboard.keys[binding.key.toUpperCase()];\n } else if (binding.key.length === 1) {\n binding.key = binding.key.toUpperCase().charCodeAt(0);\n } else {\n return null;\n }\n }\n return binding;\n}\n\n\nexport default Keyboard;\n\n\n\n// WEBPACK FOOTER //\n// ./modules/keyboard.js","import Parchment from 'parchment';\n\nclass IdentAttributor extends Parchment.Attributor.Class {\n add(node, value) {\n if (value === '+1' || value === '-1') {\n let indent = this.value(node) || 0;\n value = (value === '+1' ? (indent + 1) : (indent - 1));\n }\n if (value === 0) {\n this.remove(node);\n return true;\n } else {\n return super.add(node, value);\n }\n }\n\n value(node) {\n return parseInt(super.value(node)) || undefined; // Don't return NaN\n }\n}\n\nlet IndentClass = new IdentAttributor('indent', 'ql-indent', {\n scope: Parchment.Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n});\n\nexport { IndentClass };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/indent.js","import Block from '../blots/block';\n\n\nclass Blockquote extends Block {}\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\n\nexport default Blockquote;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/blockquote.js","import Block from '../blots/block';\n\n\nclass Header extends Block {\n static formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\n\nexport default Header;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/header.js","import Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Container from '../blots/container';\n\n\nclass ListItem extends Block {\n static formats(domNode) {\n return domNode.tagName === this.tagName ? undefined : super.formats(domNode);\n }\n\n format(name, value) {\n if (name === List.blotName && !value) {\n this.replaceWith(Parchment.create(this.statics.scope));\n } else {\n super.format(name, value);\n }\n }\n\n remove() {\n if (this.prev == null && this.next == null) {\n this.parent.remove();\n } else {\n super.remove();\n }\n }\n\n replaceWith(name, value) {\n this.parent.isolate(this.offset(this.parent), this.length());\n if (name === this.parent.statics.blotName) {\n this.parent.replaceWith(name, value);\n return this;\n } else {\n this.parent.unwrap();\n return super.replaceWith(name, value);\n }\n }\n}\nListItem.blotName = 'list-item';\nListItem.tagName = 'LI';\n\n\nclass List extends Container {\n static create(value) {\n if (value === 'ordered') {\n value = 'OL';\n } else if (value === 'bullet') {\n value = 'UL';\n }\n return super.create(value);\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'OL') return 'ordered';\n if (domNode.tagName === 'UL') return 'bullet';\n return undefined;\n }\n\n format(name, value) {\n if (this.children.length > 0) {\n this.children.tail.format(name, value);\n }\n }\n\n formats() {\n // We don't inherit from FormatBlot\n return { [this.statics.blotName]: this.statics.formats(this.domNode) };\n }\n\n insertBefore(blot, ref) {\n if (blot instanceof ListItem) {\n super.insertBefore(blot, ref);\n } else {\n let index = ref == null ? this.length() : ref.offset(this);\n let after = this.split(index);\n after.parent.insertBefore(blot, after);\n }\n }\n\n optimize() {\n super.optimize();\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n next.domNode.tagName === this.domNode.tagName) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n if (target.statics.blotName !== this.statics.blotName) {\n let item = Parchment.create(this.statics.defaultChild);\n target.moveChildren(item);\n this.appendChild(item);\n }\n super.replace(target);\n }\n}\nList.blotName = 'list';\nList.scope = Parchment.Scope.BLOCK_BLOT;\nList.tagName = ['OL', 'UL'];\nList.defaultChild = 'list-item';\nList.allowedChildren = [ListItem];\n\n\nexport { ListItem, List as default };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/list.js","import Inline from '../blots/inline';\n\nclass Bold extends Inline {\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize() {\n super.optimize();\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexport default Bold;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/bold.js","import Bold from './bold';\n\nclass Italic extends Bold { }\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexport default Italic;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/italic.js","import Inline from '../blots/inline';\n\n\nclass Link extends Inline {\n static create(value) {\n let node = super.create(value);\n value = this.sanitize(value);\n node.setAttribute('href', value);\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url) {\n return sanitize(url, ['http', 'https', 'mailto']) ? url : this.SANITIZED_URL;\n }\n\n format(name, value) {\n if (name !== this.statics.blotName || !value) return super.format(name, value);\n value = this.constructor.sanitize(value);\n this.domNode.setAttribute('href', value);\n }\n}\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\n\n\nfunction sanitize(url, protocols) {\n let anchor = document.createElement('a');\n anchor.href = url;\n let protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\n\nexport { Link as default, sanitize };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/link.js","import Inline from '../blots/inline';\n\nclass Script extends Inline {\n static create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n } else if (value === 'sub') {\n return document.createElement('sub');\n } else {\n return super.create(value);\n }\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexport default Script;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/script.js","import Inline from '../blots/inline';\n\nclass Strike extends Inline { }\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexport default Strike;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/strike.js","import Inline from '../blots/inline';\n\nclass Underline extends Inline { }\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexport default Underline;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/underline.js","import Embed from '../blots/embed';\nimport { sanitize } from '../formats/link';\n\nconst ATTRIBUTES = [\n 'alt',\n 'height',\n 'width'\n];\n\n\nclass Image extends Embed {\n static create(value) {\n let node = super.create(value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static sanitize(url) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\n\nexport default Image;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/image.js","import { BlockEmbed } from '../blots/block';\nimport Link from '../formats/link';\n\nconst ATTRIBUTES = [\n 'height',\n 'width'\n];\n\n\nclass Video extends BlockEmbed {\n static create(value) {\n let node = super.create(value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static sanitize(url) {\n return Link.sanitize(url);\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\n\nexport default Video;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/video.js","import Embed from '../blots/embed';\nimport Quill from '../core/quill';\n\n\nclass FormulaBlot extends Embed {\n static create(value) {\n let node = super.create(value);\n if (typeof value === 'string') {\n window.katex.render(value, node);\n node.setAttribute('data-value', value);\n }\n node.setAttribute('contenteditable', false);\n return node;\n }\n\n static value(domNode) {\n return domNode.getAttribute('data-value');\n }\n\n index() {\n return 1;\n }\n}\nFormulaBlot.blotName = 'formula';\nFormulaBlot.className = 'ql-formula';\nFormulaBlot.tagName = 'SPAN';\n\n\nfunction Formula() {\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n Quill.register(FormulaBlot, true);\n}\n\n\nexport { FormulaBlot, Formula as default };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/formula.js","import Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\nimport CodeBlock from '../formats/code';\n\n\nclass SyntaxCodeBlock extends CodeBlock {\n replaceWith(block) {\n this.domNode.textContent = this.domNode.textContent;\n this.attach();\n super.replaceWith(block);\n }\n\n highlight(highlight) {\n if (this.cachedHTML !== this.domNode.innerHTML) {\n let text = this.domNode.textContent;\n if (text.trim().length > 0 || this.cachedHTML == null) {\n this.domNode.innerHTML = highlight(text);\n this.attach();\n }\n this.cachedHTML = this.domNode.innerHTML;\n }\n }\n}\nSyntaxCodeBlock.className = 'ql-syntax';\n\n\nlet CodeToken = new Parchment.Attributor.Class('token', 'hljs', {\n scope: Parchment.Scope.INLINE\n});\n\n\nclass Syntax extends Module {\n constructor(quill, options) {\n super(quill, options);\n if (typeof this.options.highlight !== 'function') {\n throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');\n }\n Quill.register(CodeToken, true);\n Quill.register(SyntaxCodeBlock, true);\n let timer = null;\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n if (timer != null) return;\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, 100);\n });\n this.highlight();\n }\n\n highlight() {\n if (this.quill.selection.composing) return;\n let range = this.quill.getSelection();\n this.quill.scroll.descendants(SyntaxCodeBlock).forEach((code) => {\n code.highlight(this.options.highlight);\n });\n this.quill.update(Quill.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n }\n }\n}\nSyntax.DEFAULTS = {\n highlight: (function() {\n if (window.hljs == null) return null;\n return function(text) {\n let result = window.hljs.highlightAuto(text);\n return result.value;\n };\n })()\n};\n\n\nexport { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default};\n\n\n\n// WEBPACK FOOTER //\n// ./modules/syntax.js","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nlet debug = logger('quill:toolbar');\n\n\nclass Toolbar extends Module {\n constructor(quill, options) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n let container = document.createElement('div');\n addControls(container, this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n return debug.error('Container required for toolbar', this.options);\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n Object.keys(this.options.handlers).forEach((format) => {\n this.addHandler(format, this.options.handlers[format]);\n });\n [].forEach.call(this.container.querySelectorAll('button, select'), (input) => {\n this.attach(input);\n });\n this.quill.on(Quill.events.EDITOR_CHANGE, (type, range) => {\n if (type === Quill.events.SELECTION_CHANGE) {\n this.update(range);\n }\n });\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n let [range, ] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n\n attach(input) {\n let format = [].find.call(input.classList, (className) => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (this.handlers[format] == null) {\n if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n debug.warn('ignoring attaching to disabled format', format, input);\n return;\n }\n if (Parchment.query(format) == null) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n }\n let eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, (e) => {\n let value;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n let selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n let [range, ] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (Parchment.query(format).prototype instanceof Parchment.Embed) {\n value = prompt(`Enter ${format}`);\n if (!value) return;\n this.quill.updateContents(new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ [format]: value })\n , Quill.sources.USER);\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n // TODO use weakmap\n this.controls.push([format, input]);\n }\n\n update(range) {\n let formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(function(pair) {\n let [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\\\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else {\n if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n let isActive = formats[format] === input.getAttribute('value') ||\n (formats[format] != null && formats[format].toString() === input.getAttribute('value')) ||\n (formats[format] == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\n\nfunction addButton(container, format, value) {\n let input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add('ql-' + format);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(function(controls) {\n let group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(function(control) {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n let format = Object.keys(control)[0];\n let value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n let input = document.createElement('select');\n input.classList.add('ql-' + format);\n values.forEach(function(value) {\n let option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean: function() {\n let range = this.quill.getSelection();\n if (range == null) return;\n if (range.length == 0) {\n let formats = this.quill.getFormat();\n Object.keys(formats).forEach((name) => {\n // Clean functionality in existing apps only clean inline formats\n if (Parchment.query(name, Parchment.Scope.INLINE) != null) {\n this.quill.format(name, false);\n }\n });\n } else {\n this.quill.removeFormat(range, Quill.sources.USER);\n }\n },\n direction: function(value) {\n let align = this.quill.getFormat()['align'];\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n link: function(value) {\n if (value === true) {\n value = prompt('Enter link URL:');\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n indent: function(value) {\n let range = this.quill.getSelection();\n let formats = this.quill.getFormat(range);\n let indent = parseInt(formats.indent || 0);\n if (value === '+1' || value === '-1') {\n let modifier = (value === '+1') ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n }\n }\n}\n\n\nexport { Toolbar as default, addControls };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/toolbar.js","module.exports = {\n 'align': {\n '' : require('../assets/icons/align-left.svg'),\n 'center' : require('../assets/icons/align-center.svg'),\n 'right' : require('../assets/icons/align-right.svg'),\n 'justify' : require('../assets/icons/align-justify.svg')\n },\n 'background': require('../assets/icons/background.svg'),\n 'blockquote': require('../assets/icons/blockquote.svg'),\n 'bold' : require('../assets/icons/bold.svg'),\n 'clean' : require('../assets/icons/clean.svg'),\n 'code' : require('../assets/icons/code.svg'),\n 'code-block': require('../assets/icons/code.svg'),\n 'color' : require('../assets/icons/color.svg'),\n 'direction' : {\n '' : require('../assets/icons/direction-ltr.svg'),\n 'rtl' : require('../assets/icons/direction-rtl.svg')\n },\n 'float': {\n 'center' : require('../assets/icons/float-center.svg'),\n 'full' : require('../assets/icons/float-full.svg'),\n 'left' : require('../assets/icons/float-left.svg'),\n 'right' : require('../assets/icons/float-right.svg')\n },\n 'formula' : require('../assets/icons/formula.svg'),\n 'header': {\n '1' : require('../assets/icons/header.svg'),\n '2' : require('../assets/icons/header-2.svg')\n },\n 'italic' : require('../assets/icons/italic.svg'),\n 'image' : require('../assets/icons/image.svg'),\n 'indent': {\n '+1' : require('../assets/icons/indent.svg'),\n '-1' : require('../assets/icons/outdent.svg')\n },\n 'link' : require('../assets/icons/link.svg'),\n 'list': {\n 'ordered' : require('../assets/icons/list-ordered.svg'),\n 'bullet' : require('../assets/icons/list-bullet.svg')\n },\n 'script': {\n 'sub' : require('../assets/icons/subscript.svg'),\n 'super' : require('../assets/icons/superscript.svg'),\n },\n 'strike' : require('../assets/icons/strike.svg'),\n 'underline' : require('../assets/icons/underline.svg'),\n 'video' : require('../assets/icons/video.svg')\n};\n\n\n\n// WEBPACK FOOTER //\n// ./ui/icons.js","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-left.svg\n// module id = 73\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-center.svg\n// module id = 74\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-right.svg\n// module id = 75\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-justify.svg\n// module id = 76\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/background.svg\n// module id = 77\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/blockquote.svg\n// module id = 78\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/bold.svg\n// module id = 79\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/clean.svg\n// module id = 80\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/code.svg\n// module id = 81\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/color.svg\n// module id = 82\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/direction-ltr.svg\n// module id = 83\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/direction-rtl.svg\n// module id = 84\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-center.svg\n// module id = 85\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-full.svg\n// module id = 86\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-left.svg\n// module id = 87\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-right.svg\n// module id = 88\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/formula.svg\n// module id = 89\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/header.svg\n// module id = 90\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/header-2.svg\n// module id = 91\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/italic.svg\n// module id = 92\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/image.svg\n// module id = 93\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/indent.svg\n// module id = 94\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/outdent.svg\n// module id = 95\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/link.svg\n// module id = 96\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-ordered.svg\n// module id = 97\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-bullet.svg\n// module id = 98\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/subscript.svg\n// module id = 99\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/superscript.svg\n// module id = 100\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/strike.svg\n// module id = 101\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/underline.svg\n// module id = 102\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/video.svg\n// module id = 103\n// module chunks = 0","import DropdownIcon from '../assets/icons/dropdown.svg';\n\n\nclass Picker {\n constructor(select) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n this.select.parentNode.insertBefore(this.container, this.select);\n this.label.addEventListener('click', () => {\n this.container.classList.toggle('ql-expanded');\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n buildItem(option) {\n let item = document.createElement('span');\n item.classList.add('ql-picker-item');\n if (option.hasAttribute('value')) {\n item.setAttribute('data-value', option.getAttribute('value'));\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n return item;\n }\n\n buildLabel() {\n let label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = DropdownIcon;\n this.container.appendChild(label);\n return label;\n }\n\n buildOptions() {\n let options = document.createElement('span');\n options.classList.add('ql-picker-options');\n [].slice.call(this.select.options).forEach((option) => {\n let item = this.buildItem(option);\n options.appendChild(item);\n if (option.hasAttribute('selected')) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n\n buildPicker() {\n [].slice.call(this.select.attributes).forEach((item) => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n\n close() {\n this.container.classList.remove('ql-expanded');\n }\n\n selectItem(item, trigger = false) {\n let selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item != null) {\n item.classList.add('ql-selected');\n this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);\n if (item.hasAttribute('data-value')) {\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n if (typeof Event === 'function') {\n this.select.dispatchEvent(new Event('change'));\n } else if (typeof Event === 'object') { // IE11\n let event = document.createEvent('Event');\n event.initEvent('change', true, true);\n this.select.dispatchEvent(event);\n }\n this.close();\n }\n } else {\n this.label.removeAttribute('data-value');\n this.label.removeAttribute('data-label');\n }\n }\n\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n let item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex];\n option = this.select.options[this.select.selectedIndex];\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n let isActive = option != null && option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n\n\nexport default Picker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/picker.js","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/dropdown.svg\n// module id = 105\n// module chunks = 0","import Picker from './picker';\n\n\nclass ColorPicker extends Picker {\n constructor(select, label) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n [].slice.call(this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function(item) {\n item.classList.add('ql-primary');\n });\n }\n\n buildItem(option) {\n let item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n let colorLabel = this.label.querySelector('.ql-color-label');\n let value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n\n\nexport default ColorPicker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/color-picker.js","import Picker from './picker';\n\n\nclass IconPicker extends Picker {\n constructor(select, icons) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n [].forEach.call(this.container.querySelectorAll('.ql-picker-item'), (item) => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n });\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n item = item || this.defaultItem;\n this.label.innerHTML = item.innerHTML;\n }\n}\n\n\nexport default IconPicker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/icon-picker.js","class Tooltip {\n constructor(quill, boundsContainer) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n this.root.innerHTML = this.constructor.TEMPLATE;\n let offset = parseInt(window.getComputedStyle(this.root).marginTop);\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = (-1*this.quill.root.scrollTop) + offset + 'px';\n this.checkBounds();\n });\n this.hide();\n }\n\n checkBounds() {\n this.root.classList.toggle('ql-out-top', this.root.offsetTop <= 0);\n this.root.classList.remove('ql-out-bottom');\n this.root.classList.toggle('ql-out-bottom', this.root.offsetTop + this.root.offsetHeight >= this.quill.root.offsetHeight);\n }\n\n hide() {\n this.root.classList.add('ql-hidden');\n }\n\n position(reference) {\n let left = reference.left + reference.width/2 - this.root.offsetWidth/2;\n let top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = left + 'px';\n this.root.style.top = top + 'px';\n let containerBounds = this.boundsContainer.getBoundingClientRect();\n let rootBounds = this.root.getBoundingClientRect();\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = (left + shift) + 'px';\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = (left + shift) + 'px';\n }\n this.checkBounds();\n return shift;\n }\n\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n\n\nexport default Tooltip;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/tooltip.js","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\n\nconst TOOLBAR_CONFIG = [\n ['bold', 'italic', 'link'],\n [{ header: 1 }, { header: 2 }, 'blockquote']\n];\n\nclass BubbleTheme extends BaseTheme {\n constructor(quill, options) {\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n\n extendToolbar(toolbar) {\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), icons);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), icons);\n }\n}\nBubbleTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function(value) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n }\n }\n }\n }\n});\n\n\nclass BubbleTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.quill.on(Emitter.events.EDITOR_CHANGE, (type, range) => {\n if (type !== Emitter.events.SELECTION_CHANGE) return;\n if (range != null && range.length > 0) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = this.root.offsetWidth + 'px';\n let lines = this.quill.scroll.lines(range.index, range.length);\n if (lines.length === 1) {\n this.position(this.quill.getBounds(range));\n } else {\n let lastLine = lines[lines.length - 1];\n let index = lastLine.offset(this.quill.scroll);\n let length = Math.min(lastLine.length() - 1, range.index + range.length - index);\n let bounds = this.quill.getBounds(new Range(index, length));\n this.position(bounds);\n }\n } else if (document.activeElement !== this.textbox && this.quill.hasFocus()) {\n this.hide();\n }\n });\n }\n\n listen() {\n super.listen();\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(Emitter.events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n let range = this.quill.getSelection();\n if (range != null) {\n this.position(this.quill.getBounds(range));\n }\n }, 1);\n });\n }\n\n cancel() {\n this.show();\n }\n\n position(reference) {\n let shift = super.position(reference);\n let arrow = this.root.querySelector('.ql-tooltip-arrow');\n arrow.style.marginLeft = '';\n if (shift === 0) return shift;\n arrow.style.marginLeft = (-1*shift - arrow.offsetWidth/2) + 'px';\n }\n}\nBubbleTooltip.TEMPLATE = [\n '',\n '
    ',\n '',\n '',\n '
    '\n].join('');\n\n\nexport { BubbleTooltip, BubbleTheme as default };\n\n\n\n// WEBPACK FOOTER //\n// ./themes/bubble.js","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Emitter from '../core/emitter';\nimport Keyboard from '../modules/keyboard';\nimport Theme from '../core/theme';\nimport ColorPicker from '../ui/color-picker';\nimport IconPicker from '../ui/icon-picker';\nimport Picker from '../ui/picker';\nimport Tooltip from '../ui/tooltip';\n\n\nconst ALIGNS = [ false, 'center', 'right', 'justify' ];\n\nconst COLORS = [\n \"#000000\", \"#e60000\", \"#ff9900\", \"#ffff00\", \"#008a00\", \"#0066cc\", \"#9933ff\",\n \"#ffffff\", \"#facccc\", \"#ffebcc\", \"#ffffcc\", \"#cce8cc\", \"#cce0f5\", \"#ebd6ff\",\n \"#bbbbbb\", \"#f06666\", \"#ffc266\", \"#ffff66\", \"#66b966\", \"#66a3e0\", \"#c285ff\",\n \"#888888\", \"#a10000\", \"#b26b00\", \"#b2b200\", \"#006100\", \"#0047b2\", \"#6b24b2\",\n \"#444444\", \"#5c0000\", \"#663d00\", \"#666600\", \"#003700\", \"#002966\", \"#3d1466\"\n];\n\nconst FONTS = [ false, 'serif', 'monospace' ];\n\nconst HEADERS = [ '1', '2', '3', false ];\n\nconst SIZES = [ 'small', false, 'large', 'huge' ];\n\n\nclass BaseTheme extends Theme {\n constructor(quill, options) {\n super(quill, options);\n let listener = (e) => {\n if (!document.body.contains(quill.root)) {\n return document.body.removeEventListener('click', listener);\n }\n if (this.tooltip != null && !this.tooltip.root.contains(e.target) &&\n document.activeElement !== this.tooltip.textbox && !this.quill.hasFocus()) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach(function(picker) {\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n document.body.addEventListener('click', listener);\n }\n\n addModule(name) {\n let module = super.addModule(name);\n if (name === 'toolbar') {\n this.extendToolbar(module);\n }\n return module;\n }\n\n buildButtons(buttons, icons) {\n buttons.forEach((button) => {\n let className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach((name) => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n button.innerHTML = icons[name][''] + icons[name]['rtl'];\n } else if (typeof icons[name] === 'string') {\n button.innerHTML = icons[name];\n } else {\n let value = button.value || '';\n if (value != null && icons[name][value]) {\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n\n buildPickers(selects, icons) {\n this.pickers = selects.map((select) => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n return new IconPicker(select, icons.align);\n } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {\n let format = select.classList.contains('ql-background') ? 'background' : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');\n }\n return new ColorPicker(select, icons[format]);\n } else {\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new Picker(select);\n }\n });\n let update = () => {\n this.pickers.forEach(function(picker) {\n picker.update();\n });\n };\n this.quill.on(Emitter.events.SELECTION_CHANGE, update)\n .on(Emitter.events.SCROLL_OPTIMIZE, update);\n }\n}\nBaseTheme.DEFAULTS = extend(true, {}, Theme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula: function() {\n this.quill.theme.tooltip.edit('formula');\n },\n image: function() {\n let fileInput = this.container.querySelector('input.ql-image[type=file]');\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon, image/svg+xml');\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n if (fileInput.files != null && fileInput.files[0] != null) {\n let reader = new FileReader();\n reader.onload = (e) => {\n let range = this.quill.getSelection(true);\n this.quill.updateContents(new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ image: e.target.result })\n , Emitter.sources.USER);\n fileInput.value = \"\";\n }\n reader.readAsDataURL(fileInput.files[0]);\n }\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video: function() {\n this.quill.theme.tooltip.edit('video');\n }\n }\n }\n }\n});\n\n\nclass BaseTooltip extends Tooltip {\n constructor(quill, boundsContainer) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n\n listen() {\n this.textbox.addEventListener('keydown', (event) => {\n if (Keyboard.match(event, 'enter')) {\n this.save();\n event.preventDefault();\n } else if (Keyboard.match(event, 'escape')) {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n\n cancel() {\n this.hide();\n }\n\n edit(mode = 'link', preview = null) {\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n this.position(this.quill.getBounds(this.quill.selection.savedRange));\n this.textbox.select();\n this.textbox.setAttribute('placeholder', this.textbox.getAttribute(`data-${mode}`) || '');\n this.root.setAttribute('data-mode', mode);\n }\n\n restoreFocus() {\n let scrollTop = this.quill.root.scrollTop;\n this.quill.focus();\n this.quill.root.scrollTop = scrollTop;\n }\n\n save() {\n let value = this.textbox.value;\n switch(this.root.getAttribute('data-mode')) {\n case 'link': {\n let scrollTop = this.quill.root.scrollTop;\n if (this.linkRange) {\n this.quill.formatText(this.linkRange, 'link', value, Emitter.sources.USER);\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, Emitter.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video': {\n let match = value.match(/^(https?):\\/\\/(www\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/) ||\n value.match(/^(https?):\\/\\/(www\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n value = match[1] + '://www.youtube.com/embed/' + match[3] + '?showinfo=0';\n } else if (match = value.match(/^(https?):\\/\\/(www\\.)?vimeo\\.com\\/(\\d+)/)) { // eslint-disable-line no-cond-assign\n value = match[1] + '://player.vimeo.com/video/' + match[3] + '/';\n }\n } // eslint-disable-next-line no-fallthrough\n case 'formula': {\n let range = this.quill.getSelection(true);\n let index = range.index + range.length;\n if (range != null) {\n this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, Emitter.sources.USER);\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER);\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER);\n }\n break;\n }\n default:\n }\n this.textbox.value = '';\n this.hide();\n }\n}\n\n\nfunction fillSelect(select, values, defaultValue = false) {\n values.forEach(function(value) {\n let option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', value);\n }\n select.appendChild(option);\n });\n}\n\n\nexport { BaseTooltip, BaseTheme as default };\n\n\n\n// WEBPACK FOOTER //\n// ./themes/base.js","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport LinkBlot from '../formats/link';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\n\nconst TOOLBAR_CONFIG = [\n [{ header: ['1', '2', '3', false] }],\n ['bold', 'italic', 'underline', 'link'],\n [{ list: 'ordered' }, { list: 'bullet' }],\n ['clean']\n];\n\nclass SnowTheme extends BaseTheme {\n constructor(quill, options) {\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n\n extendToolbar(toolbar) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), icons);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), icons);\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function(range, context) {\n toolbar.handlers['link'].call(toolbar, !context.format.link);\n });\n }\n }\n}\nSnowTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function(value) {\n if (value) {\n let range = this.quill.getSelection();\n if (range == null || range.length == 0) return;\n let preview = this.quill.getText(range);\n if (/^\\S+@\\S+\\.\\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {\n preview = 'mailto:' + preview;\n }\n let tooltip = this.quill.theme.tooltip;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n }\n }\n }\n }\n});\n\n\nclass SnowTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.preview = this.root.querySelector('a.ql-preview');\n }\n\n listen() {\n super.listen();\n this.root.querySelector('a.ql-action').addEventListener('click', (event) => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n this.root.querySelector('a.ql-remove').addEventListener('click', (event) => {\n if (this.linkRange != null) {\n this.restoreFocus();\n this.quill.formatText(this.linkRange, 'link', false, Emitter.sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(Emitter.events.SELECTION_CHANGE, (range) => {\n if (range == null) return;\n if (range.length === 0) {\n let [link, offset] = this.quill.scroll.descendant(LinkBlot, range.index);\n if (link != null) {\n this.linkRange = new Range(range.index - offset, link.length());\n let preview = LinkBlot.formats(link.domNode);\n this.preview.textContent = preview;\n this.preview.setAttribute('href', preview);\n this.show();\n this.position(this.quill.getBounds(this.linkRange));\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.hide();\n });\n }\n\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\nSnowTooltip.TEMPLATE = [\n '',\n '',\n '',\n ''\n].join('');\n\n\nexport default SnowTheme;\n\n\n\n// WEBPACK FOOTER //\n// ./themes/snow.js","var pSlice = Array.prototype.slice;\nvar objectKeys = require('./lib/keys.js');\nvar isArguments = require('./lib/is_arguments.js');\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n if (!opts) opts = {};\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected, opts);\n }\n}\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n}\n\nfunction objEquiv(a, b, opts) {\n var i, key;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n var ka = objectKeys(a),\n kb = objectKeys(b);\n } catch (e) {//happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) return false;\n }\n return typeof a === typeof b;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/~/deep-equal/index.js\n// module id = 22\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff -Nru bibledit-5.0.912/quill/1.1.5/quill.snow.css bibledit-5.0.922/quill/1.1.5/quill.snow.css --- bibledit-5.0.912/quill/1.1.5/quill.snow.css 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.1.5/quill.snow.css 2017-02-16 08:34:37.000000000 +0000 @@ -0,0 +1,909 @@ +/*! + * Quill Editor v1.1.5 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + */ +.ql-container { + box-sizing: border-box; + font-family: Helvetica, Arial, sans-serif; + font-size: 13px; + height: 100%; + margin: 0px; + position: relative; +} +.ql-container.ql-disabled .ql-tooltip { + visibility: hidden; +} +.ql-clipboard { + left: -100000px; + height: 1px; + overflow-y: hidden; + position: absolute; + top: 50%; +} +.ql-clipboard p { + margin: 0; + padding: 0; +} +.ql-editor { + box-sizing: border-box; + cursor: text; + line-height: 1.42; + height: 100%; + outline: none; + overflow-y: auto; + padding: 12px 15px; + tab-size: 4; + -moz-tab-size: 4; + text-align: left; + white-space: pre-wrap; + word-wrap: break-word; +} +.ql-editor p, +.ql-editor ol, +.ql-editor ul, +.ql-editor pre, +.ql-editor blockquote, +.ql-editor h1, +.ql-editor h2, +.ql-editor h3, +.ql-editor h4, +.ql-editor h5, +.ql-editor h6 { + margin: 0; + padding: 0; + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol, +.ql-editor ul { + padding-left: 1.5em; +} +.ql-editor ol > li, +.ql-editor ul > li { + list-style-type: none; +} +.ql-editor ul > li::before { + content: '\25CF'; +} +.ql-editor li::before { + display: inline-block; + margin-right: 0.3em; + text-align: right; + white-space: nowrap; + width: 1.2em; +} +.ql-editor li:not(.ql-direction-rtl)::before { + margin-left: -1.5em; +} +.ql-editor ol li, +.ql-editor ul li { + padding-left: 1.5em; +} +.ql-editor ol li { + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; + counter-increment: list-num; +} +.ql-editor ol li:before { + content: counter(list-num, decimal) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-increment: list-1; +} +.ql-editor ol li.ql-indent-1:before { + content: counter(list-1, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-2 { + counter-increment: list-2; +} +.ql-editor ol li.ql-indent-2:before { + content: counter(list-2, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-2 { + counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-3 { + counter-increment: list-3; +} +.ql-editor ol li.ql-indent-3:before { + content: counter(list-3, decimal) '. '; +} +.ql-editor ol li.ql-indent-3 { + counter-reset: list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-4 { + counter-increment: list-4; +} +.ql-editor ol li.ql-indent-4:before { + content: counter(list-4, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-4 { + counter-reset: list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-5 { + counter-increment: list-5; +} +.ql-editor ol li.ql-indent-5:before { + content: counter(list-5, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-5 { + counter-reset: list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-6 { + counter-increment: list-6; +} +.ql-editor ol li.ql-indent-6:before { + content: counter(list-6, decimal) '. '; +} +.ql-editor ol li.ql-indent-6 { + counter-reset: list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-7 { + counter-increment: list-7; +} +.ql-editor ol li.ql-indent-7:before { + content: counter(list-7, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-7 { + counter-reset: list-8 list-9; +} +.ql-editor ol li.ql-indent-8 { + counter-increment: list-8; +} +.ql-editor ol li.ql-indent-8:before { + content: counter(list-8, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-8 { + counter-reset: list-9; +} +.ql-editor ol li.ql-indent-9 { + counter-increment: list-9; +} +.ql-editor ol li.ql-indent-9:before { + content: counter(list-9, decimal) '. '; +} +.ql-editor .ql-indent-1:not(.ql-direction-rtl) { + padding-left: 3em; +} +.ql-editor li.ql-indent-1:not(.ql-direction-rtl) { + padding-left: 4.5em; +} +.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 3em; +} +.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 4.5em; +} +.ql-editor .ql-indent-2:not(.ql-direction-rtl) { + padding-left: 6em; +} +.ql-editor li.ql-indent-2:not(.ql-direction-rtl) { + padding-left: 7.5em; +} +.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 6em; +} +.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 7.5em; +} +.ql-editor .ql-indent-3:not(.ql-direction-rtl) { + padding-left: 9em; +} +.ql-editor li.ql-indent-3:not(.ql-direction-rtl) { + padding-left: 10.5em; +} +.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 9em; +} +.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 10.5em; +} +.ql-editor .ql-indent-4:not(.ql-direction-rtl) { + padding-left: 12em; +} +.ql-editor li.ql-indent-4:not(.ql-direction-rtl) { + padding-left: 13.5em; +} +.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 12em; +} +.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 13.5em; +} +.ql-editor .ql-indent-5:not(.ql-direction-rtl) { + padding-left: 15em; +} +.ql-editor li.ql-indent-5:not(.ql-direction-rtl) { + padding-left: 16.5em; +} +.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 15em; +} +.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 16.5em; +} +.ql-editor .ql-indent-6:not(.ql-direction-rtl) { + padding-left: 18em; +} +.ql-editor li.ql-indent-6:not(.ql-direction-rtl) { + padding-left: 19.5em; +} +.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 18em; +} +.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 19.5em; +} +.ql-editor .ql-indent-7:not(.ql-direction-rtl) { + padding-left: 21em; +} +.ql-editor li.ql-indent-7:not(.ql-direction-rtl) { + padding-left: 22.5em; +} +.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 21em; +} +.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 22.5em; +} +.ql-editor .ql-indent-8:not(.ql-direction-rtl) { + padding-left: 24em; +} +.ql-editor li.ql-indent-8:not(.ql-direction-rtl) { + padding-left: 25.5em; +} +.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 24em; +} +.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 25.5em; +} +.ql-editor .ql-indent-9:not(.ql-direction-rtl) { + padding-left: 27em; +} +.ql-editor li.ql-indent-9:not(.ql-direction-rtl) { + padding-left: 28.5em; +} +.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 27em; +} +.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 28.5em; +} +.ql-editor .ql-video { + display: block; + max-width: 100%; +} +.ql-editor .ql-video.ql-align-center { + margin: 0 auto; +} +.ql-editor .ql-video.ql-align-right { + margin: 0 0 0 auto; +} +.ql-editor .ql-bg-black { + background-color: #000; +} +.ql-editor .ql-bg-red { + background-color: #e60000; +} +.ql-editor .ql-bg-orange { + background-color: #f90; +} +.ql-editor .ql-bg-yellow { + background-color: #ff0; +} +.ql-editor .ql-bg-green { + background-color: #008a00; +} +.ql-editor .ql-bg-blue { + background-color: #06c; +} +.ql-editor .ql-bg-purple { + background-color: #93f; +} +.ql-editor .ql-color-white { + color: #fff; +} +.ql-editor .ql-color-red { + color: #e60000; +} +.ql-editor .ql-color-orange { + color: #f90; +} +.ql-editor .ql-color-yellow { + color: #ff0; +} +.ql-editor .ql-color-green { + color: #008a00; +} +.ql-editor .ql-color-blue { + color: #06c; +} +.ql-editor .ql-color-purple { + color: #93f; +} +.ql-editor .ql-font-serif { + font-family: Georgia, Times New Roman, serif; +} +.ql-editor .ql-font-monospace { + font-family: Monaco, Courier New, monospace; +} +.ql-editor .ql-size-small { + font-size: 0.75em; +} +.ql-editor .ql-size-large { + font-size: 1.5em; +} +.ql-editor .ql-size-huge { + font-size: 2.5em; +} +.ql-editor .ql-direction-rtl { + direction: rtl; + text-align: inherit; +} +.ql-editor .ql-align-center { + text-align: center; +} +.ql-editor .ql-align-justify { + text-align: justify; +} +.ql-editor .ql-align-right { + text-align: right; +} +.ql-editor.ql-blank::before { + color: rgba(0,0,0,0.6); + content: attr(data-placeholder); + font-style: italic; + pointer-events: none; + position: absolute; +} +.ql-snow.ql-toolbar:after, +.ql-snow .ql-toolbar:after { + clear: both; + content: ''; + display: table; +} +.ql-snow.ql-toolbar button, +.ql-snow .ql-toolbar button { + background: none; + border: none; + cursor: pointer; + display: inline-block; + float: left; + height: 24px; + padding: 3px 5px; + width: 28px; +} +.ql-snow.ql-toolbar button svg, +.ql-snow .ql-toolbar button svg { + float: left; + height: 100%; +} +.ql-snow.ql-toolbar input.ql-image[type=file], +.ql-snow .ql-toolbar input.ql-image[type=file] { + display: none; +} +.ql-snow.ql-toolbar button:hover, +.ql-snow .ql-toolbar button:hover, +.ql-snow.ql-toolbar button.ql-active, +.ql-snow .ql-toolbar button.ql-active, +.ql-snow.ql-toolbar .ql-picker-label:hover, +.ql-snow .ql-toolbar .ql-picker-label:hover, +.ql-snow.ql-toolbar .ql-picker-label.ql-active, +.ql-snow .ql-toolbar .ql-picker-label.ql-active, +.ql-snow.ql-toolbar .ql-picker-item:hover, +.ql-snow .ql-toolbar .ql-picker-item:hover, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected { + color: #06c; +} +.ql-snow.ql-toolbar button:hover .ql-fill, +.ql-snow .ql-toolbar button:hover .ql-fill, +.ql-snow.ql-toolbar button.ql-active .ql-fill, +.ql-snow .ql-toolbar button.ql-active .ql-fill, +.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill { + fill: #06c; +} +.ql-snow.ql-toolbar button:hover .ql-stroke, +.ql-snow .ql-toolbar button:hover .ql-stroke, +.ql-snow.ql-toolbar button.ql-active .ql-stroke, +.ql-snow .ql-toolbar button.ql-active .ql-stroke, +.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-snow.ql-toolbar button:hover .ql-stroke-miter, +.ql-snow .ql-toolbar button:hover .ql-stroke-miter, +.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter, +.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter, +.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter { + stroke: #06c; +} +.ql-snow { + box-sizing: border-box; +} +.ql-snow * { + box-sizing: border-box; +} +.ql-snow .ql-hidden { + display: none; +} +.ql-snow .ql-out-bottom, +.ql-snow .ql-out-top { + visibility: hidden; +} +.ql-snow .ql-tooltip { + position: absolute; +} +.ql-snow .ql-tooltip a { + cursor: pointer; + text-decoration: none; +} +.ql-snow .ql-formats { + display: inline-block; + vertical-align: middle; +} +.ql-snow .ql-formats:after { + clear: both; + content: ''; + display: table; +} +.ql-snow .ql-stroke { + fill: none; + stroke: #444; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 2; +} +.ql-snow .ql-stroke-miter { + fill: none; + stroke: #444; + stroke-miterlimit: 10; + stroke-width: 2; +} +.ql-snow .ql-fill, +.ql-snow .ql-stroke.ql-fill { + fill: #444; +} +.ql-snow .ql-empty { + fill: none; +} +.ql-snow .ql-even { + fill-rule: evenodd; +} +.ql-snow .ql-thin, +.ql-snow .ql-stroke.ql-thin { + stroke-width: 1; +} +.ql-snow .ql-transparent { + opacity: 0.4; +} +.ql-snow .ql-direction svg:last-child { + display: none; +} +.ql-snow .ql-direction.ql-active svg:last-child { + display: inline; +} +.ql-snow .ql-direction.ql-active svg:first-child { + display: none; +} +.ql-snow .ql-editor h1 { + font-size: 2em; +} +.ql-snow .ql-editor h2 { + font-size: 1.5em; +} +.ql-snow .ql-editor h3 { + font-size: 1.17em; +} +.ql-snow .ql-editor h4 { + font-size: 1em; +} +.ql-snow .ql-editor h5 { + font-size: 0.83em; +} +.ql-snow .ql-editor h6 { + font-size: 0.67em; +} +.ql-snow .ql-editor a { + text-decoration: underline; +} +.ql-snow .ql-editor blockquote { + border-left: 4px solid #ccc; + margin-bottom: 5px; + margin-top: 5px; + padding-left: 16px; +} +.ql-snow .ql-editor code, +.ql-snow .ql-editor pre { + background-color: #f0f0f0; + border-radius: 3px; +} +.ql-snow .ql-editor pre { + white-space: pre-wrap; + margin-bottom: 5px; + margin-top: 5px; + padding: 5px 10px; +} +.ql-snow .ql-editor code { + font-size: 85%; + padding-bottom: 2px; + padding-top: 2px; +} +.ql-snow .ql-editor code:before, +.ql-snow .ql-editor code:after { + content: "\A0"; + letter-spacing: -2px; +} +.ql-snow .ql-editor pre.ql-syntax { + background-color: #23241f; + color: #f8f8f2; + overflow: visible; +} +.ql-snow .ql-editor img { + max-width: 100%; +} +.ql-snow .ql-picker { + color: #444; + display: inline-block; + float: left; + font-size: 14px; + font-weight: 500; + height: 24px; + position: relative; + vertical-align: middle; +} +.ql-snow .ql-picker-label { + cursor: pointer; + display: inline-block; + height: 100%; + padding-left: 8px; + padding-right: 2px; + position: relative; + width: 100%; +} +.ql-snow .ql-picker-label::before { + display: inline-block; + line-height: 22px; +} +.ql-snow .ql-picker-options { + background-color: #fff; + display: none; + min-width: 100%; + padding: 4px 8px; + position: absolute; + white-space: nowrap; +} +.ql-snow .ql-picker-options .ql-picker-item { + cursor: pointer; + display: block; + padding-bottom: 5px; + padding-top: 5px; +} +.ql-snow .ql-picker.ql-expanded .ql-picker-label { + color: #ccc; + z-index: 2; +} +.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill { + fill: #ccc; +} +.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke { + stroke: #ccc; +} +.ql-snow .ql-picker.ql-expanded .ql-picker-options { + display: block; + margin-top: -1px; + top: 100%; + z-index: 1; +} +.ql-snow .ql-color-picker, +.ql-snow .ql-icon-picker { + width: 28px; +} +.ql-snow .ql-color-picker .ql-picker-label, +.ql-snow .ql-icon-picker .ql-picker-label { + padding: 2px 4px; +} +.ql-snow .ql-color-picker .ql-picker-label svg, +.ql-snow .ql-icon-picker .ql-picker-label svg { + right: 4px; +} +.ql-snow .ql-icon-picker .ql-picker-options { + padding: 4px 0px; +} +.ql-snow .ql-icon-picker .ql-picker-item { + height: 24px; + width: 24px; + padding: 2px 4px; +} +.ql-snow .ql-color-picker .ql-picker-options { + padding: 3px 5px; + width: 152px; +} +.ql-snow .ql-color-picker .ql-picker-item { + border: 1px solid transparent; + float: left; + height: 16px; + margin: 2px; + padding: 0px; + width: 16px; +} +.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg { + position: absolute; + margin-top: -9px; + right: 0; + top: 50%; + width: 18px; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before { + content: attr(data-label); +} +.ql-snow .ql-picker.ql-header { + width: 98px; +} +.ql-snow .ql-picker.ql-header .ql-picker-label::before, +.ql-snow .ql-picker.ql-header .ql-picker-item::before { + content: 'Normal'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + content: 'Heading 1'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + content: 'Heading 2'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + content: 'Heading 3'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + content: 'Heading 4'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + content: 'Heading 5'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + content: 'Heading 6'; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + font-size: 2em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + font-size: 1.5em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + font-size: 1.17em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + font-size: 1em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + font-size: 0.83em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + font-size: 0.67em; +} +.ql-snow .ql-picker.ql-font { + width: 108px; +} +.ql-snow .ql-picker.ql-font .ql-picker-label::before, +.ql-snow .ql-picker.ql-font .ql-picker-item::before { + content: 'Sans Serif'; +} +.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before, +.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + content: 'Serif'; +} +.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before, +.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + content: 'Monospace'; +} +.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + font-family: Georgia, Times New Roman, serif; +} +.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + font-family: Monaco, Courier New, monospace; +} +.ql-snow .ql-picker.ql-size { + width: 98px; +} +.ql-snow .ql-picker.ql-size .ql-picker-label::before, +.ql-snow .ql-picker.ql-size .ql-picker-item::before { + content: 'Normal'; +} +.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before, +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + content: 'Small'; +} +.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before, +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + content: 'Large'; +} +.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before, +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + content: 'Huge'; +} +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + font-size: 10px; +} +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + font-size: 18px; +} +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + font-size: 32px; +} +.ql-snow .ql-color-picker.ql-background .ql-picker-item { + background-color: #fff; +} +.ql-snow .ql-color-picker.ql-color .ql-picker-item { + background-color: #000; +} +.ql-toolbar.ql-snow { + border: 1px solid #ccc; + box-sizing: border-box; + font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; + padding: 8px; +} +.ql-toolbar.ql-snow .ql-formats { + margin-right: 15px; +} +.ql-toolbar.ql-snow .ql-picker-label { + border: 1px solid transparent; +} +.ql-toolbar.ql-snow .ql-picker-options { + border: 1px solid transparent; + box-shadow: rgba(0,0,0,0.2) 0 2px 8px; +} +.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label { + border-color: #ccc; +} +.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options { + border-color: #ccc; +} +.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected, +.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover { + border-color: #000; +} +.ql-toolbar.ql-snow + .ql-container.ql-snow { + border-top: 0px; +} +.ql-snow .ql-tooltip { + background-color: #fff; + border: 1px solid #ccc; + box-shadow: 0px 0px 5px #ddd; + color: #444; + margin-top: 10px; + padding: 5px 12px; + white-space: nowrap; +} +.ql-snow .ql-tooltip::before { + content: "Visit URL:"; + line-height: 26px; + margin-right: 8px; +} +.ql-snow .ql-tooltip input[type=text] { + display: none; + border: 1px solid #ccc; + font-size: 13px; + height: 26px; + margin: 0px; + padding: 3px 5px; + width: 170px; +} +.ql-snow .ql-tooltip a.ql-preview { + display: inline-block; + max-width: 200px; + overflow-x: hidden; + text-overflow: ellipsis; + vertical-align: top; +} +.ql-snow .ql-tooltip a.ql-action::after { + border-right: 1px solid #ccc; + content: 'Edit'; + margin-left: 16px; + padding-right: 8px; +} +.ql-snow .ql-tooltip a.ql-remove::before { + content: 'Remove'; + margin-left: 8px; +} +.ql-snow .ql-tooltip a { + line-height: 26px; +} +.ql-snow .ql-tooltip.ql-editing a.ql-preview, +.ql-snow .ql-tooltip.ql-editing a.ql-remove { + display: none; +} +.ql-snow .ql-tooltip.ql-editing input[type=text] { + display: inline-block; +} +.ql-snow .ql-tooltip.ql-editing a.ql-action::after { + border-right: 0px; + content: 'Save'; + padding-right: 0px; +} +.ql-snow .ql-tooltip[data-mode=link]::before { + content: "Enter link:"; +} +.ql-snow .ql-tooltip[data-mode=formula]::before { + content: "Enter formula:"; +} +.ql-snow .ql-tooltip[data-mode=video]::before { + content: "Enter video:"; +} +.ql-snow a { + color: #06c; +} +.ql-container.ql-snow { + border: 1px solid #ccc; +} diff -Nru bibledit-5.0.912/quill/1.3.6/quill.bubble.css bibledit-5.0.922/quill/1.3.6/quill.bubble.css --- bibledit-5.0.912/quill/1.3.6/quill.bubble.css 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.3.6/quill.bubble.css 2018-03-12 06:39:22.000000000 +0000 @@ -0,0 +1,952 @@ +/*! + * Quill Editor v1.3.6 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +.ql-container { + box-sizing: border-box; + font-family: Helvetica, Arial, sans-serif; + font-size: 13px; + height: 100%; + margin: 0px; + position: relative; +} +.ql-container.ql-disabled .ql-tooltip { + visibility: hidden; +} +.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before { + pointer-events: none; +} +.ql-clipboard { + left: -100000px; + height: 1px; + overflow-y: hidden; + position: absolute; + top: 50%; +} +.ql-clipboard p { + margin: 0; + padding: 0; +} +.ql-editor { + box-sizing: border-box; + line-height: 1.42; + height: 100%; + outline: none; + overflow-y: auto; + padding: 12px 15px; + tab-size: 4; + -moz-tab-size: 4; + text-align: left; + white-space: pre-wrap; + word-wrap: break-word; +} +.ql-editor > * { + cursor: text; +} +.ql-editor p, +.ql-editor ol, +.ql-editor ul, +.ql-editor pre, +.ql-editor blockquote, +.ql-editor h1, +.ql-editor h2, +.ql-editor h3, +.ql-editor h4, +.ql-editor h5, +.ql-editor h6 { + margin: 0; + padding: 0; + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol, +.ql-editor ul { + padding-left: 1.5em; +} +.ql-editor ol > li, +.ql-editor ul > li { + list-style-type: none; +} +.ql-editor ul > li::before { + content: '\2022'; +} +.ql-editor ul[data-checked=true], +.ql-editor ul[data-checked=false] { + pointer-events: none; +} +.ql-editor ul[data-checked=true] > li *, +.ql-editor ul[data-checked=false] > li * { + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before, +.ql-editor ul[data-checked=false] > li::before { + color: #777; + cursor: pointer; + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before { + content: '\2611'; +} +.ql-editor ul[data-checked=false] > li::before { + content: '\2610'; +} +.ql-editor li::before { + display: inline-block; + white-space: nowrap; + width: 1.2em; +} +.ql-editor li:not(.ql-direction-rtl)::before { + margin-left: -1.5em; + margin-right: 0.3em; + text-align: right; +} +.ql-editor li.ql-direction-rtl::before { + margin-left: 0.3em; + margin-right: -1.5em; +} +.ql-editor ol li:not(.ql-direction-rtl), +.ql-editor ul li:not(.ql-direction-rtl) { + padding-left: 1.5em; +} +.ql-editor ol li.ql-direction-rtl, +.ql-editor ul li.ql-direction-rtl { + padding-right: 1.5em; +} +.ql-editor ol li { + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; + counter-increment: list-0; +} +.ql-editor ol li:before { + content: counter(list-0, decimal) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-increment: list-1; +} +.ql-editor ol li.ql-indent-1:before { + content: counter(list-1, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-2 { + counter-increment: list-2; +} +.ql-editor ol li.ql-indent-2:before { + content: counter(list-2, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-2 { + counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-3 { + counter-increment: list-3; +} +.ql-editor ol li.ql-indent-3:before { + content: counter(list-3, decimal) '. '; +} +.ql-editor ol li.ql-indent-3 { + counter-reset: list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-4 { + counter-increment: list-4; +} +.ql-editor ol li.ql-indent-4:before { + content: counter(list-4, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-4 { + counter-reset: list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-5 { + counter-increment: list-5; +} +.ql-editor ol li.ql-indent-5:before { + content: counter(list-5, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-5 { + counter-reset: list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-6 { + counter-increment: list-6; +} +.ql-editor ol li.ql-indent-6:before { + content: counter(list-6, decimal) '. '; +} +.ql-editor ol li.ql-indent-6 { + counter-reset: list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-7 { + counter-increment: list-7; +} +.ql-editor ol li.ql-indent-7:before { + content: counter(list-7, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-7 { + counter-reset: list-8 list-9; +} +.ql-editor ol li.ql-indent-8 { + counter-increment: list-8; +} +.ql-editor ol li.ql-indent-8:before { + content: counter(list-8, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-8 { + counter-reset: list-9; +} +.ql-editor ol li.ql-indent-9 { + counter-increment: list-9; +} +.ql-editor ol li.ql-indent-9:before { + content: counter(list-9, decimal) '. '; +} +.ql-editor .ql-indent-1:not(.ql-direction-rtl) { + padding-left: 3em; +} +.ql-editor li.ql-indent-1:not(.ql-direction-rtl) { + padding-left: 4.5em; +} +.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 3em; +} +.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 4.5em; +} +.ql-editor .ql-indent-2:not(.ql-direction-rtl) { + padding-left: 6em; +} +.ql-editor li.ql-indent-2:not(.ql-direction-rtl) { + padding-left: 7.5em; +} +.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 6em; +} +.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 7.5em; +} +.ql-editor .ql-indent-3:not(.ql-direction-rtl) { + padding-left: 9em; +} +.ql-editor li.ql-indent-3:not(.ql-direction-rtl) { + padding-left: 10.5em; +} +.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 9em; +} +.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 10.5em; +} +.ql-editor .ql-indent-4:not(.ql-direction-rtl) { + padding-left: 12em; +} +.ql-editor li.ql-indent-4:not(.ql-direction-rtl) { + padding-left: 13.5em; +} +.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 12em; +} +.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 13.5em; +} +.ql-editor .ql-indent-5:not(.ql-direction-rtl) { + padding-left: 15em; +} +.ql-editor li.ql-indent-5:not(.ql-direction-rtl) { + padding-left: 16.5em; +} +.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 15em; +} +.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 16.5em; +} +.ql-editor .ql-indent-6:not(.ql-direction-rtl) { + padding-left: 18em; +} +.ql-editor li.ql-indent-6:not(.ql-direction-rtl) { + padding-left: 19.5em; +} +.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 18em; +} +.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 19.5em; +} +.ql-editor .ql-indent-7:not(.ql-direction-rtl) { + padding-left: 21em; +} +.ql-editor li.ql-indent-7:not(.ql-direction-rtl) { + padding-left: 22.5em; +} +.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 21em; +} +.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 22.5em; +} +.ql-editor .ql-indent-8:not(.ql-direction-rtl) { + padding-left: 24em; +} +.ql-editor li.ql-indent-8:not(.ql-direction-rtl) { + padding-left: 25.5em; +} +.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 24em; +} +.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 25.5em; +} +.ql-editor .ql-indent-9:not(.ql-direction-rtl) { + padding-left: 27em; +} +.ql-editor li.ql-indent-9:not(.ql-direction-rtl) { + padding-left: 28.5em; +} +.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 27em; +} +.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 28.5em; +} +.ql-editor .ql-video { + display: block; + max-width: 100%; +} +.ql-editor .ql-video.ql-align-center { + margin: 0 auto; +} +.ql-editor .ql-video.ql-align-right { + margin: 0 0 0 auto; +} +.ql-editor .ql-bg-black { + background-color: #000; +} +.ql-editor .ql-bg-red { + background-color: #e60000; +} +.ql-editor .ql-bg-orange { + background-color: #f90; +} +.ql-editor .ql-bg-yellow { + background-color: #ff0; +} +.ql-editor .ql-bg-green { + background-color: #008a00; +} +.ql-editor .ql-bg-blue { + background-color: #06c; +} +.ql-editor .ql-bg-purple { + background-color: #93f; +} +.ql-editor .ql-color-white { + color: #fff; +} +.ql-editor .ql-color-red { + color: #e60000; +} +.ql-editor .ql-color-orange { + color: #f90; +} +.ql-editor .ql-color-yellow { + color: #ff0; +} +.ql-editor .ql-color-green { + color: #008a00; +} +.ql-editor .ql-color-blue { + color: #06c; +} +.ql-editor .ql-color-purple { + color: #93f; +} +.ql-editor .ql-font-serif { + font-family: Georgia, Times New Roman, serif; +} +.ql-editor .ql-font-monospace { + font-family: Monaco, Courier New, monospace; +} +.ql-editor .ql-size-small { + font-size: 0.75em; +} +.ql-editor .ql-size-large { + font-size: 1.5em; +} +.ql-editor .ql-size-huge { + font-size: 2.5em; +} +.ql-editor .ql-direction-rtl { + direction: rtl; + text-align: inherit; +} +.ql-editor .ql-align-center { + text-align: center; +} +.ql-editor .ql-align-justify { + text-align: justify; +} +.ql-editor .ql-align-right { + text-align: right; +} +.ql-editor.ql-blank::before { + color: rgba(0,0,0,0.6); + content: attr(data-placeholder); + font-style: italic; + left: 15px; + pointer-events: none; + position: absolute; + right: 15px; +} +.ql-bubble.ql-toolbar:after, +.ql-bubble .ql-toolbar:after { + clear: both; + content: ''; + display: table; +} +.ql-bubble.ql-toolbar button, +.ql-bubble .ql-toolbar button { + background: none; + border: none; + cursor: pointer; + display: inline-block; + float: left; + height: 24px; + padding: 3px 5px; + width: 28px; +} +.ql-bubble.ql-toolbar button svg, +.ql-bubble .ql-toolbar button svg { + float: left; + height: 100%; +} +.ql-bubble.ql-toolbar button:active:hover, +.ql-bubble .ql-toolbar button:active:hover { + outline: none; +} +.ql-bubble.ql-toolbar input.ql-image[type=file], +.ql-bubble .ql-toolbar input.ql-image[type=file] { + display: none; +} +.ql-bubble.ql-toolbar button:hover, +.ql-bubble .ql-toolbar button:hover, +.ql-bubble.ql-toolbar button:focus, +.ql-bubble .ql-toolbar button:focus, +.ql-bubble.ql-toolbar button.ql-active, +.ql-bubble .ql-toolbar button.ql-active, +.ql-bubble.ql-toolbar .ql-picker-label:hover, +.ql-bubble .ql-toolbar .ql-picker-label:hover, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active, +.ql-bubble.ql-toolbar .ql-picker-item:hover, +.ql-bubble .ql-toolbar .ql-picker-item:hover, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected { + color: #fff; +} +.ql-bubble.ql-toolbar button:hover .ql-fill, +.ql-bubble .ql-toolbar button:hover .ql-fill, +.ql-bubble.ql-toolbar button:focus .ql-fill, +.ql-bubble .ql-toolbar button:focus .ql-fill, +.ql-bubble.ql-toolbar button.ql-active .ql-fill, +.ql-bubble .ql-toolbar button.ql-active .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-bubble.ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar button:focus .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar button:focus .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill { + fill: #fff; +} +.ql-bubble.ql-toolbar button:hover .ql-stroke, +.ql-bubble .ql-toolbar button:hover .ql-stroke, +.ql-bubble.ql-toolbar button:focus .ql-stroke, +.ql-bubble .ql-toolbar button:focus .ql-stroke, +.ql-bubble.ql-toolbar button.ql-active .ql-stroke, +.ql-bubble .ql-toolbar button.ql-active .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-bubble.ql-toolbar button:hover .ql-stroke-miter, +.ql-bubble .ql-toolbar button:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar button:focus .ql-stroke-miter, +.ql-bubble .ql-toolbar button:focus .ql-stroke-miter, +.ql-bubble.ql-toolbar button.ql-active .ql-stroke-miter, +.ql-bubble .ql-toolbar button.ql-active .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter { + stroke: #fff; +} +@media (pointer: coarse) { + .ql-bubble.ql-toolbar button:hover:not(.ql-active), + .ql-bubble .ql-toolbar button:hover:not(.ql-active) { + color: #ccc; + } + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill { + fill: #ccc; + } + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter { + stroke: #ccc; + } +} +.ql-bubble { + box-sizing: border-box; +} +.ql-bubble * { + box-sizing: border-box; +} +.ql-bubble .ql-hidden { + display: none; +} +.ql-bubble .ql-out-bottom, +.ql-bubble .ql-out-top { + visibility: hidden; +} +.ql-bubble .ql-tooltip { + position: absolute; + transform: translateY(10px); +} +.ql-bubble .ql-tooltip a { + cursor: pointer; + text-decoration: none; +} +.ql-bubble .ql-tooltip.ql-flip { + transform: translateY(-10px); +} +.ql-bubble .ql-formats { + display: inline-block; + vertical-align: middle; +} +.ql-bubble .ql-formats:after { + clear: both; + content: ''; + display: table; +} +.ql-bubble .ql-stroke { + fill: none; + stroke: #ccc; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 2; +} +.ql-bubble .ql-stroke-miter { + fill: none; + stroke: #ccc; + stroke-miterlimit: 10; + stroke-width: 2; +} +.ql-bubble .ql-fill, +.ql-bubble .ql-stroke.ql-fill { + fill: #ccc; +} +.ql-bubble .ql-empty { + fill: none; +} +.ql-bubble .ql-even { + fill-rule: evenodd; +} +.ql-bubble .ql-thin, +.ql-bubble .ql-stroke.ql-thin { + stroke-width: 1; +} +.ql-bubble .ql-transparent { + opacity: 0.4; +} +.ql-bubble .ql-direction svg:last-child { + display: none; +} +.ql-bubble .ql-direction.ql-active svg:last-child { + display: inline; +} +.ql-bubble .ql-direction.ql-active svg:first-child { + display: none; +} +.ql-bubble .ql-editor h1 { + font-size: 2em; +} +.ql-bubble .ql-editor h2 { + font-size: 1.5em; +} +.ql-bubble .ql-editor h3 { + font-size: 1.17em; +} +.ql-bubble .ql-editor h4 { + font-size: 1em; +} +.ql-bubble .ql-editor h5 { + font-size: 0.83em; +} +.ql-bubble .ql-editor h6 { + font-size: 0.67em; +} +.ql-bubble .ql-editor a { + text-decoration: underline; +} +.ql-bubble .ql-editor blockquote { + border-left: 4px solid #ccc; + margin-bottom: 5px; + margin-top: 5px; + padding-left: 16px; +} +.ql-bubble .ql-editor code, +.ql-bubble .ql-editor pre { + background-color: #f0f0f0; + border-radius: 3px; +} +.ql-bubble .ql-editor pre { + white-space: pre-wrap; + margin-bottom: 5px; + margin-top: 5px; + padding: 5px 10px; +} +.ql-bubble .ql-editor code { + font-size: 85%; + padding: 2px 4px; +} +.ql-bubble .ql-editor pre.ql-syntax { + background-color: #23241f; + color: #f8f8f2; + overflow: visible; +} +.ql-bubble .ql-editor img { + max-width: 100%; +} +.ql-bubble .ql-picker { + color: #ccc; + display: inline-block; + float: left; + font-size: 14px; + font-weight: 500; + height: 24px; + position: relative; + vertical-align: middle; +} +.ql-bubble .ql-picker-label { + cursor: pointer; + display: inline-block; + height: 100%; + padding-left: 8px; + padding-right: 2px; + position: relative; + width: 100%; +} +.ql-bubble .ql-picker-label::before { + display: inline-block; + line-height: 22px; +} +.ql-bubble .ql-picker-options { + background-color: #444; + display: none; + min-width: 100%; + padding: 4px 8px; + position: absolute; + white-space: nowrap; +} +.ql-bubble .ql-picker-options .ql-picker-item { + cursor: pointer; + display: block; + padding-bottom: 5px; + padding-top: 5px; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-label { + color: #777; + z-index: 2; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-fill { + fill: #777; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-stroke { + stroke: #777; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-options { + display: block; + margin-top: -1px; + top: 100%; + z-index: 1; +} +.ql-bubble .ql-color-picker, +.ql-bubble .ql-icon-picker { + width: 28px; +} +.ql-bubble .ql-color-picker .ql-picker-label, +.ql-bubble .ql-icon-picker .ql-picker-label { + padding: 2px 4px; +} +.ql-bubble .ql-color-picker .ql-picker-label svg, +.ql-bubble .ql-icon-picker .ql-picker-label svg { + right: 4px; +} +.ql-bubble .ql-icon-picker .ql-picker-options { + padding: 4px 0px; +} +.ql-bubble .ql-icon-picker .ql-picker-item { + height: 24px; + width: 24px; + padding: 2px 4px; +} +.ql-bubble .ql-color-picker .ql-picker-options { + padding: 3px 5px; + width: 152px; +} +.ql-bubble .ql-color-picker .ql-picker-item { + border: 1px solid transparent; + float: left; + height: 16px; + margin: 2px; + padding: 0px; + width: 16px; +} +.ql-bubble .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg { + position: absolute; + margin-top: -9px; + right: 0; + top: 50%; + width: 18px; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before { + content: attr(data-label); +} +.ql-bubble .ql-picker.ql-header { + width: 98px; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item::before { + content: 'Normal'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="1"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + content: 'Heading 1'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + content: 'Heading 2'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + content: 'Heading 3'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + content: 'Heading 4'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="5"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + content: 'Heading 5'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="6"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + content: 'Heading 6'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + font-size: 2em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + font-size: 1.5em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + font-size: 1.17em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + font-size: 1em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + font-size: 0.83em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + font-size: 0.67em; +} +.ql-bubble .ql-picker.ql-font { + width: 108px; +} +.ql-bubble .ql-picker.ql-font .ql-picker-label::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item::before { + content: 'Sans Serif'; +} +.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=serif]::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + content: 'Serif'; +} +.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + content: 'Monospace'; +} +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + font-family: Georgia, Times New Roman, serif; +} +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + font-family: Monaco, Courier New, monospace; +} +.ql-bubble .ql-picker.ql-size { + width: 98px; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item::before { + content: 'Normal'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=small]::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + content: 'Small'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=large]::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + content: 'Large'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=huge]::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + content: 'Huge'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + font-size: 10px; +} +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + font-size: 18px; +} +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + font-size: 32px; +} +.ql-bubble .ql-color-picker.ql-background .ql-picker-item { + background-color: #fff; +} +.ql-bubble .ql-color-picker.ql-color .ql-picker-item { + background-color: #000; +} +.ql-bubble .ql-toolbar .ql-formats { + margin: 8px 12px 8px 0px; +} +.ql-bubble .ql-toolbar .ql-formats:first-child { + margin-left: 12px; +} +.ql-bubble .ql-color-picker svg { + margin: 1px; +} +.ql-bubble .ql-color-picker .ql-picker-item.ql-selected, +.ql-bubble .ql-color-picker .ql-picker-item:hover { + border-color: #fff; +} +.ql-bubble .ql-tooltip { + background-color: #444; + border-radius: 25px; + color: #fff; +} +.ql-bubble .ql-tooltip-arrow { + border-left: 6px solid transparent; + border-right: 6px solid transparent; + content: " "; + display: block; + left: 50%; + margin-left: -6px; + position: absolute; +} +.ql-bubble .ql-tooltip:not(.ql-flip) .ql-tooltip-arrow { + border-bottom: 6px solid #444; + top: -6px; +} +.ql-bubble .ql-tooltip.ql-flip .ql-tooltip-arrow { + border-top: 6px solid #444; + bottom: -6px; +} +.ql-bubble .ql-tooltip.ql-editing .ql-tooltip-editor { + display: block; +} +.ql-bubble .ql-tooltip.ql-editing .ql-formats { + visibility: hidden; +} +.ql-bubble .ql-tooltip-editor { + display: none; +} +.ql-bubble .ql-tooltip-editor input[type=text] { + background: transparent; + border: none; + color: #fff; + font-size: 13px; + height: 100%; + outline: none; + padding: 10px 20px; + position: absolute; + width: 100%; +} +.ql-bubble .ql-tooltip-editor a { + top: 10px; + position: absolute; + right: 20px; +} +.ql-bubble .ql-tooltip-editor a:before { + color: #ccc; + content: "\D7"; + font-size: 16px; + font-weight: bold; +} +.ql-container.ql-bubble:not(.ql-disabled) a { + position: relative; + white-space: nowrap; +} +.ql-container.ql-bubble:not(.ql-disabled) a::before { + background-color: #444; + border-radius: 15px; + top: -5px; + font-size: 12px; + color: #fff; + content: attr(href); + font-weight: normal; + overflow: hidden; + padding: 5px 15px; + text-decoration: none; + z-index: 1; +} +.ql-container.ql-bubble:not(.ql-disabled) a::after { + border-top: 6px solid #444; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + top: 0; + content: " "; + height: 0; + width: 0; +} +.ql-container.ql-bubble:not(.ql-disabled) a::before, +.ql-container.ql-bubble:not(.ql-disabled) a::after { + left: 0; + margin-left: 50%; + position: absolute; + transform: translate(-50%, -100%); + transition: visibility 0s ease 200ms; + visibility: hidden; +} +.ql-container.ql-bubble:not(.ql-disabled) a:hover::before, +.ql-container.ql-bubble:not(.ql-disabled) a:hover::after { + visibility: visible; +} diff -Nru bibledit-5.0.912/quill/1.3.6/quill.core.css bibledit-5.0.922/quill/1.3.6/quill.core.css --- bibledit-5.0.912/quill/1.3.6/quill.core.css 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.3.6/quill.core.css 2018-03-12 06:39:22.000000000 +0000 @@ -0,0 +1,397 @@ +/*! + * Quill Editor v1.3.6 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +.ql-container { + box-sizing: border-box; + font-family: Helvetica, Arial, sans-serif; + font-size: 13px; + height: 100%; + margin: 0px; + position: relative; +} +.ql-container.ql-disabled .ql-tooltip { + visibility: hidden; +} +.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before { + pointer-events: none; +} +.ql-clipboard { + left: -100000px; + height: 1px; + overflow-y: hidden; + position: absolute; + top: 50%; +} +.ql-clipboard p { + margin: 0; + padding: 0; +} +.ql-editor { + box-sizing: border-box; + line-height: 1.42; + height: 100%; + outline: none; + overflow-y: auto; + padding: 12px 15px; + tab-size: 4; + -moz-tab-size: 4; + text-align: left; + white-space: pre-wrap; + word-wrap: break-word; +} +.ql-editor > * { + cursor: text; +} +.ql-editor p, +.ql-editor ol, +.ql-editor ul, +.ql-editor pre, +.ql-editor blockquote, +.ql-editor h1, +.ql-editor h2, +.ql-editor h3, +.ql-editor h4, +.ql-editor h5, +.ql-editor h6 { + margin: 0; + padding: 0; + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol, +.ql-editor ul { + padding-left: 1.5em; +} +.ql-editor ol > li, +.ql-editor ul > li { + list-style-type: none; +} +.ql-editor ul > li::before { + content: '\2022'; +} +.ql-editor ul[data-checked=true], +.ql-editor ul[data-checked=false] { + pointer-events: none; +} +.ql-editor ul[data-checked=true] > li *, +.ql-editor ul[data-checked=false] > li * { + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before, +.ql-editor ul[data-checked=false] > li::before { + color: #777; + cursor: pointer; + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before { + content: '\2611'; +} +.ql-editor ul[data-checked=false] > li::before { + content: '\2610'; +} +.ql-editor li::before { + display: inline-block; + white-space: nowrap; + width: 1.2em; +} +.ql-editor li:not(.ql-direction-rtl)::before { + margin-left: -1.5em; + margin-right: 0.3em; + text-align: right; +} +.ql-editor li.ql-direction-rtl::before { + margin-left: 0.3em; + margin-right: -1.5em; +} +.ql-editor ol li:not(.ql-direction-rtl), +.ql-editor ul li:not(.ql-direction-rtl) { + padding-left: 1.5em; +} +.ql-editor ol li.ql-direction-rtl, +.ql-editor ul li.ql-direction-rtl { + padding-right: 1.5em; +} +.ql-editor ol li { + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; + counter-increment: list-0; +} +.ql-editor ol li:before { + content: counter(list-0, decimal) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-increment: list-1; +} +.ql-editor ol li.ql-indent-1:before { + content: counter(list-1, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-2 { + counter-increment: list-2; +} +.ql-editor ol li.ql-indent-2:before { + content: counter(list-2, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-2 { + counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-3 { + counter-increment: list-3; +} +.ql-editor ol li.ql-indent-3:before { + content: counter(list-3, decimal) '. '; +} +.ql-editor ol li.ql-indent-3 { + counter-reset: list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-4 { + counter-increment: list-4; +} +.ql-editor ol li.ql-indent-4:before { + content: counter(list-4, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-4 { + counter-reset: list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-5 { + counter-increment: list-5; +} +.ql-editor ol li.ql-indent-5:before { + content: counter(list-5, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-5 { + counter-reset: list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-6 { + counter-increment: list-6; +} +.ql-editor ol li.ql-indent-6:before { + content: counter(list-6, decimal) '. '; +} +.ql-editor ol li.ql-indent-6 { + counter-reset: list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-7 { + counter-increment: list-7; +} +.ql-editor ol li.ql-indent-7:before { + content: counter(list-7, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-7 { + counter-reset: list-8 list-9; +} +.ql-editor ol li.ql-indent-8 { + counter-increment: list-8; +} +.ql-editor ol li.ql-indent-8:before { + content: counter(list-8, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-8 { + counter-reset: list-9; +} +.ql-editor ol li.ql-indent-9 { + counter-increment: list-9; +} +.ql-editor ol li.ql-indent-9:before { + content: counter(list-9, decimal) '. '; +} +.ql-editor .ql-indent-1:not(.ql-direction-rtl) { + padding-left: 3em; +} +.ql-editor li.ql-indent-1:not(.ql-direction-rtl) { + padding-left: 4.5em; +} +.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 3em; +} +.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 4.5em; +} +.ql-editor .ql-indent-2:not(.ql-direction-rtl) { + padding-left: 6em; +} +.ql-editor li.ql-indent-2:not(.ql-direction-rtl) { + padding-left: 7.5em; +} +.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 6em; +} +.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 7.5em; +} +.ql-editor .ql-indent-3:not(.ql-direction-rtl) { + padding-left: 9em; +} +.ql-editor li.ql-indent-3:not(.ql-direction-rtl) { + padding-left: 10.5em; +} +.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 9em; +} +.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 10.5em; +} +.ql-editor .ql-indent-4:not(.ql-direction-rtl) { + padding-left: 12em; +} +.ql-editor li.ql-indent-4:not(.ql-direction-rtl) { + padding-left: 13.5em; +} +.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 12em; +} +.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 13.5em; +} +.ql-editor .ql-indent-5:not(.ql-direction-rtl) { + padding-left: 15em; +} +.ql-editor li.ql-indent-5:not(.ql-direction-rtl) { + padding-left: 16.5em; +} +.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 15em; +} +.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 16.5em; +} +.ql-editor .ql-indent-6:not(.ql-direction-rtl) { + padding-left: 18em; +} +.ql-editor li.ql-indent-6:not(.ql-direction-rtl) { + padding-left: 19.5em; +} +.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 18em; +} +.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 19.5em; +} +.ql-editor .ql-indent-7:not(.ql-direction-rtl) { + padding-left: 21em; +} +.ql-editor li.ql-indent-7:not(.ql-direction-rtl) { + padding-left: 22.5em; +} +.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 21em; +} +.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 22.5em; +} +.ql-editor .ql-indent-8:not(.ql-direction-rtl) { + padding-left: 24em; +} +.ql-editor li.ql-indent-8:not(.ql-direction-rtl) { + padding-left: 25.5em; +} +.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 24em; +} +.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 25.5em; +} +.ql-editor .ql-indent-9:not(.ql-direction-rtl) { + padding-left: 27em; +} +.ql-editor li.ql-indent-9:not(.ql-direction-rtl) { + padding-left: 28.5em; +} +.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 27em; +} +.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 28.5em; +} +.ql-editor .ql-video { + display: block; + max-width: 100%; +} +.ql-editor .ql-video.ql-align-center { + margin: 0 auto; +} +.ql-editor .ql-video.ql-align-right { + margin: 0 0 0 auto; +} +.ql-editor .ql-bg-black { + background-color: #000; +} +.ql-editor .ql-bg-red { + background-color: #e60000; +} +.ql-editor .ql-bg-orange { + background-color: #f90; +} +.ql-editor .ql-bg-yellow { + background-color: #ff0; +} +.ql-editor .ql-bg-green { + background-color: #008a00; +} +.ql-editor .ql-bg-blue { + background-color: #06c; +} +.ql-editor .ql-bg-purple { + background-color: #93f; +} +.ql-editor .ql-color-white { + color: #fff; +} +.ql-editor .ql-color-red { + color: #e60000; +} +.ql-editor .ql-color-orange { + color: #f90; +} +.ql-editor .ql-color-yellow { + color: #ff0; +} +.ql-editor .ql-color-green { + color: #008a00; +} +.ql-editor .ql-color-blue { + color: #06c; +} +.ql-editor .ql-color-purple { + color: #93f; +} +.ql-editor .ql-font-serif { + font-family: Georgia, Times New Roman, serif; +} +.ql-editor .ql-font-monospace { + font-family: Monaco, Courier New, monospace; +} +.ql-editor .ql-size-small { + font-size: 0.75em; +} +.ql-editor .ql-size-large { + font-size: 1.5em; +} +.ql-editor .ql-size-huge { + font-size: 2.5em; +} +.ql-editor .ql-direction-rtl { + direction: rtl; + text-align: inherit; +} +.ql-editor .ql-align-center { + text-align: center; +} +.ql-editor .ql-align-justify { + text-align: justify; +} +.ql-editor .ql-align-right { + text-align: right; +} +.ql-editor.ql-blank::before { + color: rgba(0,0,0,0.6); + content: attr(data-placeholder); + font-style: italic; + left: 15px; + pointer-events: none; + position: absolute; + right: 15px; +} diff -Nru bibledit-5.0.912/quill/1.3.6/quill.core.js bibledit-5.0.922/quill/1.3.6/quill.core.js --- bibledit-5.0.912/quill/1.3.6/quill.core.js 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.3.6/quill.core.js 2018-03-12 06:39:22.000000000 +0000 @@ -0,0 +1,8522 @@ +/*! + * Quill Editor v1.3.6 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["Quill"] = factory(); + else + root["Quill"] = factory(); +})(typeof self !== 'undefined' ? self : this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 110); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var format_1 = __webpack_require__(18); +var leaf_1 = __webpack_require__(19); +var scroll_1 = __webpack_require__(45); +var inline_1 = __webpack_require__(46); +var block_1 = __webpack_require__(47); +var embed_1 = __webpack_require__(48); +var text_1 = __webpack_require__(49); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(32); +var style_1 = __webpack_require__(33); +var store_1 = __webpack_require__(31); +var Registry = __webpack_require__(1); +var Parchment = { + Scope: Registry.Scope, + create: Registry.create, + find: Registry.find, + query: Registry.query, + register: Registry.register, + Container: container_1.default, + Format: format_1.default, + Leaf: leaf_1.default, + Embed: embed_1.default, + Scroll: scroll_1.default, + Block: block_1.default, + Inline: inline_1.default, + Text: text_1.default, + Attributor: { + Attribute: attributor_1.default, + Class: class_1.default, + Style: style_1.default, + Store: store_1.default, + }, +}; +exports.default = Parchment; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var ParchmentError = /** @class */ (function (_super) { + __extends(ParchmentError, _super); + function ParchmentError(message) { + var _this = this; + message = '[Parchment] ' + message; + _this = _super.call(this, message) || this; + _this.message = message; + _this.name = _this.constructor.name; + return _this; + } + return ParchmentError; +}(Error)); +exports.ParchmentError = ParchmentError; +var attributes = {}; +var classes = {}; +var tags = {}; +var types = {}; +exports.DATA_KEY = '__blot'; +var Scope; +(function (Scope) { + Scope[Scope["TYPE"] = 3] = "TYPE"; + Scope[Scope["LEVEL"] = 12] = "LEVEL"; + Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; + Scope[Scope["BLOT"] = 14] = "BLOT"; + Scope[Scope["INLINE"] = 7] = "INLINE"; + Scope[Scope["BLOCK"] = 11] = "BLOCK"; + Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; + Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; + Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; + Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; + Scope[Scope["ANY"] = 15] = "ANY"; +})(Scope = exports.Scope || (exports.Scope = {})); +function create(input, value) { + var match = query(input); + if (match == null) { + throw new ParchmentError("Unable to create " + input + " blot"); + } + var BlotClass = match; + var node = + // @ts-ignore + input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value); + return new BlotClass(node, value); +} +exports.create = create; +function find(node, bubble) { + if (bubble === void 0) { bubble = false; } + if (node == null) + return null; + // @ts-ignore + if (node[exports.DATA_KEY] != null) + return node[exports.DATA_KEY].blot; + if (bubble) + return find(node.parentNode, bubble); + return null; +} +exports.find = find; +function query(query, scope) { + if (scope === void 0) { scope = Scope.ANY; } + var match; + if (typeof query === 'string') { + match = types[query] || attributes[query]; + // @ts-ignore + } + else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) { + match = types['text']; + } + else if (typeof query === 'number') { + if (query & Scope.LEVEL & Scope.BLOCK) { + match = types['block']; + } + else if (query & Scope.LEVEL & Scope.INLINE) { + match = types['inline']; + } + } + else if (query instanceof HTMLElement) { + var names = (query.getAttribute('class') || '').split(/\s+/); + for (var i in names) { + match = classes[names[i]]; + if (match) + break; + } + match = match || tags[query.tagName]; + } + if (match == null) + return null; + // @ts-ignore + if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) + return match; + return null; +} +exports.query = query; +function register() { + var Definitions = []; + for (var _i = 0; _i < arguments.length; _i++) { + Definitions[_i] = arguments[_i]; + } + if (Definitions.length > 1) { + return Definitions.map(function (d) { + return register(d); + }); + } + var Definition = Definitions[0]; + if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { + throw new ParchmentError('Invalid definition'); + } + else if (Definition.blotName === 'abstract') { + throw new ParchmentError('Cannot register abstract class'); + } + types[Definition.blotName || Definition.attrName] = Definition; + if (typeof Definition.keyName === 'string') { + attributes[Definition.keyName] = Definition; + } + else { + if (Definition.className != null) { + classes[Definition.className] = Definition; + } + if (Definition.tagName != null) { + if (Array.isArray(Definition.tagName)) { + Definition.tagName = Definition.tagName.map(function (tagName) { + return tagName.toUpperCase(); + }); + } + else { + Definition.tagName = Definition.tagName.toUpperCase(); + } + var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; + tagNames.forEach(function (tag) { + if (tags[tag] == null || Definition.className == null) { + tags[tag] = Definition; + } + }); + } + } + return Definition; +} +exports.register = register; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +var diff = __webpack_require__(51); +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); +var op = __webpack_require__(20); + + +var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() + + +var Delta = function (ops) { + // Assume we are given a well formed ops + if (Array.isArray(ops)) { + this.ops = ops; + } else if (ops != null && Array.isArray(ops.ops)) { + this.ops = ops.ops; + } else { + this.ops = []; + } +}; + + +Delta.prototype.insert = function (text, attributes) { + var newOp = {}; + if (text.length === 0) return this; + newOp.insert = text; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype['delete'] = function (length) { + if (length <= 0) return this; + return this.push({ 'delete': length }); +}; + +Delta.prototype.retain = function (length, attributes) { + if (length <= 0) return this; + var newOp = { retain: length }; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype.push = function (newOp) { + var index = this.ops.length; + var lastOp = this.ops[index - 1]; + newOp = extend(true, {}, newOp); + if (typeof lastOp === 'object') { + if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { + this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; + return this; + } + // Since it does not matter if we insert before or after deleting at the same index, + // always prefer to insert first + if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { + index -= 1; + lastOp = this.ops[index - 1]; + if (typeof lastOp !== 'object') { + this.ops.unshift(newOp); + return this; + } + } + if (equal(newOp.attributes, lastOp.attributes)) { + if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { + this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { + this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } + } + } + if (index === this.ops.length) { + this.ops.push(newOp); + } else { + this.ops.splice(index, 0, newOp); + } + return this; +}; + +Delta.prototype.chop = function () { + var lastOp = this.ops[this.ops.length - 1]; + if (lastOp && lastOp.retain && !lastOp.attributes) { + this.ops.pop(); + } + return this; +}; + +Delta.prototype.filter = function (predicate) { + return this.ops.filter(predicate); +}; + +Delta.prototype.forEach = function (predicate) { + this.ops.forEach(predicate); +}; + +Delta.prototype.map = function (predicate) { + return this.ops.map(predicate); +}; + +Delta.prototype.partition = function (predicate) { + var passed = [], failed = []; + this.forEach(function(op) { + var target = predicate(op) ? passed : failed; + target.push(op); + }); + return [passed, failed]; +}; + +Delta.prototype.reduce = function (predicate, initial) { + return this.ops.reduce(predicate, initial); +}; + +Delta.prototype.changeLength = function () { + return this.reduce(function (length, elem) { + if (elem.insert) { + return length + op.length(elem); + } else if (elem.delete) { + return length - elem.delete; + } + return length; + }, 0); +}; + +Delta.prototype.length = function () { + return this.reduce(function (length, elem) { + return length + op.length(elem); + }, 0); +}; + +Delta.prototype.slice = function (start, end) { + start = start || 0; + if (typeof end !== 'number') end = Infinity; + var ops = []; + var iter = op.iterator(this.ops); + var index = 0; + while (index < end && iter.hasNext()) { + var nextOp; + if (index < start) { + nextOp = iter.next(start - index); + } else { + nextOp = iter.next(end - index); + ops.push(nextOp); + } + index += op.length(nextOp); + } + return new Delta(ops); +}; + + +Delta.prototype.compose = function (other) { + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else if (thisIter.peekType() === 'delete') { + delta.push(thisIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (typeof otherOp.retain === 'number') { + var newOp = {}; + if (typeof thisOp.retain === 'number') { + newOp.retain = length; + } else { + newOp.insert = thisOp.insert; + } + // Preserve null when composing with a retain, otherwise remove it for inserts + var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); + if (attributes) newOp.attributes = attributes; + delta.push(newOp); + // Other op should be delete, we could be an insert or retain + // Insert + delete cancels out + } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { + delta.push(otherOp); + } + } + } + return delta.chop(); +}; + +Delta.prototype.concat = function (other) { + var delta = new Delta(this.ops.slice()); + if (other.ops.length > 0) { + delta.push(other.ops[0]); + delta.ops = delta.ops.concat(other.ops.slice(1)); + } + return delta; +}; + +Delta.prototype.diff = function (other, index) { + if (this.ops === other.ops) { + return new Delta(); + } + var strings = [this, other].map(function (delta) { + return delta.map(function (op) { + if (op.insert != null) { + return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; + } + var prep = (delta === other) ? 'on' : 'with'; + throw new Error('diff() called ' + prep + ' non-document'); + }).join(''); + }); + var delta = new Delta(); + var diffResult = diff(strings[0], strings[1], index); + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + diffResult.forEach(function (component) { + var length = component[1].length; + while (length > 0) { + var opLength = 0; + switch (component[0]) { + case diff.INSERT: + opLength = Math.min(otherIter.peekLength(), length); + delta.push(otherIter.next(opLength)); + break; + case diff.DELETE: + opLength = Math.min(length, thisIter.peekLength()); + thisIter.next(opLength); + delta['delete'](opLength); + break; + case diff.EQUAL: + opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); + var thisOp = thisIter.next(opLength); + var otherOp = otherIter.next(opLength); + if (equal(thisOp.insert, otherOp.insert)) { + delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); + } else { + delta.push(otherOp)['delete'](opLength); + } + break; + } + length -= opLength; + } + }); + return delta.chop(); +}; + +Delta.prototype.eachLine = function (predicate, newline) { + newline = newline || '\n'; + var iter = op.iterator(this.ops); + var line = new Delta(); + var i = 0; + while (iter.hasNext()) { + if (iter.peekType() !== 'insert') return; + var thisOp = iter.peek(); + var start = op.length(thisOp) - iter.peekLength(); + var 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) === false) { + return; + } + i += 1; + line = new Delta(); + } + } + if (line.length() > 0) { + predicate(line, {}, i); + } +}; + +Delta.prototype.transform = function (other, priority) { + priority = !!priority; + if (typeof other === 'number') { + return this.transformPosition(other, priority); + } + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { + delta.retain(op.length(thisIter.next())); + } else if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (thisOp['delete']) { + // Our delete either makes their delete redundant or removes their retain + continue; + } else if (otherOp['delete']) { + delta.push(otherOp); + } else { + // We retain either their retain or insert + delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); + } + } + } + return delta.chop(); +}; + +Delta.prototype.transformPosition = function (index, priority) { + priority = !!priority; + var thisIter = op.iterator(this.ops); + var offset = 0; + while (thisIter.hasNext() && offset <= index) { + var length = thisIter.peekLength(); + var nextType = thisIter.peekType(); + thisIter.next(); + if (nextType === 'delete') { + index -= Math.min(length, index - offset); + continue; + } else if (nextType === 'insert' && (offset < index || !priority)) { + index += length; + } + offset += length; + } + return index; +}; + + +module.exports = Delta; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +'use strict'; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; +}; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var NEWLINE_LENGTH = 1; + +var BlockEmbed = function (_Parchment$Embed) { + _inherits(BlockEmbed, _Parchment$Embed); + + function BlockEmbed() { + _classCallCheck(this, BlockEmbed); + + return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); + } + + _createClass(BlockEmbed, [{ + key: 'attach', + value: function attach() { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); + this.attributes = new _parchment2.default.Attributor.Store(this.domNode); + } + }, { + key: 'delta', + value: function delta() { + return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); + } + }, { + key: 'format', + value: function format(name, value) { + var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); + if (attribute != null) { + this.attributes.attribute(attribute, value); + } + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + this.format(name, value); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (typeof value === 'string' && value.endsWith('\n')) { + var block = _parchment2.default.create(Block.blotName); + this.parent.insertBefore(block, index === 0 ? this : this.next); + block.insertAt(0, value.slice(0, -1)); + } else { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); + } + } + }]); + + return BlockEmbed; +}(_parchment2.default.Embed); + +BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; +// It is important for cursor behavior BlockEmbeds use tags that are block level elements + + +var Block = function (_Parchment$Block) { + _inherits(Block, _Parchment$Block); + + function Block(domNode) { + _classCallCheck(this, Block); + + var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); + + _this2.cache = {}; + return _this2; + } + + _createClass(Block, [{ + key: 'delta', + value: function delta() { + if (this.cache.delta == null) { + this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { + if (leaf.length() === 0) { + return delta; + } else { + return delta.insert(leaf.value(), bubbleFormats(leaf)); + } + }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); + } + return this.cache.delta; + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); + this.cache = {}; + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length <= 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + if (index + length === this.length()) { + this.format(name, value); + } + } else { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); + } + this.cache = {}; + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); + if (value.length === 0) return; + var lines = value.split('\n'); + var text = lines.shift(); + if (text.length > 0) { + if (index < this.length() - 1 || this.children.tail == null) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); + } else { + this.children.tail.insertAt(this.children.tail.length(), text); + } + this.cache = {}; + } + var block = this; + lines.reduce(function (index, line) { + block = block.split(index, true); + block.insertAt(0, line); + return line.length; + }, index + text.length); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + var head = this.children.head; + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); + if (head instanceof _break2.default) { + head.remove(); + } + this.cache = {}; + } + }, { + key: 'length', + value: function length() { + if (this.cache.length == null) { + this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; + } + return this.cache.length; + } + }, { + key: 'moveChildren', + value: function moveChildren(target, ref) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); + this.cache = {}; + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context); + this.cache = {}; + } + }, { + key: 'path', + value: function path(index) { + return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); + } + }, { + key: 'removeChild', + value: function removeChild(child) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); + this.cache = {}; + } + }, { + key: 'split', + value: function split(index) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { + var clone = this.clone(); + if (index === 0) { + this.parent.insertBefore(clone, this); + return this; + } else { + this.parent.insertBefore(clone, this.next); + return clone; + } + } else { + var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); + this.cache = {}; + return next; + } + } + }]); + + return Block; +}(_parchment2.default.Block); + +Block.blotName = 'block'; +Block.tagName = 'P'; +Block.defaultChild = 'break'; +Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default]; + +function bubbleFormats(blot) { + var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (blot == null) return formats; + if (typeof blot.formats === 'function') { + formats = (0, _extend2.default)(formats, blot.formats()); + } + if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { + return formats; + } + return bubbleFormats(blot.parent, formats); +} + +exports.bubbleFormats = bubbleFormats; +exports.BlockEmbed = BlockEmbed; +exports.default = Block; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.overload = exports.expandConfig = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +__webpack_require__(50); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _editor = __webpack_require__(14); + +var _editor2 = _interopRequireDefault(_editor); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _selection = __webpack_require__(15); + +var _selection2 = _interopRequireDefault(_selection); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _theme = __webpack_require__(34); + +var _theme2 = _interopRequireDefault(_theme); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill'); + +var Quill = function () { + _createClass(Quill, null, [{ + key: 'debug', + value: function debug(limit) { + if (limit === true) { + limit = 'log'; + } + _logger2.default.level(limit); + } + }, { + key: 'find', + value: function find(node) { + return node.__quill || _parchment2.default.find(node); + } + }, { + key: 'import', + value: function _import(name) { + if (this.imports[name] == null) { + debug.error('Cannot import ' + name + '. Are you sure it was registered?'); + } + return this.imports[name]; + } + }, { + key: 'register', + value: function register(path, target) { + var _this = this; + + var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (typeof path !== 'string') { + var name = path.attrName || path.blotName; + if (typeof name === 'string') { + // register(Blot | Attributor, overwrite) + this.register('formats/' + name, path, target); + } else { + Object.keys(path).forEach(function (key) { + _this.register(key, path[key], target); + }); + } + } else { + if (this.imports[path] != null && !overwrite) { + debug.warn('Overwriting ' + path + ' with', target); + } + this.imports[path] = target; + if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { + _parchment2.default.register(target); + } else if (path.startsWith('modules') && typeof target.register === 'function') { + target.register(); + } + } + } + }]); + + function Quill(container) { + var _this2 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Quill); + + this.options = expandConfig(container, options); + this.container = this.options.container; + if (this.container == null) { + return debug.error('Invalid Quill container', container); + } + if (this.options.debug) { + Quill.debug(this.options.debug); + } + var html = this.container.innerHTML.trim(); + this.container.classList.add('ql-container'); + this.container.innerHTML = ''; + this.container.__quill = this; + this.root = this.addContainer('ql-editor'); + this.root.classList.add('ql-blank'); + this.root.setAttribute('data-gramm', false); + this.scrollingContainer = this.options.scrollingContainer || this.root; + this.emitter = new _emitter4.default(); + this.scroll = _parchment2.default.create(this.root, { + emitter: this.emitter, + whitelist: this.options.formats + }); + this.editor = new _editor2.default(this.scroll); + this.selection = new _selection2.default(this.scroll, this.emitter); + this.theme = new this.options.theme(this, this.options); + this.keyboard = this.theme.addModule('keyboard'); + this.clipboard = this.theme.addModule('clipboard'); + this.history = this.theme.addModule('history'); + this.theme.init(); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { + if (type === _emitter4.default.events.TEXT_CHANGE) { + _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { + var range = _this2.selection.lastRange; + var index = range && range.length === 0 ? range.index : undefined; + modify.call(_this2, function () { + return _this2.editor.update(null, mutations, index); + }, source); + }); + var contents = this.clipboard.convert('
    ' + html + '


    '); + this.setContents(contents); + this.history.clear(); + if (this.options.placeholder) { + this.root.setAttribute('data-placeholder', this.options.placeholder); + } + if (this.options.readOnly) { + this.disable(); + } + } + + _createClass(Quill, [{ + key: 'addContainer', + value: function addContainer(container) { + var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (typeof container === 'string') { + var className = container; + container = document.createElement('div'); + container.classList.add(className); + } + this.container.insertBefore(container, refNode); + return container; + } + }, { + key: 'blur', + value: function blur() { + this.selection.setRange(null); + } + }, { + key: 'deleteText', + value: function deleteText(index, length, source) { + var _this3 = this; + + var _overload = overload(index, length, source); + + var _overload2 = _slicedToArray(_overload, 4); + + index = _overload2[0]; + length = _overload2[1]; + source = _overload2[3]; + + return modify.call(this, function () { + return _this3.editor.deleteText(index, length); + }, source, index, -1 * length); + } + }, { + key: 'disable', + value: function disable() { + this.enable(false); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.scroll.enable(enabled); + this.container.classList.toggle('ql-disabled', !enabled); + } + }, { + key: 'focus', + value: function focus() { + var scrollTop = this.scrollingContainer.scrollTop; + this.selection.focus(); + this.scrollingContainer.scrollTop = scrollTop; + this.scrollIntoView(); + } + }, { + key: 'format', + value: function format(name, value) { + var _this4 = this; + + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + return modify.call(this, function () { + var range = _this4.getSelection(true); + var change = new _quillDelta2.default(); + if (range == null) { + return change; + } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); + } else if (range.length === 0) { + _this4.selection.format(name, value); + return change; + } else { + change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); + } + _this4.setSelection(range, _emitter4.default.sources.SILENT); + return change; + }, source); + } + }, { + key: 'formatLine', + value: function formatLine(index, length, name, value, source) { + var _this5 = this; + + var formats = void 0; + + var _overload3 = overload(index, length, name, value, source); + + var _overload4 = _slicedToArray(_overload3, 4); + + index = _overload4[0]; + length = _overload4[1]; + formats = _overload4[2]; + source = _overload4[3]; + + return modify.call(this, function () { + return _this5.editor.formatLine(index, length, formats); + }, source, index, 0); + } + }, { + key: 'formatText', + value: function formatText(index, length, name, value, source) { + var _this6 = this; + + var formats = void 0; + + var _overload5 = overload(index, length, name, value, source); + + var _overload6 = _slicedToArray(_overload5, 4); + + index = _overload6[0]; + length = _overload6[1]; + formats = _overload6[2]; + source = _overload6[3]; + + return modify.call(this, function () { + return _this6.editor.formatText(index, length, formats); + }, source, index, 0); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var bounds = void 0; + if (typeof index === 'number') { + bounds = this.selection.getBounds(index, length); + } else { + bounds = this.selection.getBounds(index.index, index.length); + } + var containerBounds = this.container.getBoundingClientRect(); + return { + bottom: bounds.bottom - containerBounds.top, + height: bounds.height, + left: bounds.left - containerBounds.left, + right: bounds.right - containerBounds.left, + top: bounds.top - containerBounds.top, + width: bounds.width + }; + } + }, { + key: 'getContents', + value: function getContents() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload7 = overload(index, length); + + var _overload8 = _slicedToArray(_overload7, 2); + + index = _overload8[0]; + length = _overload8[1]; + + return this.editor.getContents(index, length); + } + }, { + key: 'getFormat', + value: function getFormat() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true); + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (typeof index === 'number') { + return this.editor.getFormat(index, length); + } else { + return this.editor.getFormat(index.index, index.length); + } + } + }, { + key: 'getIndex', + value: function getIndex(blot) { + return blot.offset(this.scroll); + } + }, { + key: 'getLength', + value: function getLength() { + return this.scroll.length(); + } + }, { + key: 'getLeaf', + value: function getLeaf(index) { + return this.scroll.leaf(index); + } + }, { + key: 'getLine', + value: function getLine(index) { + return this.scroll.line(index); + } + }, { + key: 'getLines', + value: function getLines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + if (typeof index !== 'number') { + return this.scroll.lines(index.index, index.length); + } else { + return this.scroll.lines(index, length); + } + } + }, { + key: 'getModule', + value: function getModule(name) { + return this.theme.modules[name]; + } + }, { + key: 'getSelection', + value: function getSelection() { + var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (focus) this.focus(); + this.update(); // Make sure we access getRange with editor in consistent state + return this.selection.getRange()[0]; + } + }, { + key: 'getText', + value: function getText() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload9 = overload(index, length); + + var _overload10 = _slicedToArray(_overload9, 2); + + index = _overload10[0]; + length = _overload10[1]; + + return this.editor.getText(index, length); + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return this.selection.hasFocus(); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + var _this7 = this; + + var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; + + return modify.call(this, function () { + return _this7.editor.insertEmbed(index, embed, value); + }, source, index); + } + }, { + key: 'insertText', + value: function insertText(index, text, name, value, source) { + var _this8 = this; + + var formats = void 0; + + var _overload11 = overload(index, 0, name, value, source); + + var _overload12 = _slicedToArray(_overload11, 4); + + index = _overload12[0]; + formats = _overload12[2]; + source = _overload12[3]; + + return modify.call(this, function () { + return _this8.editor.insertText(index, text, formats); + }, source, index, text.length); + } + }, { + key: 'isEnabled', + value: function isEnabled() { + return !this.container.classList.contains('ql-disabled'); + } + }, { + key: 'off', + value: function off() { + return this.emitter.off.apply(this.emitter, arguments); + } + }, { + key: 'on', + value: function on() { + return this.emitter.on.apply(this.emitter, arguments); + } + }, { + key: 'once', + value: function once() { + return this.emitter.once.apply(this.emitter, arguments); + } + }, { + key: 'pasteHTML', + value: function pasteHTML(index, html, source) { + this.clipboard.dangerouslyPasteHTML(index, html, source); + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length, source) { + var _this9 = this; + + var _overload13 = overload(index, length, source); + + var _overload14 = _slicedToArray(_overload13, 4); + + index = _overload14[0]; + length = _overload14[1]; + source = _overload14[3]; + + return modify.call(this, function () { + return _this9.editor.removeFormat(index, length); + }, source, index); + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView() { + this.selection.scrollIntoView(this.scrollingContainer); + } + }, { + key: 'setContents', + value: function setContents(delta) { + var _this10 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + var length = _this10.getLength(); + var deleted = _this10.editor.deleteText(0, length); + var applied = _this10.editor.applyDelta(delta); + var lastOp = applied.ops[applied.ops.length - 1]; + if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { + _this10.editor.deleteText(_this10.getLength() - 1, 1); + applied.delete(1); + } + var ret = deleted.compose(applied); + return ret; + }, source); + } + }, { + key: 'setSelection', + value: function setSelection(index, length, source) { + if (index == null) { + this.selection.setRange(null, length || Quill.sources.API); + } else { + var _overload15 = overload(index, length, source); + + var _overload16 = _slicedToArray(_overload15, 4); + + index = _overload16[0]; + length = _overload16[1]; + source = _overload16[3]; + + this.selection.setRange(new _selection.Range(index, length), source); + if (source !== _emitter4.default.sources.SILENT) { + this.selection.scrollIntoView(this.scrollingContainer); + } + } + } + }, { + key: 'setText', + value: function setText(text) { + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + var delta = new _quillDelta2.default().insert(text); + return this.setContents(delta, source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes + this.selection.update(source); + return change; + } + }, { + key: 'updateContents', + value: function updateContents(delta) { + var _this11 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + return _this11.editor.applyDelta(delta, source); + }, source, true); + } + }]); + + return Quill; +}(); + +Quill.DEFAULTS = { + bounds: null, + formats: null, + modules: {}, + placeholder: '', + readOnly: false, + scrollingContainer: null, + strict: true, + theme: 'default' +}; +Quill.events = _emitter4.default.events; +Quill.sources = _emitter4.default.sources; +// eslint-disable-next-line no-undef +Quill.version = false ? 'dev' : "1.3.6"; + +Quill.imports = { + 'delta': _quillDelta2.default, + 'parchment': _parchment2.default, + 'core/module': _module2.default, + 'core/theme': _theme2.default +}; + +function expandConfig(container, userConfig) { + userConfig = (0, _extend2.default)(true, { + container: container, + modules: { + clipboard: true, + keyboard: true, + history: true + } + }, userConfig); + if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { + userConfig.theme = _theme2.default; + } else { + userConfig.theme = Quill.import('themes/' + userConfig.theme); + if (userConfig.theme == null) { + throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); + } + } + var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); + [themeConfig, userConfig].forEach(function (config) { + config.modules = config.modules || {}; + Object.keys(config.modules).forEach(function (module) { + if (config.modules[module] === true) { + config.modules[module] = {}; + } + }); + }); + var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); + var moduleConfig = moduleNames.reduce(function (config, name) { + var moduleClass = Quill.import('modules/' + name); + if (moduleClass == null) { + debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); + } else { + config[name] = moduleClass.DEFAULTS || {}; + } + return config; + }, {}); + // Special case toolbar shorthand + if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { + userConfig.modules.toolbar = { + container: userConfig.modules.toolbar + }; + } + userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); + ['bounds', 'container', 'scrollingContainer'].forEach(function (key) { + if (typeof userConfig[key] === 'string') { + userConfig[key] = document.querySelector(userConfig[key]); + } + }); + userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { + if (userConfig.modules[name]) { + config[name] = userConfig.modules[name]; + } + return config; + }, {}); + return userConfig; +} + +// Handle selection preservation and TEXT_CHANGE emission +// common to modification APIs +function modify(modifier, source, index, shift) { + if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { + return new _quillDelta2.default(); + } + var range = index == null ? null : this.getSelection(); + var oldDelta = this.editor.delta; + var change = modifier(); + if (range != null) { + if (index === true) index = range.index; + if (shift == null) { + range = shiftRange(range, change, source); + } else if (shift !== 0) { + range = shiftRange(range, index, shift, source); + } + this.setSelection(range, _emitter4.default.sources.SILENT); + } + if (change.length() > 0) { + var _emitter; + + var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + return change; +} + +function overload(index, length, name, value, source) { + var formats = {}; + if (typeof index.index === 'number' && typeof index.length === 'number') { + // Allow for throwaway end (used by insertText/insertEmbed) + if (typeof length !== 'number') { + source = value, value = name, name = length, length = index.length, index = index.index; + } else { + length = index.length, index = index.index; + } + } else if (typeof length !== 'number') { + source = value, value = name, name = length, length = 0; + } + // Handle format being object, two format name/value strings or excluded + if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { + formats = name; + source = value; + } else if (typeof name === 'string') { + if (value != null) { + formats[name] = value; + } else { + source = name; + } + } + // Handle optional source + source = source || _emitter4.default.sources.API; + return [index, length, formats, source]; +} + +function shiftRange(range, index, length, source) { + if (range == null) return null; + var start = void 0, + end = void 0; + if (index instanceof _quillDelta2.default) { + var _map = [range.index, range.index + range.length].map(function (pos) { + return index.transformPosition(pos, source !== _emitter4.default.sources.USER); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + } else { + var _map3 = [range.index, range.index + range.length].map(function (pos) { + if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos; + if (length >= 0) { + return pos + length; + } else { + return Math.max(index, pos + length); + } + }); + + var _map4 = _slicedToArray(_map3, 2); + + start = _map4[0]; + end = _map4[1]; + } + return new _selection.Range(start, end - start); +} + +exports.expandConfig = expandConfig; +exports.overload = overload; +exports.default = Quill; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Inline = function (_Parchment$Inline) { + _inherits(Inline, _Parchment$Inline); + + function Inline() { + _classCallCheck(this, Inline); + + return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); + } + + _createClass(Inline, [{ + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { + var blot = this.isolate(index, length); + if (value) { + blot.wrap(name, value); + } + } else { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context); + if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { + var parent = this.parent.isolate(this.offset(), this.length()); + this.moveChildren(parent); + parent.wrap(this); + } + } + }], [{ + key: 'compare', + value: function compare(self, other) { + var selfIndex = Inline.order.indexOf(self); + var otherIndex = Inline.order.indexOf(other); + if (selfIndex >= 0 || otherIndex >= 0) { + return selfIndex - otherIndex; + } else if (self === other) { + return 0; + } else if (self < other) { + return -1; + } else { + return 1; + } + } + }]); + + return Inline; +}(_parchment2.default.Inline); + +Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default]; +// Lower index means deeper in the DOM tree, since not found (-1) is for embeds +Inline.order = ['cursor', 'inline', // Must be lower +'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher +]; + +exports.default = Inline; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TextBlot = function (_Parchment$Text) { + _inherits(TextBlot, _Parchment$Text); + + function TextBlot() { + _classCallCheck(this, TextBlot); + + return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); + } + + return TextBlot; +}(_parchment2.default.Text); + +exports.default = TextBlot; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _eventemitter = __webpack_require__(54); + +var _eventemitter2 = _interopRequireDefault(_eventemitter); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:events'); + +var EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click']; + +EVENTS.forEach(function (eventName) { + document.addEventListener(eventName, function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) { + // TODO use WeakMap + if (node.__quill && node.__quill.emitter) { + var _node$__quill$emitter; + + (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args); + } + }); + }); +}); + +var Emitter = function (_EventEmitter) { + _inherits(Emitter, _EventEmitter); + + function Emitter() { + _classCallCheck(this, Emitter); + + var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); + + _this.listeners = {}; + _this.on('error', debug.error); + return _this; + } + + _createClass(Emitter, [{ + key: 'emit', + value: function emit() { + debug.log.apply(debug, arguments); + _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); + } + }, { + key: 'handleDOM', + value: function handleDOM(event) { + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + (this.listeners[event.type] || []).forEach(function (_ref) { + var node = _ref.node, + handler = _ref.handler; + + if (event.target === node || node.contains(event.target)) { + handler.apply(undefined, [event].concat(args)); + } + }); + } + }, { + key: 'listenDOM', + value: function listenDOM(eventName, node, handler) { + if (!this.listeners[eventName]) { + this.listeners[eventName] = []; + } + this.listeners[eventName].push({ node: node, handler: handler }); + } + }]); + + return Emitter; +}(_eventemitter2.default); + +Emitter.events = { + EDITOR_CHANGE: 'editor-change', + SCROLL_BEFORE_UPDATE: 'scroll-before-update', + SCROLL_OPTIMIZE: 'scroll-optimize', + SCROLL_UPDATE: 'scroll-update', + SELECTION_CHANGE: 'selection-change', + TEXT_CHANGE: 'text-change' +}; +Emitter.sources = { + API: 'api', + SILENT: 'silent', + USER: 'user' +}; + +exports.default = Emitter; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Module = function Module(quill) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Module); + + this.quill = quill; + this.options = options; +}; + +Module.DEFAULTS = {}; + +exports.default = Module; + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var levels = ['error', 'warn', 'log', 'info']; +var level = 'warn'; + +function debug(method) { + if (levels.indexOf(method) <= levels.indexOf(level)) { + var _console; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + (_console = console)[method].apply(_console, args); // eslint-disable-line no-console + } +} + +function namespace(ns) { + return levels.reduce(function (logger, method) { + logger[method] = debug.bind(console, method, ns); + return logger; + }, {}); +} + +debug.level = namespace.level = function (newLevel) { + level = newLevel; +}; + +exports.default = namespace; + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +var pSlice = Array.prototype.slice; +var objectKeys = __webpack_require__(52); +var isArguments = __webpack_require__(53); + +var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } +} + +function isUndefinedOrNull(value) { + return value === null || value === undefined; +} + +function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; +} + +function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; +} + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var Attributor = /** @class */ (function () { + function Attributor(attrName, keyName, options) { + if (options === void 0) { options = {}; } + this.attrName = attrName; + this.keyName = keyName; + var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; + if (options.scope != null) { + // Ignore type bits, force attribute bit + this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; + } + else { + this.scope = Registry.Scope.ATTRIBUTE; + } + if (options.whitelist != null) + this.whitelist = options.whitelist; + } + Attributor.keys = function (node) { + return [].map.call(node.attributes, function (item) { + return item.name; + }); + }; + Attributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + node.setAttribute(this.keyName, value); + return true; + }; + Attributor.prototype.canAdd = function (node, value) { + var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); + if (match == null) + return false; + if (this.whitelist == null) + return true; + if (typeof value === 'string') { + return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1; + } + else { + return this.whitelist.indexOf(value) > -1; + } + }; + Attributor.prototype.remove = function (node) { + node.removeAttribute(this.keyName); + }; + Attributor.prototype.value = function (node) { + var value = node.getAttribute(this.keyName); + if (this.canAdd(node, value) && value) { + return value; + } + return ''; + }; + return Attributor; +}()); +exports.default = Attributor; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Code = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Code = function (_Inline) { + _inherits(Code, _Inline); + + function Code() { + _classCallCheck(this, Code); + + return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); + } + + return Code; +}(_inline2.default); + +Code.blotName = 'code'; +Code.tagName = 'CODE'; + +var CodeBlock = function (_Block) { + _inherits(CodeBlock, _Block); + + function CodeBlock() { + _classCallCheck(this, CodeBlock); + + return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); + } + + _createClass(CodeBlock, [{ + key: 'delta', + value: function delta() { + var _this3 = this; + + var text = this.domNode.textContent; + if (text.endsWith('\n')) { + // Should always be true + text = text.slice(0, -1); + } + return text.split('\n').reduce(function (delta, frag) { + return delta.insert(frag).insert('\n', _this3.formats()); + }, new _quillDelta2.default()); + } + }, { + key: 'format', + value: function format(name, value) { + if (name === this.statics.blotName && value) return; + + var _descendant = this.descendant(_text2.default, this.length() - 1), + _descendant2 = _slicedToArray(_descendant, 1), + text = _descendant2[0]; + + if (text != null) { + text.deleteAt(text.length() - 1, 1); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length === 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { + return; + } + var nextNewline = this.newlineIndex(index); + if (nextNewline < 0 || nextNewline >= index + length) return; + var prevNewline = this.newlineIndex(index, true) + 1; + var isolateLength = nextNewline - prevNewline + 1; + var blot = this.isolate(prevNewline, isolateLength); + var next = blot.next; + blot.format(name, value); + if (next instanceof CodeBlock) { + next.formatAt(0, index - prevNewline + length - isolateLength, name, value); + } + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return; + + var _descendant3 = this.descendant(_text2.default, index), + _descendant4 = _slicedToArray(_descendant3, 2), + text = _descendant4[0], + offset = _descendant4[1]; + + text.insertAt(offset, value); + } + }, { + key: 'length', + value: function length() { + var length = this.domNode.textContent.length; + if (!this.domNode.textContent.endsWith('\n')) { + return length + 1; + } + return length; + } + }, { + key: 'newlineIndex', + value: function newlineIndex(searchIndex) { + var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (!reverse) { + var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); + return offset > -1 ? searchIndex + offset : -1; + } else { + return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + if (!this.domNode.textContent.endsWith('\n')) { + this.appendChild(_parchment2.default.create('text', '\n')); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { + next.optimize(context); + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); + [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { + var blot = _parchment2.default.find(node); + if (blot == null) { + node.parentNode.removeChild(node); + } else if (blot instanceof _parchment2.default.Embed) { + blot.remove(); + } else { + blot.unwrap(); + } + }); + } + }], [{ + key: 'create', + value: function create(value) { + var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); + domNode.setAttribute('spellcheck', false); + return domNode; + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return CodeBlock; +}(_block2.default); + +CodeBlock.blotName = 'code-block'; +CodeBlock.tagName = 'PRE'; +CodeBlock.TAB = ' '; + +exports.Code = Code; +exports.default = CodeBlock; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _cursor = __webpack_require__(24); + +var _cursor2 = _interopRequireDefault(_cursor); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var ASCII = /^[ -~]*$/; + +var Editor = function () { + function Editor(scroll) { + _classCallCheck(this, Editor); + + this.scroll = scroll; + this.delta = this.getDelta(); + } + + _createClass(Editor, [{ + key: 'applyDelta', + value: function applyDelta(delta) { + var _this = this; + + var consumeNextNewline = false; + this.scroll.update(); + var scrollLength = this.scroll.length(); + this.scroll.batchStart(); + delta = normalizeDelta(delta); + delta.reduce(function (index, op) { + var length = op.retain || op.delete || op.insert.length || 1; + var attributes = op.attributes || {}; + if (op.insert != null) { + if (typeof op.insert === 'string') { + var text = op.insert; + if (text.endsWith('\n') && consumeNextNewline) { + consumeNextNewline = false; + text = text.slice(0, -1); + } + if (index >= scrollLength && !text.endsWith('\n')) { + consumeNextNewline = true; + } + _this.scroll.insertAt(index, text); + + var _scroll$line = _this.scroll.line(index), + _scroll$line2 = _slicedToArray(_scroll$line, 2), + line = _scroll$line2[0], + offset = _scroll$line2[1]; + + var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); + if (line instanceof _block2.default) { + var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), + _line$descendant2 = _slicedToArray(_line$descendant, 1), + leaf = _line$descendant2[0]; + + formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); + } + attributes = _op2.default.attributes.diff(formats, attributes) || {}; + } else if (_typeof(op.insert) === 'object') { + var key = Object.keys(op.insert)[0]; // There should only be one key + if (key == null) return index; + _this.scroll.insertAt(index, key, op.insert[key]); + } + scrollLength += length; + } + Object.keys(attributes).forEach(function (name) { + _this.scroll.formatAt(index, length, name, attributes[name]); + }); + return index + length; + }, 0); + delta.reduce(function (index, op) { + if (typeof op.delete === 'number') { + _this.scroll.deleteAt(index, op.delete); + return index; + } + return index + (op.retain || op.insert.length || 1); + }, 0); + this.scroll.batchEnd(); + return this.update(delta); + } + }, { + key: 'deleteText', + value: function deleteText(index, length) { + this.scroll.deleteAt(index, length); + return this.update(new _quillDelta2.default().retain(index).delete(length)); + } + }, { + key: 'formatLine', + value: function formatLine(index, length) { + var _this2 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + this.scroll.update(); + Object.keys(formats).forEach(function (format) { + if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return; + var lines = _this2.scroll.lines(index, Math.max(length, 1)); + var lengthRemaining = length; + lines.forEach(function (line) { + var lineLength = line.length(); + if (!(line instanceof _code2.default)) { + line.format(format, formats[format]); + } else { + var codeIndex = index - line.offset(_this2.scroll); + var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; + line.formatAt(codeIndex, codeLength, format, formats[format]); + } + lengthRemaining -= lineLength; + }); + }); + this.scroll.optimize(); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'formatText', + value: function formatText(index, length) { + var _this3 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + Object.keys(formats).forEach(function (format) { + _this3.scroll.formatAt(index, length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'getContents', + value: function getContents(index, length) { + return this.delta.slice(index, index + length); + } + }, { + key: 'getDelta', + value: function getDelta() { + return this.scroll.lines().reduce(function (delta, line) { + return delta.concat(line.delta()); + }, new _quillDelta2.default()); + } + }, { + key: 'getFormat', + value: function getFormat(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var lines = [], + leaves = []; + if (length === 0) { + this.scroll.path(index).forEach(function (path) { + var _path = _slicedToArray(path, 1), + blot = _path[0]; + + if (blot instanceof _block2.default) { + lines.push(blot); + } else if (blot instanceof _parchment2.default.Leaf) { + leaves.push(blot); + } + }); + } else { + lines = this.scroll.lines(index, length); + leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); + } + var formatsArr = [lines, leaves].map(function (blots) { + if (blots.length === 0) return {}; + var formats = (0, _block.bubbleFormats)(blots.shift()); + while (Object.keys(formats).length > 0) { + var blot = blots.shift(); + if (blot == null) return formats; + formats = combineFormats((0, _block.bubbleFormats)(blot), formats); + } + return formats; + }); + return _extend2.default.apply(_extend2.default, formatsArr); + } + }, { + key: 'getText', + value: function getText(index, length) { + return this.getContents(index, length).filter(function (op) { + return typeof op.insert === 'string'; + }).map(function (op) { + return op.insert; + }).join(''); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + this.scroll.insertAt(index, embed, value); + return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); + } + }, { + key: 'insertText', + value: function insertText(index, text) { + var _this4 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + this.scroll.insertAt(index, text); + Object.keys(formats).forEach(function (format) { + _this4.scroll.formatAt(index, text.length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); + } + }, { + key: 'isBlank', + value: function isBlank() { + if (this.scroll.children.length == 0) return true; + if (this.scroll.children.length > 1) return false; + var block = this.scroll.children.head; + if (block.statics.blotName !== _block2.default.blotName) return false; + if (block.children.length > 1) return false; + return block.children.head instanceof _break2.default; + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length) { + var text = this.getText(index, length); + + var _scroll$line3 = this.scroll.line(index + length), + _scroll$line4 = _slicedToArray(_scroll$line3, 2), + line = _scroll$line4[0], + offset = _scroll$line4[1]; + + var suffixLength = 0, + suffix = new _quillDelta2.default(); + if (line != null) { + if (!(line instanceof _code2.default)) { + suffixLength = line.length() - offset; + } else { + suffixLength = line.newlineIndex(offset) - offset + 1; + } + suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); + } + var contents = this.getContents(index, length + suffixLength); + var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); + var delta = new _quillDelta2.default().retain(index).concat(diff); + return this.applyDelta(delta); + } + }, { + key: 'update', + value: function update(change) { + var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + + var oldDelta = this.delta; + if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) { + // Optimization for character changes + var textBlot = _parchment2.default.find(mutations[0].target); + var formats = (0, _block.bubbleFormats)(textBlot); + var index = textBlot.offset(this.scroll); + var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); + var oldText = new _quillDelta2.default().insert(oldValue); + var newText = new _quillDelta2.default().insert(textBlot.value()); + var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); + change = diffDelta.reduce(function (delta, op) { + if (op.insert) { + return delta.insert(op.insert, formats); + } else { + return delta.push(op); + } + }, new _quillDelta2.default()); + this.delta = oldDelta.compose(change); + } else { + this.delta = this.getDelta(); + if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { + change = oldDelta.diff(this.delta, cursorIndex); + } + } + return change; + } + }]); + + return Editor; +}(); + +function combineFormats(formats, combined) { + return Object.keys(combined).reduce(function (merged, name) { + if (formats[name] == null) return merged; + if (combined[name] === formats[name]) { + merged[name] = combined[name]; + } else if (Array.isArray(combined[name])) { + if (combined[name].indexOf(formats[name]) < 0) { + merged[name] = combined[name].concat([formats[name]]); + } + } else { + merged[name] = [combined[name], formats[name]]; + } + return merged; + }, {}); +} + +function normalizeDelta(delta) { + return delta.reduce(function (delta, op) { + if (op.insert === 1) { + var attributes = (0, _clone2.default)(op.attributes); + delete attributes['image']; + return delta.insert({ image: op.attributes.image }, attributes); + } + if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { + op = (0, _clone2.default)(op); + if (op.attributes.list) { + op.attributes.list = 'ordered'; + } else { + op.attributes.list = 'bullet'; + delete op.attributes.bullet; + } + } + if (typeof op.insert === 'string') { + var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + return delta.insert(text, op.attributes); + } + return delta.push(op); + }, new _quillDelta2.default()); +} + +exports.default = Editor; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Range = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill:selection'); + +var Range = function Range(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + _classCallCheck(this, Range); + + this.index = index; + this.length = length; +}; + +var Selection = function () { + function Selection(scroll, emitter) { + var _this = this; + + _classCallCheck(this, Selection); + + this.emitter = emitter; + this.scroll = scroll; + this.composing = false; + this.mouseDown = false; + this.root = this.scroll.domNode; + this.cursor = _parchment2.default.create('cursor', this); + // savedRange is last non-null range + this.lastRange = this.savedRange = new Range(0, 0); + this.handleComposition(); + this.handleDragging(); + this.emitter.listenDOM('selectionchange', document, function () { + if (!_this.mouseDown) { + setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1); + } + }); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { + if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { + _this.update(_emitter4.default.sources.SILENT); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { + if (!_this.hasFocus()) return; + var native = _this.getNativeRange(); + if (native == null) return; + if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle + // TODO unclear if this has negative side effects + _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { + try { + _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); + } catch (ignored) {} + }); + }); + this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) { + if (context.range) { + var _context$range = context.range, + startNode = _context$range.startNode, + startOffset = _context$range.startOffset, + endNode = _context$range.endNode, + endOffset = _context$range.endOffset; + + _this.setNativeRange(startNode, startOffset, endNode, endOffset); + } + }); + this.update(_emitter4.default.sources.SILENT); + } + + _createClass(Selection, [{ + key: 'handleComposition', + value: function handleComposition() { + var _this2 = this; + + this.root.addEventListener('compositionstart', function () { + _this2.composing = true; + }); + this.root.addEventListener('compositionend', function () { + _this2.composing = false; + if (_this2.cursor.parent) { + var range = _this2.cursor.restore(); + if (!range) return; + setTimeout(function () { + _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset); + }, 1); + } + }); + } + }, { + key: 'handleDragging', + value: function handleDragging() { + var _this3 = this; + + this.emitter.listenDOM('mousedown', document.body, function () { + _this3.mouseDown = true; + }); + this.emitter.listenDOM('mouseup', document.body, function () { + _this3.mouseDown = false; + _this3.update(_emitter4.default.sources.USER); + }); + } + }, { + key: 'focus', + value: function focus() { + if (this.hasFocus()) return; + this.root.focus(); + this.setRange(this.savedRange); + } + }, { + key: 'format', + value: function format(_format, value) { + if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return; + this.scroll.update(); + var nativeRange = this.getNativeRange(); + if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; + if (nativeRange.start.node !== this.cursor.textNode) { + var blot = _parchment2.default.find(nativeRange.start.node, false); + if (blot == null) return; + // TODO Give blot ability to not split + if (blot instanceof _parchment2.default.Leaf) { + var after = blot.split(nativeRange.start.offset); + blot.parent.insertBefore(this.cursor, after); + } else { + blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen + } + this.cursor.attach(); + } + this.cursor.format(_format, value); + this.scroll.optimize(); + this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); + this.update(); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var scrollLength = this.scroll.length(); + index = Math.min(index, scrollLength - 1); + length = Math.min(index + length, scrollLength - 1) - index; + var node = void 0, + _scroll$leaf = this.scroll.leaf(index), + _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), + leaf = _scroll$leaf2[0], + offset = _scroll$leaf2[1]; + if (leaf == null) return null; + + var _leaf$position = leaf.position(offset, true); + + var _leaf$position2 = _slicedToArray(_leaf$position, 2); + + node = _leaf$position2[0]; + offset = _leaf$position2[1]; + + var range = document.createRange(); + if (length > 0) { + range.setStart(node, offset); + + var _scroll$leaf3 = this.scroll.leaf(index + length); + + var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); + + leaf = _scroll$leaf4[0]; + offset = _scroll$leaf4[1]; + + if (leaf == null) return null; + + var _leaf$position3 = leaf.position(offset, true); + + var _leaf$position4 = _slicedToArray(_leaf$position3, 2); + + node = _leaf$position4[0]; + offset = _leaf$position4[1]; + + range.setEnd(node, offset); + return range.getBoundingClientRect(); + } else { + var side = 'left'; + var rect = void 0; + if (node instanceof Text) { + if (offset < node.data.length) { + range.setStart(node, offset); + range.setEnd(node, offset + 1); + } else { + range.setStart(node, offset - 1); + range.setEnd(node, offset); + side = 'right'; + } + rect = range.getBoundingClientRect(); + } else { + rect = leaf.domNode.getBoundingClientRect(); + if (offset > 0) side = 'right'; + } + return { + bottom: rect.top + rect.height, + height: rect.height, + left: rect[side], + right: rect[side], + top: rect.top, + width: 0 + }; + } + } + }, { + key: 'getNativeRange', + value: function getNativeRange() { + var selection = document.getSelection(); + if (selection == null || selection.rangeCount <= 0) return null; + var nativeRange = selection.getRangeAt(0); + if (nativeRange == null) return null; + var range = this.normalizeNative(nativeRange); + debug.info('getNativeRange', range); + return range; + } + }, { + key: 'getRange', + value: function getRange() { + var normalized = this.getNativeRange(); + if (normalized == null) return [null, null]; + var range = this.normalizedToRange(normalized); + return [range, normalized]; + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return document.activeElement === this.root; + } + }, { + key: 'normalizedToRange', + value: function normalizedToRange(range) { + var _this4 = this; + + var positions = [[range.start.node, range.start.offset]]; + if (!range.native.collapsed) { + positions.push([range.end.node, range.end.offset]); + } + var indexes = positions.map(function (position) { + var _position = _slicedToArray(position, 2), + node = _position[0], + offset = _position[1]; + + var blot = _parchment2.default.find(node, true); + var index = blot.offset(_this4.scroll); + if (offset === 0) { + return index; + } else if (blot instanceof _parchment2.default.Container) { + return index + blot.length(); + } else { + return index + blot.index(node, offset); + } + }); + var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1); + var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes))); + return new Range(start, end - start); + } + }, { + key: 'normalizeNative', + value: function normalizeNative(nativeRange) { + if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { + return null; + } + var range = { + start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, + end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, + native: nativeRange + }; + [range.start, range.end].forEach(function (position) { + var node = position.node, + offset = position.offset; + while (!(node instanceof Text) && node.childNodes.length > 0) { + if (node.childNodes.length > offset) { + node = node.childNodes[offset]; + offset = 0; + } else if (node.childNodes.length === offset) { + node = node.lastChild; + offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; + } else { + break; + } + } + position.node = node, position.offset = offset; + }); + return range; + } + }, { + key: 'rangeToNative', + value: function rangeToNative(range) { + var _this5 = this; + + var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; + var args = []; + var scrollLength = this.scroll.length(); + indexes.forEach(function (index, i) { + index = Math.min(scrollLength - 1, index); + var node = void 0, + _scroll$leaf5 = _this5.scroll.leaf(index), + _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), + leaf = _scroll$leaf6[0], + offset = _scroll$leaf6[1]; + var _leaf$position5 = leaf.position(offset, i !== 0); + + var _leaf$position6 = _slicedToArray(_leaf$position5, 2); + + node = _leaf$position6[0]; + offset = _leaf$position6[1]; + + args.push(node, offset); + }); + if (args.length < 2) { + args = args.concat(args); + } + return args; + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView(scrollingContainer) { + var range = this.lastRange; + if (range == null) return; + var bounds = this.getBounds(range.index, range.length); + if (bounds == null) return; + var limit = this.scroll.length() - 1; + + var _scroll$line = this.scroll.line(Math.min(range.index, limit)), + _scroll$line2 = _slicedToArray(_scroll$line, 1), + first = _scroll$line2[0]; + + var last = first; + if (range.length > 0) { + var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit)); + + var _scroll$line4 = _slicedToArray(_scroll$line3, 1); + + last = _scroll$line4[0]; + } + if (first == null || last == null) return; + var scrollBounds = scrollingContainer.getBoundingClientRect(); + if (bounds.top < scrollBounds.top) { + scrollingContainer.scrollTop -= scrollBounds.top - bounds.top; + } else if (bounds.bottom > scrollBounds.bottom) { + scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom; + } + } + }, { + key: 'setNativeRange', + value: function setNativeRange(startNode, startOffset) { + var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; + var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; + var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); + if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { + return; + } + var selection = document.getSelection(); + if (selection == null) return; + if (startNode != null) { + if (!this.hasFocus()) this.root.focus(); + var native = (this.getNativeRange() || {}).native; + if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) { + + if (startNode.tagName == "BR") { + startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode); + startNode = startNode.parentNode; + } + if (endNode.tagName == "BR") { + endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode); + endNode = endNode.parentNode; + } + var range = document.createRange(); + range.setStart(startNode, startOffset); + range.setEnd(endNode, endOffset); + selection.removeAllRanges(); + selection.addRange(range); + } + } else { + selection.removeAllRanges(); + this.root.blur(); + document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) + } + } + }, { + key: 'setRange', + value: function setRange(range) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + if (typeof force === 'string') { + source = force; + force = false; + } + debug.info('setRange', range); + if (range != null) { + var args = this.rangeToNative(range); + this.setNativeRange.apply(this, _toConsumableArray(args).concat([force])); + } else { + this.setNativeRange(null); + } + this.update(source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var oldRange = this.lastRange; + + var _getRange = this.getRange(), + _getRange2 = _slicedToArray(_getRange, 2), + lastRange = _getRange2[0], + nativeRange = _getRange2[1]; + + this.lastRange = lastRange; + if (this.lastRange != null) { + this.savedRange = this.lastRange; + } + if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { + var _emitter; + + if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { + this.cursor.restore(); + } + var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + } + }]); + + return Selection; +}(); + +function contains(parent, descendant) { + try { + // Firefox inserts inaccessible nodes around video elements + descendant.parentNode; + } catch (e) { + return false; + } + // IE11 has bug with Text nodes + // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect + if (descendant instanceof Text) { + descendant = descendant.parentNode; + } + return parent.contains(descendant); +} + +exports.Range = Range; +exports.default = Selection; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Break = function (_Parchment$Embed) { + _inherits(Break, _Parchment$Embed); + + function Break() { + _classCallCheck(this, Break); + + return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); + } + + _createClass(Break, [{ + key: 'insertInto', + value: function insertInto(parent, ref) { + if (parent.children.length === 0) { + _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); + } else { + this.remove(); + } + } + }, { + key: 'length', + value: function length() { + return 0; + } + }, { + key: 'value', + value: function value() { + return ''; + } + }], [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + return Break; +}(_parchment2.default.Embed); + +Break.blotName = 'break'; +Break.tagName = 'BR'; + +exports.default = Break; + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var linked_list_1 = __webpack_require__(44); +var shadow_1 = __webpack_require__(30); +var Registry = __webpack_require__(1); +var ContainerBlot = /** @class */ (function (_super) { + __extends(ContainerBlot, _super); + function ContainerBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.build(); + return _this; + } + ContainerBlot.prototype.appendChild = function (other) { + this.insertBefore(other); + }; + ContainerBlot.prototype.attach = function () { + _super.prototype.attach.call(this); + this.children.forEach(function (child) { + child.attach(); + }); + }; + ContainerBlot.prototype.build = function () { + var _this = this; + this.children = new linked_list_1.default(); + // Need to be reversed for if DOM nodes already in order + [].slice + .call(this.domNode.childNodes) + .reverse() + .forEach(function (node) { + try { + var child = makeBlot(node); + _this.insertBefore(child, _this.children.head || undefined); + } + catch (err) { + if (err instanceof Registry.ParchmentError) + return; + else + throw err; + } + }); + }; + ContainerBlot.prototype.deleteAt = function (index, length) { + if (index === 0 && length === this.length()) { + return this.remove(); + } + this.children.forEachAt(index, length, function (child, offset, length) { + child.deleteAt(offset, length); + }); + }; + ContainerBlot.prototype.descendant = function (criteria, index) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + return [child, offset]; + } + else if (child instanceof ContainerBlot) { + return child.descendant(criteria, offset); + } + else { + return [null, -1]; + } + }; + ContainerBlot.prototype.descendants = function (criteria, index, length) { + if (index === void 0) { index = 0; } + if (length === void 0) { length = Number.MAX_VALUE; } + var descendants = []; + var lengthLeft = length; + this.children.forEachAt(index, length, function (child, index, length) { + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + descendants.push(child); + } + if (child instanceof ContainerBlot) { + descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); + } + lengthLeft -= length; + }); + return descendants; + }; + ContainerBlot.prototype.detach = function () { + this.children.forEach(function (child) { + child.detach(); + }); + _super.prototype.detach.call(this); + }; + ContainerBlot.prototype.formatAt = function (index, length, name, value) { + this.children.forEachAt(index, length, function (child, offset, length) { + child.formatAt(offset, length, name, value); + }); + }; + ContainerBlot.prototype.insertAt = function (index, value, def) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if (child) { + child.insertAt(offset, value, def); + } + else { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + this.appendChild(blot); + } + }; + ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { + if (this.statics.allowedChildren != null && + !this.statics.allowedChildren.some(function (child) { + return childBlot instanceof child; + })) { + throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); + } + childBlot.insertInto(this, refBlot); + }; + ContainerBlot.prototype.length = function () { + return this.children.reduce(function (memo, child) { + return memo + child.length(); + }, 0); + }; + ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { + this.children.forEach(function (child) { + targetParent.insertBefore(child, refNode); + }); + }; + ContainerBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + if (this.children.length === 0) { + if (this.statics.defaultChild != null) { + var child = Registry.create(this.statics.defaultChild); + this.appendChild(child); + child.optimize(context); + } + else { + this.remove(); + } + } + }; + ContainerBlot.prototype.path = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; + var position = [[this, index]]; + if (child instanceof ContainerBlot) { + return position.concat(child.path(offset, inclusive)); + } + else if (child != null) { + position.push([child, offset]); + } + return position; + }; + ContainerBlot.prototype.removeChild = function (child) { + this.children.remove(child); + }; + ContainerBlot.prototype.replace = function (target) { + if (target instanceof ContainerBlot) { + target.moveChildren(this); + } + _super.prototype.replace.call(this, target); + }; + ContainerBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = this.clone(); + this.parent.insertBefore(after, this.next); + this.children.forEachAt(index, this.length(), function (child, offset, length) { + child = child.split(offset, force); + after.appendChild(child); + }); + return after; + }; + ContainerBlot.prototype.unwrap = function () { + this.moveChildren(this.parent, this.next); + this.remove(); + }; + ContainerBlot.prototype.update = function (mutations, context) { + var _this = this; + var addedNodes = []; + var removedNodes = []; + mutations.forEach(function (mutation) { + if (mutation.target === _this.domNode && mutation.type === 'childList') { + addedNodes.push.apply(addedNodes, mutation.addedNodes); + removedNodes.push.apply(removedNodes, mutation.removedNodes); + } + }); + removedNodes.forEach(function (node) { + // Check node has actually been removed + // One exception is Chrome does not immediately remove IFRAMEs + // from DOM but MutationRecord is correct in its reported removal + if (node.parentNode != null && + // @ts-ignore + node.tagName !== 'IFRAME' && + document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return; + } + var blot = Registry.find(node); + if (blot == null) + return; + if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { + blot.detach(); + } + }); + addedNodes + .filter(function (node) { + return node.parentNode == _this.domNode; + }) + .sort(function (a, b) { + if (a === b) + return 0; + if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { + return 1; + } + return -1; + }) + .forEach(function (node) { + var refBlot = null; + if (node.nextSibling != null) { + refBlot = Registry.find(node.nextSibling); + } + var blot = makeBlot(node); + if (blot.next != refBlot || blot.next == null) { + if (blot.parent != null) { + blot.parent.removeChild(_this); + } + _this.insertBefore(blot, refBlot || undefined); + } + }); + }; + return ContainerBlot; +}(shadow_1.default)); +function makeBlot(node) { + var blot = Registry.find(node); + if (blot == null) { + try { + blot = Registry.create(node); + } + catch (e) { + blot = Registry.create(Registry.Scope.INLINE); + [].slice.call(node.childNodes).forEach(function (child) { + // @ts-ignore + blot.domNode.appendChild(child); + }); + if (node.parentNode) { + node.parentNode.replaceChild(blot.domNode, node); + } + blot.attach(); + } + } + return blot; +} +exports.default = ContainerBlot; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var store_1 = __webpack_require__(31); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var FormatBlot = /** @class */ (function (_super) { + __extends(FormatBlot, _super); + function FormatBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.attributes = new store_1.default(_this.domNode); + return _this; + } + FormatBlot.formats = function (domNode) { + if (typeof this.tagName === 'string') { + return true; + } + else if (Array.isArray(this.tagName)) { + return domNode.tagName.toLowerCase(); + } + return undefined; + }; + FormatBlot.prototype.format = function (name, value) { + var format = Registry.query(name); + if (format instanceof attributor_1.default) { + this.attributes.attribute(format, value); + } + else if (value) { + if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { + this.replaceWith(name, value); + } + } + }; + FormatBlot.prototype.formats = function () { + var formats = this.attributes.values(); + var format = this.statics.formats(this.domNode); + if (format != null) { + formats[this.statics.blotName] = format; + } + return formats; + }; + FormatBlot.prototype.replaceWith = function (name, value) { + var replacement = _super.prototype.replaceWith.call(this, name, value); + this.attributes.copy(replacement); + return replacement; + }; + FormatBlot.prototype.update = function (mutations, context) { + var _this = this; + _super.prototype.update.call(this, mutations, context); + if (mutations.some(function (mutation) { + return mutation.target === _this.domNode && mutation.type === 'attributes'; + })) { + this.attributes.build(); + } + }; + FormatBlot.prototype.wrap = function (name, value) { + var wrapper = _super.prototype.wrap.call(this, name, value); + if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { + this.attributes.move(wrapper); + } + return wrapper; + }; + return FormatBlot; +}(container_1.default)); +exports.default = FormatBlot; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var shadow_1 = __webpack_require__(30); +var Registry = __webpack_require__(1); +var LeafBlot = /** @class */ (function (_super) { + __extends(LeafBlot, _super); + function LeafBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + LeafBlot.value = function (domNode) { + return true; + }; + LeafBlot.prototype.index = function (node, offset) { + if (this.domNode === node || + this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return Math.min(offset, 1); + } + return -1; + }; + LeafBlot.prototype.position = function (index, inclusive) { + var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); + if (index > 0) + offset += 1; + return [this.parent.domNode, offset]; + }; + LeafBlot.prototype.value = function () { + return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a; + var _a; + }; + LeafBlot.scope = Registry.Scope.INLINE_BLOT; + return LeafBlot; +}(shadow_1.default)); +exports.default = LeafBlot; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); + + +var lib = { + attributes: { + compose: function (a, b, keepNull) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = extend(true, {}, b); + if (!keepNull) { + attributes = Object.keys(attributes).reduce(function (copy, key) { + if (attributes[key] != null) { + copy[key] = attributes[key]; + } + return copy; + }, {}); + } + for (var key in a) { + if (a[key] !== undefined && b[key] === undefined) { + attributes[key] = a[key]; + } + } + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + diff: function(a, b) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { + if (!equal(a[key], b[key])) { + attributes[key] = b[key] === undefined ? null : b[key]; + } + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + transform: function (a, b, priority) { + if (typeof a !== 'object') return b; + if (typeof b !== 'object') return undefined; + if (!priority) return b; // b simply overwrites us without priority + var attributes = Object.keys(b).reduce(function (attributes, key) { + if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + } + }, + + iterator: function (ops) { + return new Iterator(ops); + }, + + length: function (op) { + if (typeof op['delete'] === 'number') { + return op['delete']; + } else if (typeof op.retain === 'number') { + return op.retain; + } else { + return typeof op.insert === 'string' ? op.insert.length : 1; + } + } +}; + + +function Iterator(ops) { + this.ops = ops; + this.index = 0; + this.offset = 0; +}; + +Iterator.prototype.hasNext = function () { + return this.peekLength() < Infinity; +}; + +Iterator.prototype.next = function (length) { + if (!length) length = Infinity; + var nextOp = this.ops[this.index]; + if (nextOp) { + var offset = this.offset; + var opLength = lib.length(nextOp) + if (length >= opLength - offset) { + length = opLength - offset; + this.index += 1; + this.offset = 0; + } else { + this.offset += length; + } + if (typeof nextOp['delete'] === 'number') { + return { 'delete': length }; + } else { + var retOp = {}; + if (nextOp.attributes) { + retOp.attributes = nextOp.attributes; + } + if (typeof nextOp.retain === 'number') { + retOp.retain = length; + } else if (typeof nextOp.insert === 'string') { + retOp.insert = nextOp.insert.substr(offset, length); + } else { + // offset should === 0, length should === 1 + retOp.insert = nextOp.insert; + } + return retOp; + } + } else { + return { retain: Infinity }; + } +}; + +Iterator.prototype.peek = function () { + return this.ops[this.index]; +}; + +Iterator.prototype.peekLength = function () { + if (this.ops[this.index]) { + // Should never return 0 if our index is being managed correctly + return lib.length(this.ops[this.index]) - this.offset; + } else { + return Infinity; + } +}; + +Iterator.prototype.peekType = function () { + if (this.ops[this.index]) { + if (typeof this.ops[this.index]['delete'] === 'number') { + return 'delete'; + } else if (typeof this.ops[this.index].retain === 'number') { + return 'retain'; + } else { + return 'insert'; + } + } + return 'retain'; +}; + + +module.exports = lib; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports) { + +var clone = (function() { +'use strict'; + +function _instanceof(obj, type) { + return type != null && obj instanceof type; +} + +var nativeMap; +try { + nativeMap = Map; +} catch(_) { + // maybe a reference error because no `Map`. Give it a dummy value that no + // value will ever be an instanceof. + nativeMap = function() {}; +} + +var nativeSet; +try { + nativeSet = Set; +} catch(_) { + nativeSet = function() {}; +} + +var nativePromise; +try { + nativePromise = Promise; +} catch(_) { + nativePromise = function() {}; +} + +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). + * @param `includeNonEnumerable` - set to true if the non-enumerable properties + * should be cloned as well. Non-enumerable properties on the prototype + * chain will be ignored. (optional - false by default) +*/ +function clone(parent, circular, depth, prototype, includeNonEnumerable) { + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + includeNonEnumerable = circular.includeNonEnumerable; + circular = circular.circular; + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth === 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (_instanceof(parent, nativeMap)) { + child = new nativeMap(); + } else if (_instanceof(parent, nativeSet)) { + child = new nativeSet(); + } else if (_instanceof(parent, nativePromise)) { + child = new nativePromise(function (resolve, reject) { + parent.then(function(value) { + resolve(_clone(value, depth - 1)); + }, function(err) { + reject(_clone(err, depth - 1)); + }); + }); + } else if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + child = new Buffer(parent.length); + parent.copy(child); + return child; + } else if (_instanceof(parent, Error)) { + child = Object.create(parent); + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + if (_instanceof(parent, nativeMap)) { + parent.forEach(function(value, key) { + var keyChild = _clone(key, depth - 1); + var valueChild = _clone(value, depth - 1); + child.set(keyChild, valueChild); + }); + } + if (_instanceof(parent, nativeSet)) { + parent.forEach(function(value) { + var entryChild = _clone(value, depth - 1); + child.add(entryChild); + }); + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(parent); + for (var i = 0; i < symbols.length; i++) { + // Don't need to worry about cloning a symbol because it is a primitive, + // like a number or string. + var symbol = symbols[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, symbol); + if (descriptor && !descriptor.enumerable && !includeNonEnumerable) { + continue; + } + child[symbol] = _clone(parent[symbol], depth - 1); + if (!descriptor.enumerable) { + Object.defineProperty(child, symbol, { + enumerable: false + }); + } + } + } + + if (includeNonEnumerable) { + var allPropertyNames = Object.getOwnPropertyNames(parent); + for (var i = 0; i < allPropertyNames.length; i++) { + var propertyName = allPropertyNames[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName); + if (descriptor && descriptor.enumerable) { + continue; + } + child[propertyName] = _clone(parent[propertyName], depth - 1); + Object.defineProperty(child, propertyName, { + enumerable: false + }); + } + } + + return child; + } + + return _clone(parent, depth); +} + +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); +}; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +} +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +} +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +} +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +} +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +} +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _container = __webpack_require__(25); + +var _container2 = _interopRequireDefault(_container); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function isLine(blot) { + return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; +} + +var Scroll = function (_Parchment$Scroll) { + _inherits(Scroll, _Parchment$Scroll); + + function Scroll(domNode, config) { + _classCallCheck(this, Scroll); + + var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); + + _this.emitter = config.emitter; + if (Array.isArray(config.whitelist)) { + _this.whitelist = config.whitelist.reduce(function (whitelist, format) { + whitelist[format] = true; + return whitelist; + }, {}); + } + // Some reason fixes composition issues with character languages in Windows/Chrome, Safari + _this.domNode.addEventListener('DOMNodeInserted', function () {}); + _this.optimize(); + _this.enable(); + return _this; + } + + _createClass(Scroll, [{ + key: 'batchStart', + value: function batchStart() { + this.batch = true; + } + }, { + key: 'batchEnd', + value: function batchEnd() { + this.batch = false; + this.optimize(); + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + var _line = this.line(index), + _line2 = _slicedToArray(_line, 2), + first = _line2[0], + offset = _line2[1]; + + var _line3 = this.line(index + length), + _line4 = _slicedToArray(_line3, 1), + last = _line4[0]; + + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); + if (last != null && first !== last && offset > 0) { + if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) { + this.optimize(); + return; + } + if (first instanceof _code2.default) { + var newlineIndex = first.newlineIndex(first.length(), true); + if (newlineIndex > -1) { + first = first.split(newlineIndex + 1); + if (first === last) { + this.optimize(); + return; + } + } + } else if (last instanceof _code2.default) { + var _newlineIndex = last.newlineIndex(0); + if (_newlineIndex > -1) { + last.split(_newlineIndex + 1); + } + } + var ref = last.children.head instanceof _break2.default ? null : last.children.head; + first.moveChildren(last, ref); + first.remove(); + } + this.optimize(); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.domNode.setAttribute('contenteditable', enabled); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, format, value) { + if (this.whitelist != null && !this.whitelist[format]) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); + this.optimize(); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null && this.whitelist != null && !this.whitelist[value]) return; + if (index >= this.length()) { + if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { + var blot = _parchment2.default.create(this.statics.defaultChild); + this.appendChild(blot); + if (def == null && value.endsWith('\n')) { + value = value.slice(0, -1); + } + blot.insertAt(0, value, def); + } else { + var embed = _parchment2.default.create(value, def); + this.appendChild(embed); + } + } else { + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); + } + this.optimize(); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { + var wrapper = _parchment2.default.create(this.statics.defaultChild); + wrapper.appendChild(blot); + blot = wrapper; + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); + } + }, { + key: 'leaf', + value: function leaf(index) { + return this.path(index).pop() || [null, -1]; + } + }, { + key: 'line', + value: function line(index) { + if (index === this.length()) { + return this.line(index - 1); + } + return this.descendant(isLine, index); + } + }, { + key: 'lines', + value: function lines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + var getLines = function getLines(blot, index, length) { + var lines = [], + lengthLeft = length; + blot.children.forEachAt(index, length, function (child, index, length) { + if (isLine(child)) { + lines.push(child); + } else if (child instanceof _parchment2.default.Container) { + lines = lines.concat(getLines(child, index, lengthLeft)); + } + lengthLeft -= length; + }); + return lines; + }; + return getLines(this, index, length); + } + }, { + key: 'optimize', + value: function optimize() { + var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (this.batch === true) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context); + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context); + } + } + }, { + key: 'path', + value: function path(index) { + return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self + } + }, { + key: 'update', + value: function update(mutations) { + if (this.batch === true) return; + var source = _emitter2.default.sources.USER; + if (typeof mutations === 'string') { + source = mutations; + } + if (!Array.isArray(mutations)) { + mutations = this.observer.takeRecords(); + } + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); + } + } + }]); + + return Scroll; +}(_parchment2.default.Scroll); + +Scroll.blotName = 'scroll'; +Scroll.className = 'ql-editor'; +Scroll.tagName = 'DIV'; +Scroll.defaultChild = 'block'; +Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; + +exports.default = Scroll; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SHORTKEY = exports.default = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:keyboard'); + +var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; + +var Keyboard = function (_Module) { + _inherits(Keyboard, _Module); + + _createClass(Keyboard, null, [{ + key: 'match', + value: function match(evt, binding) { + binding = normalize(binding); + if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { + return !!binding[key] !== evt[key] && binding[key] !== null; + })) { + return false; + } + return binding.key === (evt.which || evt.keyCode); + } + }]); + + function Keyboard(quill, options) { + _classCallCheck(this, Keyboard); + + var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); + + _this.bindings = {}; + Object.keys(_this.options.bindings).forEach(function (name) { + if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) { + return; + } + if (_this.options.bindings[name]) { + _this.addBinding(_this.options.bindings[name]); + } + }); + _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); + _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); + if (/Firefox/i.test(navigator.userAgent)) { + // Need to handle delete and backspace for Firefox in the general case #1171 + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete); + } else { + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete); + } + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace); + _this.listen(); + return _this; + } + + _createClass(Keyboard, [{ + key: 'addBinding', + value: function addBinding(key) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var binding = normalize(key); + if (binding == null || binding.key == null) { + return debug.warn('Attempted to add invalid keyboard binding', binding); + } + if (typeof context === 'function') { + context = { handler: context }; + } + if (typeof handler === 'function') { + handler = { handler: handler }; + } + binding = (0, _extend2.default)(binding, context, handler); + this.bindings[binding.key] = this.bindings[binding.key] || []; + this.bindings[binding.key].push(binding); + } + }, { + key: 'listen', + value: function listen() { + var _this2 = this; + + this.quill.root.addEventListener('keydown', function (evt) { + if (evt.defaultPrevented) return; + var which = evt.which || evt.keyCode; + var bindings = (_this2.bindings[which] || []).filter(function (binding) { + return Keyboard.match(evt, binding); + }); + if (bindings.length === 0) return; + var range = _this2.quill.getSelection(); + if (range == null || !_this2.quill.hasFocus()) return; + + var _quill$getLine = _this2.quill.getLine(range.index), + _quill$getLine2 = _slicedToArray(_quill$getLine, 2), + line = _quill$getLine2[0], + offset = _quill$getLine2[1]; + + var _quill$getLeaf = _this2.quill.getLeaf(range.index), + _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), + leafStart = _quill$getLeaf2[0], + offsetStart = _quill$getLeaf2[1]; + + var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), + _ref2 = _slicedToArray(_ref, 2), + leafEnd = _ref2[0], + offsetEnd = _ref2[1]; + + var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; + var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; + var curContext = { + collapsed: range.length === 0, + empty: range.length === 0 && line.length() <= 1, + format: _this2.quill.getFormat(range), + offset: offset, + prefix: prefixText, + suffix: suffixText + }; + var prevented = bindings.some(function (binding) { + if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; + if (binding.empty != null && binding.empty !== curContext.empty) return false; + if (binding.offset != null && binding.offset !== curContext.offset) return false; + if (Array.isArray(binding.format)) { + // any format is present + if (binding.format.every(function (name) { + return curContext.format[name] == null; + })) { + return false; + } + } else if (_typeof(binding.format) === 'object') { + // all formats must match + if (!Object.keys(binding.format).every(function (name) { + if (binding.format[name] === true) return curContext.format[name] != null; + if (binding.format[name] === false) return curContext.format[name] == null; + return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); + })) { + return false; + } + } + if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; + if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; + return binding.handler.call(_this2, range, curContext) !== true; + }); + if (prevented) { + evt.preventDefault(); + } + }); + } + }]); + + return Keyboard; +}(_module2.default); + +Keyboard.keys = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + ESCAPE: 27, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46 +}; + +Keyboard.DEFAULTS = { + bindings: { + 'bold': makeFormatHandler('bold'), + 'italic': makeFormatHandler('italic'), + 'underline': makeFormatHandler('underline'), + 'indent': { + // highlight tab or tab at beginning of list, indent or blockquote + key: Keyboard.keys.TAB, + format: ['blockquote', 'indent', 'list'], + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '+1', _quill2.default.sources.USER); + } + }, + 'outdent': { + key: Keyboard.keys.TAB, + shiftKey: true, + format: ['blockquote', 'indent', 'list'], + // highlight tab or tab at beginning of list, indent or blockquote + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } + }, + 'outdent backspace': { + key: Keyboard.keys.BACKSPACE, + collapsed: true, + shiftKey: null, + metaKey: null, + ctrlKey: null, + altKey: null, + format: ['indent', 'list'], + offset: 0, + handler: function handler(range, context) { + if (context.format.indent != null) { + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } else if (context.format.list != null) { + this.quill.format('list', false, _quill2.default.sources.USER); + } + } + }, + 'indent code-block': makeCodeBlockHandler(true), + 'outdent code-block': makeCodeBlockHandler(false), + 'remove tab': { + key: Keyboard.keys.TAB, + shiftKey: true, + collapsed: true, + prefix: /\t$/, + handler: function handler(range) { + this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); + } + }, + 'tab': { + key: Keyboard.keys.TAB, + handler: function handler(range) { + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\t'); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + } + }, + 'list empty enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['list'], + empty: true, + handler: function handler(range, context) { + this.quill.format('list', false, _quill2.default.sources.USER); + if (context.format.indent) { + this.quill.format('indent', false, _quill2.default.sources.USER); + } + } + }, + 'checklist enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: { list: 'checked' }, + handler: function handler(range) { + var _quill$getLine3 = this.quill.getLine(range.index), + _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), + line = _quill$getLine4[0], + offset = _quill$getLine4[1]; + + var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' }); + var delta = new _quillDelta2.default().retain(range.index).insert('\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'header enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['header'], + suffix: /^$/, + handler: function handler(range, context) { + var _quill$getLine5 = this.quill.getLine(range.index), + _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), + line = _quill$getLine6[0], + offset = _quill$getLine6[1]; + + var delta = new _quillDelta2.default().retain(range.index).insert('\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'list autofill': { + key: ' ', + collapsed: true, + format: { list: false }, + prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/, + handler: function handler(range, context) { + var length = context.prefix.length; + + var _quill$getLine7 = this.quill.getLine(range.index), + _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), + line = _quill$getLine8[0], + offset = _quill$getLine8[1]; + + if (offset > length) return true; + var value = void 0; + switch (context.prefix.trim()) { + case '[]':case '[ ]': + value = 'unchecked'; + break; + case '[x]': + value = 'checked'; + break; + case '-':case '*': + value = 'bullet'; + break; + default: + value = 'ordered'; + } + this.quill.insertText(range.index, ' ', _quill2.default.sources.USER); + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); + } + }, + 'code exit': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['code-block'], + prefix: /\n\n$/, + suffix: /^\s+$/, + handler: function handler(range) { + var _quill$getLine9 = this.quill.getLine(range.index), + _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), + line = _quill$getLine10[0], + offset = _quill$getLine10[1]; + + var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1); + this.quill.updateContents(delta, _quill2.default.sources.USER); + } + }, + 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false), + 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true), + 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false), + 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true) + } +}; + +function makeEmbedArrowHandler(key, shiftKey) { + var _ref3; + + var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix'; + return _ref3 = { + key: key, + shiftKey: shiftKey, + altKey: null + }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) { + var index = range.index; + if (key === Keyboard.keys.RIGHT) { + index += range.length + 1; + } + + var _quill$getLeaf3 = this.quill.getLeaf(index), + _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), + leaf = _quill$getLeaf4[0]; + + if (!(leaf instanceof _parchment2.default.Embed)) return true; + if (key === Keyboard.keys.LEFT) { + if (shiftKey) { + this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index - 1, _quill2.default.sources.USER); + } + } else { + if (shiftKey) { + this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER); + } + } + return false; + }), _ref3; +} + +function handleBackspace(range, context) { + if (range.index === 0 || this.quill.getLength() <= 1) return; + + var _quill$getLine11 = this.quill.getLine(range.index), + _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), + line = _quill$getLine12[0]; + + var formats = {}; + if (context.offset === 0) { + var _quill$getLine13 = this.quill.getLine(range.index - 1), + _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), + prev = _quill$getLine14[0]; + + if (prev != null && prev.length() > 1) { + var curFormats = line.formats(); + var prevFormats = this.quill.getFormat(range.index - 1, 1); + formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; + } + } + // Check for astral symbols + var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1; + this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER); + } + this.quill.focus(); +} + +function handleDelete(range, context) { + // Check for astral symbols + var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1; + if (range.index >= this.quill.getLength() - length) return; + var formats = {}, + nextLength = 0; + + var _quill$getLine15 = this.quill.getLine(range.index), + _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), + line = _quill$getLine16[0]; + + if (context.offset >= line.length() - 1) { + var _quill$getLine17 = this.quill.getLine(range.index + 1), + _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), + next = _quill$getLine18[0]; + + if (next) { + var curFormats = line.formats(); + var nextFormats = this.quill.getFormat(range.index, 1); + formats = _op2.default.attributes.diff(curFormats, nextFormats) || {}; + nextLength = next.length(); + } + } + this.quill.deleteText(range.index, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER); + } +} + +function handleDeleteRange(range) { + var lines = this.quill.getLines(range); + var formats = {}; + if (lines.length > 1) { + var firstFormats = lines[0].formats(); + var lastFormats = lines[lines.length - 1].formats(); + formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {}; + } + this.quill.deleteText(range, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER); + } + this.quill.setSelection(range.index, _quill2.default.sources.SILENT); + this.quill.focus(); +} + +function handleEnter(range, context) { + var _this3 = this; + + if (range.length > 0) { + this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change + } + var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { + if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { + lineFormats[format] = context.format[format]; + } + return lineFormats; + }, {}); + this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); + // Earlier scroll.deleteAt might have messed up our selection, + // so insertText's built in selection preservation is not reliable + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.focus(); + Object.keys(context.format).forEach(function (name) { + if (lineFormats[name] != null) return; + if (Array.isArray(context.format[name])) return; + if (name === 'link') return; + _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); + }); +} + +function makeCodeBlockHandler(indent) { + return { + key: Keyboard.keys.TAB, + shiftKey: !indent, + format: { 'code-block': true }, + handler: function handler(range) { + var CodeBlock = _parchment2.default.query('code-block'); + var index = range.index, + length = range.length; + + var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + block = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (block == null) return; + var scrollIndex = this.quill.getIndex(block); + var start = block.newlineIndex(offset, true) + 1; + var end = block.newlineIndex(scrollIndex + offset + length); + var lines = block.domNode.textContent.slice(start, end).split('\n'); + offset = 0; + lines.forEach(function (line, i) { + if (indent) { + block.insertAt(start + offset, CodeBlock.TAB); + offset += CodeBlock.TAB.length; + if (i === 0) { + index += CodeBlock.TAB.length; + } else { + length += CodeBlock.TAB.length; + } + } else if (line.startsWith(CodeBlock.TAB)) { + block.deleteAt(start + offset, CodeBlock.TAB.length); + offset -= CodeBlock.TAB.length; + if (i === 0) { + index -= CodeBlock.TAB.length; + } else { + length -= CodeBlock.TAB.length; + } + } + offset += line.length + 1; + }); + this.quill.update(_quill2.default.sources.USER); + this.quill.setSelection(index, length, _quill2.default.sources.SILENT); + } + }; +} + +function makeFormatHandler(format) { + return { + key: format[0].toUpperCase(), + shortKey: true, + handler: function handler(range, context) { + this.quill.format(format, !context.format[format], _quill2.default.sources.USER); + } + }; +} + +function normalize(binding) { + if (typeof binding === 'string' || typeof binding === 'number') { + return normalize({ key: binding }); + } + if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { + binding = (0, _clone2.default)(binding, false); + } + if (typeof binding.key === 'string') { + if (Keyboard.keys[binding.key.toUpperCase()] != null) { + binding.key = Keyboard.keys[binding.key.toUpperCase()]; + } else if (binding.key.length === 1) { + binding.key = binding.key.toUpperCase().charCodeAt(0); + } else { + return null; + } + } + if (binding.shortKey) { + binding[SHORTKEY] = binding.shortKey; + delete binding.shortKey; + } + return binding; +} + +exports.default = Keyboard; +exports.SHORTKEY = SHORTKEY; + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Cursor = function (_Parchment$Embed) { + _inherits(Cursor, _Parchment$Embed); + + _createClass(Cursor, null, [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + function Cursor(domNode, selection) { + _classCallCheck(this, Cursor); + + var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); + + _this.selection = selection; + _this.textNode = document.createTextNode(Cursor.CONTENTS); + _this.domNode.appendChild(_this.textNode); + _this._length = 0; + return _this; + } + + _createClass(Cursor, [{ + key: 'detach', + value: function detach() { + // super.detach() will also clear domNode.__blot + if (this.parent != null) this.parent.removeChild(this); + } + }, { + key: 'format', + value: function format(name, value) { + if (this._length !== 0) { + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); + } + var target = this, + index = 0; + while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { + index += target.offset(target.parent); + target = target.parent; + } + if (target != null) { + this._length = Cursor.CONTENTS.length; + target.optimize(); + target.formatAt(index, Cursor.CONTENTS.length, name, value); + this._length = 0; + } + } + }, { + key: 'index', + value: function index(node, offset) { + if (node === this.textNode) return 0; + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'length', + value: function length() { + return this._length; + } + }, { + key: 'position', + value: function position() { + return [this.textNode, this.textNode.data.length]; + } + }, { + key: 'remove', + value: function remove() { + _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); + this.parent = null; + } + }, { + key: 'restore', + value: function restore() { + if (this.selection.composing || this.parent == null) return; + var textNode = this.textNode; + var range = this.selection.getNativeRange(); + var restoreText = void 0, + start = void 0, + end = void 0; + if (range != null && range.start.node === textNode && range.end.node === textNode) { + var _ref = [textNode, range.start.offset, range.end.offset]; + restoreText = _ref[0]; + start = _ref[1]; + end = _ref[2]; + } + // Link format will insert text outside of anchor tag + while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { + this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); + } + if (this.textNode.data !== Cursor.CONTENTS) { + var text = this.textNode.data.split(Cursor.CONTENTS).join(''); + if (this.next instanceof _text2.default) { + restoreText = this.next.domNode; + this.next.insertAt(0, text); + this.textNode.data = Cursor.CONTENTS; + } else { + this.textNode.data = text; + this.parent.insertBefore(_parchment2.default.create(this.textNode), this); + this.textNode = document.createTextNode(Cursor.CONTENTS); + this.domNode.appendChild(this.textNode); + } + } + this.remove(); + if (start != null) { + var _map = [start, end].map(function (offset) { + return Math.max(0, Math.min(restoreText.data.length, offset - 1)); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + + return { + startNode: restoreText, + startOffset: start, + endNode: restoreText, + endOffset: end + }; + } + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this2.textNode; + })) { + var range = this.restore(); + if (range) context.range = range; + } + } + }, { + key: 'value', + value: function value() { + return ''; + } + }]); + + return Cursor; +}(_parchment2.default.Embed); + +Cursor.blotName = 'cursor'; +Cursor.className = 'ql-cursor'; +Cursor.tagName = 'span'; +Cursor.CONTENTS = '\uFEFF'; // Zero width no break space + + +exports.default = Cursor; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Container = function (_Parchment$Container) { + _inherits(Container, _Parchment$Container); + + function Container() { + _classCallCheck(this, Container); + + return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); + } + + return Container; +}(_parchment2.default.Container); + +Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; + +exports.default = Container; + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ColorAttributor = function (_Parchment$Attributor) { + _inherits(ColorAttributor, _Parchment$Attributor); + + function ColorAttributor() { + _classCallCheck(this, ColorAttributor); + + return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); + } + + _createClass(ColorAttributor, [{ + key: 'value', + value: function value(domNode) { + var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); + if (!value.startsWith('rgb(')) return value; + value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); + return '#' + value.split(',').map(function (component) { + return ('00' + parseInt(component).toString(16)).slice(-2); + }).join(''); + } + }]); + + return ColorAttributor; +}(_parchment2.default.Attributor.Style); + +var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { + scope: _parchment2.default.Scope.INLINE +}); +var ColorStyle = new ColorAttributor('color', 'color', { + scope: _parchment2.default.Scope.INLINE +}); + +exports.ColorAttributor = ColorAttributor; +exports.ColorClass = ColorClass; +exports.ColorStyle = ColorStyle; + +/***/ }), +/* 27 */, +/* 28 */, +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _container = __webpack_require__(25); + +var _container2 = _interopRequireDefault(_container); + +var _cursor = __webpack_require__(24); + +var _cursor2 = _interopRequireDefault(_cursor); + +var _embed = __webpack_require__(35); + +var _embed2 = _interopRequireDefault(_embed); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _scroll = __webpack_require__(22); + +var _scroll2 = _interopRequireDefault(_scroll); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +var _clipboard = __webpack_require__(55); + +var _clipboard2 = _interopRequireDefault(_clipboard); + +var _history = __webpack_require__(42); + +var _history2 = _interopRequireDefault(_history); + +var _keyboard = __webpack_require__(23); + +var _keyboard2 = _interopRequireDefault(_keyboard); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_quill2.default.register({ + 'blots/block': _block2.default, + 'blots/block/embed': _block.BlockEmbed, + 'blots/break': _break2.default, + 'blots/container': _container2.default, + 'blots/cursor': _cursor2.default, + 'blots/embed': _embed2.default, + 'blots/inline': _inline2.default, + 'blots/scroll': _scroll2.default, + 'blots/text': _text2.default, + + 'modules/clipboard': _clipboard2.default, + 'modules/history': _history2.default, + 'modules/keyboard': _keyboard2.default +}); + +_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); + +exports.default = _quill2.default; + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var ShadowBlot = /** @class */ (function () { + function ShadowBlot(domNode) { + this.domNode = domNode; + // @ts-ignore + this.domNode[Registry.DATA_KEY] = { blot: this }; + } + Object.defineProperty(ShadowBlot.prototype, "statics", { + // Hack for accessing inherited static methods + get: function () { + return this.constructor; + }, + enumerable: true, + configurable: true + }); + ShadowBlot.create = function (value) { + if (this.tagName == null) { + throw new Registry.ParchmentError('Blot definition missing tagName'); + } + var node; + if (Array.isArray(this.tagName)) { + if (typeof value === 'string') { + value = value.toUpperCase(); + if (parseInt(value).toString() === value) { + value = parseInt(value); + } + } + if (typeof value === 'number') { + node = document.createElement(this.tagName[value - 1]); + } + else if (this.tagName.indexOf(value) > -1) { + node = document.createElement(value); + } + else { + node = document.createElement(this.tagName[0]); + } + } + else { + node = document.createElement(this.tagName); + } + if (this.className) { + node.classList.add(this.className); + } + return node; + }; + ShadowBlot.prototype.attach = function () { + if (this.parent != null) { + this.scroll = this.parent.scroll; + } + }; + ShadowBlot.prototype.clone = function () { + var domNode = this.domNode.cloneNode(false); + return Registry.create(domNode); + }; + ShadowBlot.prototype.detach = function () { + if (this.parent != null) + this.parent.removeChild(this); + // @ts-ignore + delete this.domNode[Registry.DATA_KEY]; + }; + ShadowBlot.prototype.deleteAt = function (index, length) { + var blot = this.isolate(index, length); + blot.remove(); + }; + ShadowBlot.prototype.formatAt = function (index, length, name, value) { + var blot = this.isolate(index, length); + if (Registry.query(name, Registry.Scope.BLOT) != null && value) { + blot.wrap(name, value); + } + else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { + var parent = Registry.create(this.statics.scope); + blot.wrap(parent); + parent.format(name, value); + } + }; + ShadowBlot.prototype.insertAt = function (index, value, def) { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + var ref = this.split(index); + this.parent.insertBefore(blot, ref); + }; + ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { + if (refBlot === void 0) { refBlot = null; } + if (this.parent != null) { + this.parent.children.remove(this); + } + var refDomNode = null; + parentBlot.children.insertBefore(this, refBlot); + if (refBlot != null) { + refDomNode = refBlot.domNode; + } + if (this.domNode.parentNode != parentBlot.domNode || + this.domNode.nextSibling != refDomNode) { + parentBlot.domNode.insertBefore(this.domNode, refDomNode); + } + this.parent = parentBlot; + this.attach(); + }; + ShadowBlot.prototype.isolate = function (index, length) { + var target = this.split(index); + target.split(length); + return target; + }; + ShadowBlot.prototype.length = function () { + return 1; + }; + ShadowBlot.prototype.offset = function (root) { + if (root === void 0) { root = this.parent; } + if (this.parent == null || this == root) + return 0; + return this.parent.children.offset(this) + this.parent.offset(root); + }; + ShadowBlot.prototype.optimize = function (context) { + // TODO clean up once we use WeakMap + // @ts-ignore + if (this.domNode[Registry.DATA_KEY] != null) { + // @ts-ignore + delete this.domNode[Registry.DATA_KEY].mutations; + } + }; + ShadowBlot.prototype.remove = function () { + if (this.domNode.parentNode != null) { + this.domNode.parentNode.removeChild(this.domNode); + } + this.detach(); + }; + ShadowBlot.prototype.replace = function (target) { + if (target.parent == null) + return; + target.parent.insertBefore(this, target.next); + target.remove(); + }; + ShadowBlot.prototype.replaceWith = function (name, value) { + var replacement = typeof name === 'string' ? Registry.create(name, value) : name; + replacement.replace(this); + return replacement; + }; + ShadowBlot.prototype.split = function (index, force) { + return index === 0 ? this : this.next; + }; + ShadowBlot.prototype.update = function (mutations, context) { + // Nothing to do by default + }; + ShadowBlot.prototype.wrap = function (name, value) { + var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; + if (this.parent != null) { + this.parent.insertBefore(wrapper, this.next); + } + wrapper.appendChild(this); + return wrapper; + }; + ShadowBlot.blotName = 'abstract'; + return ShadowBlot; +}()); +exports.default = ShadowBlot; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(32); +var style_1 = __webpack_require__(33); +var Registry = __webpack_require__(1); +var AttributorStore = /** @class */ (function () { + function AttributorStore(domNode) { + this.attributes = {}; + this.domNode = domNode; + this.build(); + } + AttributorStore.prototype.attribute = function (attribute, value) { + // verb + if (value) { + if (attribute.add(this.domNode, value)) { + if (attribute.value(this.domNode) != null) { + this.attributes[attribute.attrName] = attribute; + } + else { + delete this.attributes[attribute.attrName]; + } + } + } + else { + attribute.remove(this.domNode); + delete this.attributes[attribute.attrName]; + } + }; + AttributorStore.prototype.build = function () { + var _this = this; + this.attributes = {}; + var attributes = attributor_1.default.keys(this.domNode); + var classes = class_1.default.keys(this.domNode); + var styles = style_1.default.keys(this.domNode); + attributes + .concat(classes) + .concat(styles) + .forEach(function (name) { + var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); + if (attr instanceof attributor_1.default) { + _this.attributes[attr.attrName] = attr; + } + }); + }; + AttributorStore.prototype.copy = function (target) { + var _this = this; + Object.keys(this.attributes).forEach(function (key) { + var value = _this.attributes[key].value(_this.domNode); + target.format(key, value); + }); + }; + AttributorStore.prototype.move = function (target) { + var _this = this; + this.copy(target); + Object.keys(this.attributes).forEach(function (key) { + _this.attributes[key].remove(_this.domNode); + }); + this.attributes = {}; + }; + AttributorStore.prototype.values = function () { + var _this = this; + return Object.keys(this.attributes).reduce(function (attributes, name) { + attributes[name] = _this.attributes[name].value(_this.domNode); + return attributes; + }, {}); + }; + return AttributorStore; +}()); +exports.default = AttributorStore; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function match(node, prefix) { + var className = node.getAttribute('class') || ''; + return className.split(/\s+/).filter(function (name) { + return name.indexOf(prefix + "-") === 0; + }); +} +var ClassAttributor = /** @class */ (function (_super) { + __extends(ClassAttributor, _super); + function ClassAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + ClassAttributor.keys = function (node) { + return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { + return name + .split('-') + .slice(0, -1) + .join('-'); + }); + }; + ClassAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + this.remove(node); + node.classList.add(this.keyName + "-" + value); + return true; + }; + ClassAttributor.prototype.remove = function (node) { + var matches = match(node, this.keyName); + matches.forEach(function (name) { + node.classList.remove(name); + }); + if (node.classList.length === 0) { + node.removeAttribute('class'); + } + }; + ClassAttributor.prototype.value = function (node) { + var result = match(node, this.keyName)[0] || ''; + var value = result.slice(this.keyName.length + 1); // +1 for hyphen + return this.canAdd(node, value) ? value : ''; + }; + return ClassAttributor; +}(attributor_1.default)); +exports.default = ClassAttributor; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function camelize(name) { + var parts = name.split('-'); + var rest = parts + .slice(1) + .map(function (part) { + return part[0].toUpperCase() + part.slice(1); + }) + .join(''); + return parts[0] + rest; +} +var StyleAttributor = /** @class */ (function (_super) { + __extends(StyleAttributor, _super); + function StyleAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + StyleAttributor.keys = function (node) { + return (node.getAttribute('style') || '').split(';').map(function (value) { + var arr = value.split(':'); + return arr[0].trim(); + }); + }; + StyleAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + // @ts-ignore + node.style[camelize(this.keyName)] = value; + return true; + }; + StyleAttributor.prototype.remove = function (node) { + // @ts-ignore + node.style[camelize(this.keyName)] = ''; + if (!node.getAttribute('style')) { + node.removeAttribute('style'); + } + }; + StyleAttributor.prototype.value = function (node) { + // @ts-ignore + var value = node.style[camelize(this.keyName)]; + return this.canAdd(node, value) ? value : ''; + }; + return StyleAttributor; +}(attributor_1.default)); +exports.default = StyleAttributor; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Theme = function () { + function Theme(quill, options) { + _classCallCheck(this, Theme); + + this.quill = quill; + this.options = options; + this.modules = {}; + } + + _createClass(Theme, [{ + key: 'init', + value: function init() { + var _this = this; + + Object.keys(this.options.modules).forEach(function (name) { + if (_this.modules[name] == null) { + _this.addModule(name); + } + }); + } + }, { + key: 'addModule', + value: function addModule(name) { + var moduleClass = this.quill.constructor.import('modules/' + name); + this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); + return this.modules[name]; + } + }]); + + return Theme; +}(); + +Theme.DEFAULTS = { + modules: {} +}; +Theme.themes = { + 'default': Theme +}; + +exports.default = Theme; + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var GUARD_TEXT = '\uFEFF'; + +var Embed = function (_Parchment$Embed) { + _inherits(Embed, _Parchment$Embed); + + function Embed(node) { + _classCallCheck(this, Embed); + + var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node)); + + _this.contentNode = document.createElement('span'); + _this.contentNode.setAttribute('contenteditable', false); + [].slice.call(_this.domNode.childNodes).forEach(function (childNode) { + _this.contentNode.appendChild(childNode); + }); + _this.leftGuard = document.createTextNode(GUARD_TEXT); + _this.rightGuard = document.createTextNode(GUARD_TEXT); + _this.domNode.appendChild(_this.leftGuard); + _this.domNode.appendChild(_this.contentNode); + _this.domNode.appendChild(_this.rightGuard); + return _this; + } + + _createClass(Embed, [{ + key: 'index', + value: function index(node, offset) { + if (node === this.leftGuard) return 0; + if (node === this.rightGuard) return 1; + return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'restore', + value: function restore(node) { + var range = void 0, + textNode = void 0; + var text = node.data.split(GUARD_TEXT).join(''); + if (node === this.leftGuard) { + if (this.prev instanceof _text2.default) { + var prevLength = this.prev.length(); + this.prev.insertAt(prevLength, text); + range = { + startNode: this.prev.domNode, + startOffset: prevLength + text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } else if (node === this.rightGuard) { + if (this.next instanceof _text2.default) { + this.next.insertAt(0, text); + range = { + startNode: this.next.domNode, + startOffset: text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this.next); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } + node.data = GUARD_TEXT; + return range; + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + mutations.forEach(function (mutation) { + if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) { + var range = _this2.restore(mutation.target); + if (range) context.range = range; + } + }); + } + }]); + + return Embed; +}(_parchment2.default.Embed); + +exports.default = Embed; + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['right', 'center', 'justify'] +}; + +var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); +var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); +var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); + +exports.AlignAttribute = AlignAttribute; +exports.AlignClass = AlignClass; +exports.AlignStyle = AlignStyle; + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BackgroundStyle = exports.BackgroundClass = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _color = __webpack_require__(26); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { + scope: _parchment2.default.Scope.INLINE +}); +var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { + scope: _parchment2.default.Scope.INLINE +}); + +exports.BackgroundClass = BackgroundClass; +exports.BackgroundStyle = BackgroundStyle; + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['rtl'] +}; + +var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); +var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); +var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); + +exports.DirectionAttribute = DirectionAttribute; +exports.DirectionClass = DirectionClass; +exports.DirectionStyle = DirectionStyle; + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FontClass = exports.FontStyle = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var config = { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['serif', 'monospace'] +}; + +var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); + +var FontStyleAttributor = function (_Parchment$Attributor) { + _inherits(FontStyleAttributor, _Parchment$Attributor); + + function FontStyleAttributor() { + _classCallCheck(this, FontStyleAttributor); + + return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); + } + + _createClass(FontStyleAttributor, [{ + key: 'value', + value: function value(node) { + return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); + } + }]); + + return FontStyleAttributor; +}(_parchment2.default.Attributor.Style); + +var FontStyle = new FontStyleAttributor('font', 'font-family', config); + +exports.FontStyle = FontStyle; +exports.FontClass = FontClass; + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SizeStyle = exports.SizeClass = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['small', 'large', 'huge'] +}); +var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['10px', '18px', '32px'] +}); + +exports.SizeClass = SizeClass; +exports.SizeStyle = SizeStyle; + +/***/ }), +/* 41 */, +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getLastChangeIndex = exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var History = function (_Module) { + _inherits(History, _Module); + + function History(quill, options) { + _classCallCheck(this, History); + + var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); + + _this.lastRecorded = 0; + _this.ignoreChange = false; + _this.clear(); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { + if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; + if (!_this.options.userOnly || source === _quill2.default.sources.USER) { + _this.record(delta, oldDelta); + } else { + _this.transform(delta); + } + }); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); + if (/Win/i.test(navigator.platform)) { + _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); + } + return _this; + } + + _createClass(History, [{ + key: 'change', + value: function change(source, dest) { + if (this.stack[source].length === 0) return; + var delta = this.stack[source].pop(); + this.stack[dest].push(delta); + this.lastRecorded = 0; + this.ignoreChange = true; + this.quill.updateContents(delta[source], _quill2.default.sources.USER); + this.ignoreChange = false; + var index = getLastChangeIndex(delta[source]); + this.quill.setSelection(index); + } + }, { + key: 'clear', + value: function clear() { + this.stack = { undo: [], redo: [] }; + } + }, { + key: 'cutoff', + value: function cutoff() { + this.lastRecorded = 0; + } + }, { + key: 'record', + value: function record(changeDelta, oldDelta) { + if (changeDelta.ops.length === 0) return; + this.stack.redo = []; + var undoDelta = this.quill.getContents().diff(oldDelta); + var timestamp = Date.now(); + if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { + var delta = this.stack.undo.pop(); + undoDelta = undoDelta.compose(delta.undo); + changeDelta = delta.redo.compose(changeDelta); + } else { + this.lastRecorded = timestamp; + } + this.stack.undo.push({ + redo: changeDelta, + undo: undoDelta + }); + if (this.stack.undo.length > this.options.maxStack) { + this.stack.undo.shift(); + } + } + }, { + key: 'redo', + value: function redo() { + this.change('redo', 'undo'); + } + }, { + key: 'transform', + value: function transform(delta) { + this.stack.undo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + this.stack.redo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + } + }, { + key: 'undo', + value: function undo() { + this.change('undo', 'redo'); + } + }]); + + return History; +}(_module2.default); + +History.DEFAULTS = { + delay: 1000, + maxStack: 100, + userOnly: false +}; + +function endsWithNewlineChange(delta) { + var lastOp = delta.ops[delta.ops.length - 1]; + if (lastOp == null) return false; + if (lastOp.insert != null) { + return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); + } + if (lastOp.attributes != null) { + return Object.keys(lastOp.attributes).some(function (attr) { + return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; + }); + } + return false; +} + +function getLastChangeIndex(delta) { + var deleteLength = delta.reduce(function (length, op) { + length += op.delete || 0; + return length; + }, 0); + var changeIndex = delta.length() - deleteLength; + if (endsWithNewlineChange(delta)) { + changeIndex -= 1; + } + return changeIndex; +} + +exports.default = History; +exports.getLastChangeIndex = getLastChangeIndex; + +/***/ }), +/* 43 */, +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var LinkedList = /** @class */ (function () { + function LinkedList() { + this.head = this.tail = null; + this.length = 0; + } + LinkedList.prototype.append = function () { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i] = arguments[_i]; + } + this.insertBefore(nodes[0], null); + if (nodes.length > 1) { + this.append.apply(this, nodes.slice(1)); + } + }; + LinkedList.prototype.contains = function (node) { + var cur, next = this.iterator(); + while ((cur = next())) { + if (cur === node) + return true; + } + return false; + }; + LinkedList.prototype.insertBefore = function (node, refNode) { + if (!node) + return; + node.next = refNode; + if (refNode != null) { + node.prev = refNode.prev; + if (refNode.prev != null) { + refNode.prev.next = node; + } + refNode.prev = node; + if (refNode === this.head) { + this.head = node; + } + } + else if (this.tail != null) { + this.tail.next = node; + node.prev = this.tail; + this.tail = node; + } + else { + node.prev = null; + this.head = this.tail = node; + } + this.length += 1; + }; + LinkedList.prototype.offset = function (target) { + var index = 0, cur = this.head; + while (cur != null) { + if (cur === target) + return index; + index += cur.length(); + cur = cur.next; + } + return -1; + }; + LinkedList.prototype.remove = function (node) { + if (!this.contains(node)) + return; + if (node.prev != null) + node.prev.next = node.next; + if (node.next != null) + node.next.prev = node.prev; + if (node === this.head) + this.head = node.next; + if (node === this.tail) + this.tail = node.prev; + this.length -= 1; + }; + LinkedList.prototype.iterator = function (curNode) { + if (curNode === void 0) { curNode = this.head; } + // TODO use yield when we can + return function () { + var ret = curNode; + if (curNode != null) + curNode = curNode.next; + return ret; + }; + }; + LinkedList.prototype.find = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var cur, next = this.iterator(); + while ((cur = next())) { + var length = cur.length(); + if (index < length || + (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) { + return [cur, index]; + } + index -= length; + } + return [null, 0]; + }; + LinkedList.prototype.forEach = function (callback) { + var cur, next = this.iterator(); + while ((cur = next())) { + callback(cur); + } + }; + LinkedList.prototype.forEachAt = function (index, length, callback) { + if (length <= 0) + return; + var _a = this.find(index), startNode = _a[0], offset = _a[1]; + var cur, curIndex = index - offset, next = this.iterator(startNode); + while ((cur = next()) && curIndex < index + length) { + var curLength = cur.length(); + if (index > curIndex) { + callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); + } + else { + callback(cur, 0, Math.min(curLength, index + length - curIndex)); + } + curIndex += curLength; + } + }; + LinkedList.prototype.map = function (callback) { + return this.reduce(function (memo, cur) { + memo.push(callback(cur)); + return memo; + }, []); + }; + LinkedList.prototype.reduce = function (callback, memo) { + var cur, next = this.iterator(); + while ((cur = next())) { + memo = callback(memo, cur); + } + return memo; + }; + return LinkedList; +}()); +exports.default = LinkedList; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var OBSERVER_CONFIG = { + attributes: true, + characterData: true, + characterDataOldValue: true, + childList: true, + subtree: true, +}; +var MAX_OPTIMIZE_ITERATIONS = 100; +var ScrollBlot = /** @class */ (function (_super) { + __extends(ScrollBlot, _super); + function ScrollBlot(node) { + var _this = _super.call(this, node) || this; + _this.scroll = _this; + _this.observer = new MutationObserver(function (mutations) { + _this.update(mutations); + }); + _this.observer.observe(_this.domNode, OBSERVER_CONFIG); + _this.attach(); + return _this; + } + ScrollBlot.prototype.detach = function () { + _super.prototype.detach.call(this); + this.observer.disconnect(); + }; + ScrollBlot.prototype.deleteAt = function (index, length) { + this.update(); + if (index === 0 && length === this.length()) { + this.children.forEach(function (child) { + child.remove(); + }); + } + else { + _super.prototype.deleteAt.call(this, index, length); + } + }; + ScrollBlot.prototype.formatAt = function (index, length, name, value) { + this.update(); + _super.prototype.formatAt.call(this, index, length, name, value); + }; + ScrollBlot.prototype.insertAt = function (index, value, def) { + this.update(); + _super.prototype.insertAt.call(this, index, value, def); + }; + ScrollBlot.prototype.optimize = function (mutations, context) { + var _this = this; + if (mutations === void 0) { mutations = []; } + if (context === void 0) { context = {}; } + _super.prototype.optimize.call(this, context); + // We must modify mutations directly, cannot make copy and then modify + var records = [].slice.call(this.observer.takeRecords()); + // Array.push currently seems to be implemented by a non-tail recursive function + // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords()); + while (records.length > 0) + mutations.push(records.pop()); + // TODO use WeakMap + var mark = function (blot, markParent) { + if (markParent === void 0) { markParent = true; } + if (blot == null || blot === _this) + return; + if (blot.domNode.parentNode == null) + return; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = []; + } + if (markParent) + mark(blot.parent); + }; + var optimize = function (blot) { + // Post-order traversal + if ( + // @ts-ignore + blot.domNode[Registry.DATA_KEY] == null || + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations == null) { + return; + } + if (blot instanceof container_1.default) { + blot.children.forEach(optimize); + } + blot.optimize(context); + }; + var remaining = mutations; + for (var i = 0; remaining.length > 0; i += 1) { + if (i >= MAX_OPTIMIZE_ITERATIONS) { + throw new Error('[Parchment] Maximum optimize iterations reached'); + } + remaining.forEach(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return; + if (blot.domNode === mutation.target) { + if (mutation.type === 'childList') { + mark(Registry.find(mutation.previousSibling, false)); + [].forEach.call(mutation.addedNodes, function (node) { + var child = Registry.find(node, false); + mark(child, false); + if (child instanceof container_1.default) { + child.children.forEach(function (grandChild) { + mark(grandChild, false); + }); + } + }); + } + else if (mutation.type === 'attributes') { + mark(blot.prev); + } + } + mark(blot); + }); + this.children.forEach(optimize); + remaining = [].slice.call(this.observer.takeRecords()); + records = remaining.slice(); + while (records.length > 0) + mutations.push(records.pop()); + } + }; + ScrollBlot.prototype.update = function (mutations, context) { + var _this = this; + if (context === void 0) { context = {}; } + mutations = mutations || this.observer.takeRecords(); + // TODO use WeakMap + mutations + .map(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return null; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = [mutation]; + return blot; + } + else { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations.push(mutation); + return null; + } + }) + .forEach(function (blot) { + if (blot == null || + blot === _this || + //@ts-ignore + blot.domNode[Registry.DATA_KEY] == null) + return; + // @ts-ignore + blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context); + }); + // @ts-ignore + if (this.domNode[Registry.DATA_KEY].mutations != null) { + // @ts-ignore + _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context); + } + this.optimize(mutations, context); + }; + ScrollBlot.blotName = 'scroll'; + ScrollBlot.defaultChild = 'block'; + ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; + ScrollBlot.tagName = 'DIV'; + return ScrollBlot; +}(container_1.default)); +exports.default = ScrollBlot; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +// Shallow object comparison +function isEqual(obj1, obj2) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) + return false; + // @ts-ignore + for (var prop in obj1) { + // @ts-ignore + if (obj1[prop] !== obj2[prop]) + return false; + } + return true; +} +var InlineBlot = /** @class */ (function (_super) { + __extends(InlineBlot, _super); + function InlineBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + InlineBlot.formats = function (domNode) { + if (domNode.tagName === InlineBlot.tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + InlineBlot.prototype.format = function (name, value) { + var _this = this; + if (name === this.statics.blotName && !value) { + this.children.forEach(function (child) { + if (!(child instanceof format_1.default)) { + child = child.wrap(InlineBlot.blotName, true); + } + _this.attributes.copy(child); + }); + this.unwrap(); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + InlineBlot.prototype.formatAt = function (index, length, name, value) { + if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { + var blot = this.isolate(index, length); + blot.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + InlineBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + var formats = this.formats(); + if (Object.keys(formats).length === 0) { + return this.unwrap(); // unformatted span + } + var next = this.next; + if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { + next.moveChildren(this); + next.remove(); + } + }; + InlineBlot.blotName = 'inline'; + InlineBlot.scope = Registry.Scope.INLINE_BLOT; + InlineBlot.tagName = 'SPAN'; + return InlineBlot; +}(format_1.default)); +exports.default = InlineBlot; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +var BlockBlot = /** @class */ (function (_super) { + __extends(BlockBlot, _super); + function BlockBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlockBlot.formats = function (domNode) { + var tagName = Registry.query(BlockBlot.blotName).tagName; + if (domNode.tagName === tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + BlockBlot.prototype.format = function (name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) == null) { + return; + } + else if (name === this.statics.blotName && !value) { + this.replaceWith(BlockBlot.blotName); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + BlockBlot.prototype.formatAt = function (index, length, name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) != null) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + BlockBlot.prototype.insertAt = function (index, value, def) { + if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { + // Insert text or inline + _super.prototype.insertAt.call(this, index, value, def); + } + else { + var after = this.split(index); + var blot = Registry.create(value, def); + after.parent.insertBefore(blot, after); + } + }; + BlockBlot.prototype.update = function (mutations, context) { + if (navigator.userAgent.match(/Trident/)) { + this.build(); + } + else { + _super.prototype.update.call(this, mutations, context); + } + }; + BlockBlot.blotName = 'block'; + BlockBlot.scope = Registry.Scope.BLOCK_BLOT; + BlockBlot.tagName = 'P'; + return BlockBlot; +}(format_1.default)); +exports.default = BlockBlot; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var EmbedBlot = /** @class */ (function (_super) { + __extends(EmbedBlot, _super); + function EmbedBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + EmbedBlot.formats = function (domNode) { + return undefined; + }; + EmbedBlot.prototype.format = function (name, value) { + // super.formatAt wraps, which is what we want in general, + // but this allows subclasses to overwrite for formats + // that just apply to particular embeds + _super.prototype.formatAt.call(this, 0, this.length(), name, value); + }; + EmbedBlot.prototype.formatAt = function (index, length, name, value) { + if (index === 0 && length === this.length()) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + EmbedBlot.prototype.formats = function () { + return this.statics.formats(this.domNode); + }; + return EmbedBlot; +}(leaf_1.default)); +exports.default = EmbedBlot; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var Registry = __webpack_require__(1); +var TextBlot = /** @class */ (function (_super) { + __extends(TextBlot, _super); + function TextBlot(node) { + var _this = _super.call(this, node) || this; + _this.text = _this.statics.value(_this.domNode); + return _this; + } + TextBlot.create = function (value) { + return document.createTextNode(value); + }; + TextBlot.value = function (domNode) { + var text = domNode.data; + // @ts-ignore + if (text['normalize']) + text = text['normalize'](); + return text; + }; + TextBlot.prototype.deleteAt = function (index, length) { + this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); + }; + TextBlot.prototype.index = function (node, offset) { + if (this.domNode === node) { + return offset; + } + return -1; + }; + TextBlot.prototype.insertAt = function (index, value, def) { + if (def == null) { + this.text = this.text.slice(0, index) + value + this.text.slice(index); + this.domNode.data = this.text; + } + else { + _super.prototype.insertAt.call(this, index, value, def); + } + }; + TextBlot.prototype.length = function () { + return this.text.length; + }; + TextBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + this.text = this.statics.value(this.domNode); + if (this.text.length === 0) { + this.remove(); + } + else if (this.next instanceof TextBlot && this.next.prev === this) { + this.insertAt(this.length(), this.next.value()); + this.next.remove(); + } + }; + TextBlot.prototype.position = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + return [this.domNode, index]; + }; + TextBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = Registry.create(this.domNode.splitText(index)); + this.parent.insertBefore(after, this.next); + this.text = this.statics.value(this.domNode); + return after; + }; + TextBlot.prototype.update = function (mutations, context) { + var _this = this; + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this.domNode; + })) { + this.text = this.statics.value(this.domNode); + } + }; + TextBlot.prototype.value = function () { + return this.text; + }; + TextBlot.blotName = 'text'; + TextBlot.scope = Registry.Scope.INLINE_BLOT; + return TextBlot; +}(leaf_1.default)); +exports.default = TextBlot; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var elem = document.createElement('div'); +elem.classList.toggle('test-class', false); +if (elem.classList.contains('test-class')) { + var _toggle = DOMTokenList.prototype.toggle; + DOMTokenList.prototype.toggle = function (token, force) { + if (arguments.length > 1 && !this.contains(token) === !force) { + return force; + } else { + return _toggle.call(this, token); + } + }; +} + +if (!String.prototype.startsWith) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; +} + +if (!String.prototype.endsWith) { + String.prototype.endsWith = function (searchString, position) { + var subjectString = this.toString(); + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length; + } + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; +} + +if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, "find", { + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } + } + return undefined; + } + }); +} + +document.addEventListener("DOMContentLoaded", function () { + // Disable resizing in Firefox + document.execCommand("enableObjectResizing", false, false); + // Disable automatic linkifying in IE11 + document.execCommand("autoUrlDetect", false, false); +}); + +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + +/** + * This library modifies the diff-patch-match library by Neil Fraser + * by removing the patch and match functionality and certain advanced + * options in the diff function. The original license is as follows: + * + * === + * + * Diff Match and Patch + * + * Copyright 2006 Google Inc. + * http://code.google.com/p/google-diff-match-patch/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ +var DIFF_DELETE = -1; +var DIFF_INSERT = 1; +var DIFF_EQUAL = 0; + + +/** + * Find the differences between two texts. Simplifies the problem by stripping + * any common prefix or suffix off the texts before diffing. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {Int} cursor_pos Expected edit position in text1 (optional) + * @return {Array} Array of diff tuples. + */ +function diff_main(text1, text2, cursor_pos) { + // Check for equality (speedup). + if (text1 == text2) { + if (text1) { + return [[DIFF_EQUAL, text1]]; + } + return []; + } + + // Check cursor_pos within bounds + if (cursor_pos < 0 || text1.length < cursor_pos) { + cursor_pos = null; + } + + // Trim off common prefix (speedup). + var commonlength = diff_commonPrefix(text1, text2); + var commonprefix = text1.substring(0, commonlength); + text1 = text1.substring(commonlength); + text2 = text2.substring(commonlength); + + // Trim off common suffix (speedup). + 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); + + // Compute the diff on the middle block. + var diffs = diff_compute_(text1, text2); + + // Restore the prefix and suffix. + if (commonprefix) { + diffs.unshift([DIFF_EQUAL, commonprefix]); + } + if (commonsuffix) { + diffs.push([DIFF_EQUAL, commonsuffix]); + } + diff_cleanupMerge(diffs); + if (cursor_pos != null) { + diffs = fix_cursor(diffs, cursor_pos); + } + diffs = fix_emoji(diffs); + return diffs; +}; + + +/** + * Find the differences between two texts. Assumes that the texts do not + * have any common prefix or suffix. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + */ +function diff_compute_(text1, text2) { + var diffs; + + if (!text1) { + // Just add some text (speedup). + return [[DIFF_INSERT, text2]]; + } + + if (!text2) { + // Just delete some text (speedup). + return [[DIFF_DELETE, text1]]; + } + + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + var i = longtext.indexOf(shorttext); + if (i != -1) { + // Shorter text is inside the longer text (speedup). + diffs = [[DIFF_INSERT, longtext.substring(0, i)], + [DIFF_EQUAL, shorttext], + [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; + // Swap insertions for deletions if diff is reversed. + if (text1.length > text2.length) { + diffs[0][0] = diffs[2][0] = DIFF_DELETE; + } + return diffs; + } + + if (shorttext.length == 1) { + // Single character string. + // After the previous speedup, the character can't be an equality. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + } + + // Check to see if the problem can be split in two. + var hm = diff_halfMatch_(text1, text2); + if (hm) { + // A half-match was found, sort out the return data. + var text1_a = hm[0]; + var text1_b = hm[1]; + var text2_a = hm[2]; + var text2_b = hm[3]; + var mid_common = hm[4]; + // Send both pairs off for separate processing. + var diffs_a = diff_main(text1_a, text2_a); + var diffs_b = diff_main(text1_b, text2_b); + // Merge the results. + return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); + } + + return diff_bisect_(text1, text2); +}; + + +/** + * Find the 'middle snake' of a diff, split the problem in two + * and return the recursively constructed diff. + * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + * @private + */ +function diff_bisect_(text1, text2) { + // Cache the text lengths to prevent multiple calls. + var text1_length = text1.length; + var text2_length = text2.length; + var max_d = Math.ceil((text1_length + text2_length) / 2); + var v_offset = max_d; + var v_length = 2 * max_d; + var v1 = new Array(v_length); + var v2 = new Array(v_length); + // Setting all elements to -1 is faster in Chrome & Firefox than mixing + // integers and undefined. + for (var x = 0; x < v_length; x++) { + v1[x] = -1; + v2[x] = -1; + } + v1[v_offset + 1] = 0; + v2[v_offset + 1] = 0; + var delta = text1_length - text2_length; + // If the total number of characters is odd, then the front path will collide + // with the reverse path. + var front = (delta % 2 != 0); + // Offsets for start and end of k loop. + // Prevents mapping of space beyond the grid. + var k1start = 0; + var k1end = 0; + var k2start = 0; + var k2end = 0; + for (var d = 0; d < max_d; d++) { + // Walk the front path one step. + for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { + var k1_offset = v_offset + k1; + var x1; + if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { + x1 = v1[k1_offset + 1]; + } else { + x1 = v1[k1_offset - 1] + 1; + } + var y1 = x1 - k1; + while (x1 < text1_length && y1 < text2_length && + text1.charAt(x1) == text2.charAt(y1)) { + x1++; + y1++; + } + v1[k1_offset] = x1; + if (x1 > text1_length) { + // Ran off the right of the graph. + k1end += 2; + } else if (y1 > text2_length) { + // Ran off the bottom of the graph. + k1start += 2; + } else if (front) { + var k2_offset = v_offset + delta - k1; + if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { + // Mirror x2 onto top-left coordinate system. + var x2 = text1_length - v2[k2_offset]; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + + // Walk the reverse path one step. + for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { + var k2_offset = v_offset + k2; + var x2; + if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { + x2 = v2[k2_offset + 1]; + } else { + x2 = v2[k2_offset - 1] + 1; + } + var y2 = x2 - k2; + while (x2 < text1_length && y2 < text2_length && + text1.charAt(text1_length - x2 - 1) == + text2.charAt(text2_length - y2 - 1)) { + x2++; + y2++; + } + v2[k2_offset] = x2; + if (x2 > text1_length) { + // Ran off the left of the graph. + k2end += 2; + } else if (y2 > text2_length) { + // Ran off the top of the graph. + 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]; + var y1 = v_offset + x1 - k1_offset; + // Mirror x2 onto top-left coordinate system. + x2 = text1_length - x2; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + } + // Diff took too long and hit the deadline or + // number of diffs equals number of characters, no commonality at all. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; +}; + + +/** + * Given the location of the 'middle snake', split the diff in two parts + * and recurse. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} x Index of split point in text1. + * @param {number} y Index of split point in text2. + * @return {Array} Array of diff tuples. + */ +function diff_bisectSplit_(text1, text2, x, y) { + var text1a = text1.substring(0, x); + var text2a = text2.substring(0, y); + var text1b = text1.substring(x); + var text2b = text2.substring(y); + + // Compute both diffs serially. + var diffs = diff_main(text1a, text2a); + var diffsb = diff_main(text1b, text2b); + + return diffs.concat(diffsb); +}; + + +/** + * Determine the common prefix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the start of each + * string. + */ +function diff_commonPrefix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerstart = 0; + while (pointermin < pointermid) { + if (text1.substring(pointerstart, pointermid) == + text2.substring(pointerstart, pointermid)) { + pointermin = pointermid; + pointerstart = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Determine the common suffix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of each string. + */ +function diff_commonSuffix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || + text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerend = 0; + while (pointermin < pointermid) { + if (text1.substring(text1.length - pointermid, text1.length - pointerend) == + text2.substring(text2.length - pointermid, text2.length - pointerend)) { + pointermin = pointermid; + pointerend = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Do the two texts share a substring which is at least half the length of the + * longer text? + * This speedup can produce non-minimal diffs. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {Array.} Five element Array, containing the prefix of + * text1, the suffix of text1, the prefix of text2, the suffix of + * text2 and the common middle. Or null if there was no match. + */ +function diff_halfMatch_(text1, text2) { + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { + return null; // Pointless. + } + + /** + * Does a substring of shorttext exist within longtext such that the substring + * is at least half the length of longtext? + * Closure, but does not reference any external variables. + * @param {string} longtext Longer string. + * @param {string} shorttext Shorter string. + * @param {number} i Start index of quarter length substring within longtext. + * @return {Array.} Five element Array, containing the prefix of + * longtext, the suffix of longtext, the prefix of shorttext, the suffix + * of shorttext and the common middle. Or null if there was no match. + * @private + */ + function diff_halfMatchI_(longtext, shorttext, i) { + // Start with a 1/4 length substring at position i as a seed. + var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); + var j = -1; + var best_common = ''; + var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; + while ((j = shorttext.indexOf(seed, j + 1)) != -1) { + var prefixLength = diff_commonPrefix(longtext.substring(i), + shorttext.substring(j)); + var suffixLength = diff_commonSuffix(longtext.substring(0, i), + shorttext.substring(0, j)); + if (best_common.length < suffixLength + prefixLength) { + best_common = shorttext.substring(j - suffixLength, j) + + shorttext.substring(j, j + prefixLength); + best_longtext_a = longtext.substring(0, i - suffixLength); + best_longtext_b = longtext.substring(i + prefixLength); + best_shorttext_a = shorttext.substring(0, j - suffixLength); + best_shorttext_b = shorttext.substring(j + prefixLength); + } + } + if (best_common.length * 2 >= longtext.length) { + return [best_longtext_a, best_longtext_b, + best_shorttext_a, best_shorttext_b, best_common]; + } else { + return null; + } + } + + // First check if the second quarter is the seed for a half-match. + var hm1 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 4)); + // Check again based on the third quarter. + var hm2 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 2)); + var hm; + if (!hm1 && !hm2) { + return null; + } else if (!hm2) { + hm = hm1; + } else if (!hm1) { + hm = hm2; + } else { + // Both matched. Select the longest. + hm = hm1[4].length > hm2[4].length ? hm1 : hm2; + } + + // A half-match was found, sort out the return data. + var text1_a, text1_b, text2_a, text2_b; + if (text1.length > text2.length) { + text1_a = hm[0]; + text1_b = hm[1]; + text2_a = hm[2]; + text2_b = hm[3]; + } else { + 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]; +}; + + +/** + * Reorder and merge like edit sections. Merge equalities. + * Any edit section can move as long as it doesn't cross an equality. + * @param {Array} diffs Array of diff tuples. + */ +function diff_cleanupMerge(diffs) { + diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. + var pointer = 0; + var count_delete = 0; + var count_insert = 0; + var text_delete = ''; + var text_insert = ''; + var commonlength; + while (pointer < diffs.length) { + 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: + // Upon reaching an equality, check for prior redundancies. + if (count_delete + count_insert > 1) { + if (count_delete !== 0 && count_insert !== 0) { + // Factor out any common prefixies. + commonlength = diff_commonPrefix(text_insert, text_delete); + if (commonlength !== 0) { + if ((pointer - count_delete - count_insert) > 0 && + diffs[pointer - count_delete - count_insert - 1][0] == + DIFF_EQUAL) { + diffs[pointer - count_delete - count_insert - 1][1] += + text_insert.substring(0, commonlength); + } else { + diffs.splice(0, 0, [DIFF_EQUAL, + text_insert.substring(0, commonlength)]); + pointer++; + } + text_insert = text_insert.substring(commonlength); + text_delete = text_delete.substring(commonlength); + } + // Factor out any common suffixies. + commonlength = diff_commonSuffix(text_insert, text_delete); + if (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); + } + } + // Delete the offending records and add the merged ones. + if (count_delete === 0) { + diffs.splice(pointer - count_insert, + count_delete + count_insert, [DIFF_INSERT, text_insert]); + } else if (count_insert === 0) { + diffs.splice(pointer - count_delete, + count_delete + count_insert, [DIFF_DELETE, text_delete]); + } else { + diffs.splice(pointer - count_delete - count_insert, + count_delete + count_insert, [DIFF_DELETE, text_delete], + [DIFF_INSERT, text_insert]); + } + pointer = pointer - count_delete - count_insert + + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; + } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { + // Merge this equality with the previous one. + diffs[pointer - 1][1] += diffs[pointer][1]; + diffs.splice(pointer, 1); + } else { + pointer++; + } + count_insert = 0; + count_delete = 0; + text_delete = ''; + text_insert = ''; + break; + } + } + if (diffs[diffs.length - 1][1] === '') { + diffs.pop(); // Remove the dummy entry at the end. + } + + // Second pass: look for single edits surrounded on both sides by equalities + // which can be shifted sideways to eliminate an equality. + // e.g: ABAC -> ABAC + var changes = false; + pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if (diffs[pointer - 1][0] == DIFF_EQUAL && + diffs[pointer + 1][0] == DIFF_EQUAL) { + // This is a single edit surrounded by equalities. + if (diffs[pointer][1].substring(diffs[pointer][1].length - + diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { + // Shift the edit over the previous equality. + 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 = true; + } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == + diffs[pointer + 1][1]) { + // Shift the edit over the next equality. + 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 = true; + } + } + pointer++; + } + // If shifts were made, the diff needs reordering and another shift sweep. + if (changes) { + diff_cleanupMerge(diffs); + } +}; + + +var diff = diff_main; +diff.INSERT = DIFF_INSERT; +diff.DELETE = DIFF_DELETE; +diff.EQUAL = DIFF_EQUAL; + +module.exports = diff; + +/* + * Modify a diff such that the cursor position points to the start of a change: + * E.g. + * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) + * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] + * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) + * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} A tuple [cursor location in the modified diff, modified diff] + */ +function cursor_normalize_diff (diffs, cursor_pos) { + if (cursor_pos === 0) { + return [DIFF_EQUAL, diffs]; + } + for (var current_pos = 0, i = 0; i < diffs.length; i++) { + var d = diffs[i]; + if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { + var next_pos = current_pos + d[1].length; + if (cursor_pos === next_pos) { + return [i + 1, diffs]; + } else if (cursor_pos < next_pos) { + // copy to prevent side effects + diffs = diffs.slice(); + // split d into two diff changes + var split_pos = cursor_pos - current_pos; + var d_left = [d[0], d[1].slice(0, split_pos)]; + var d_right = [d[0], d[1].slice(split_pos)]; + diffs.splice(i, 1, d_left, d_right); + return [i + 1, diffs]; + } else { + current_pos = next_pos; + } + } + } + throw new Error('cursor_pos is out of bounds!') +} + +/* + * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). + * + * Case 1) + * Check if a naive shift is possible: + * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) + * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result + * Case 2) + * Check if the following shifts are possible: + * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] + * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] + * ^ ^ + * d d_next + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} Array of diff tuples + */ +function fix_cursor (diffs, cursor_pos) { + var norm = cursor_normalize_diff(diffs, cursor_pos); + var ndiffs = norm[1]; + var cursor_pointer = norm[0]; + var d = ndiffs[cursor_pointer]; + var d_next = ndiffs[cursor_pointer + 1]; + + if (d == null) { + // Text was deleted from end of original string, + // cursor is now out of bounds in new string + return diffs; + } else if (d[0] !== DIFF_EQUAL) { + // A modification happened at the cursor location. + // This is the expected outcome, so we can return the original diff. + return diffs; + } else { + if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { + // Case 1) + // It is possible to perform a naive shift + ndiffs.splice(cursor_pointer, 2, d_next, d) + return merge_tuples(ndiffs, cursor_pointer, 2) + } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { + // Case 2) + // d[1] is a prefix of d_next[1] + // We can assume that d_next[0] !== 0, since d[0] === 0 + // Shift edit locations.. + ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); + var suffix = d_next[1].slice(d[1].length); + if (suffix.length > 0) { + ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); + } + return merge_tuples(ndiffs, cursor_pointer, 3) + } else { + // Not possible to perform any modification + return diffs; + } + } +} + +/* + * Check diff did not split surrogate pairs. + * Ex. [0, '\uD83D'], [-1, '\uDC36'], [1, '\uDC2F'] -> [-1, '\uD83D\uDC36'], [1, '\uD83D\uDC2F'] + * '\uD83D\uDC36' === '🐶', '\uD83D\uDC2F' === '🐯' + * + * @param {Array} diffs Array of diff tuples + * @return {Array} Array of diff tuples + */ +function fix_emoji (diffs) { + var compact = false; + var starts_with_pair_end = function(str) { + return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF; + } + var ends_with_pair_start = function(str) { + return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF; + } + for (var i = 2; i < diffs.length; i += 1) { + if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) && + diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) && + diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) { + compact = true; + + diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1]; + diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1]; + + diffs[i-2][1] = diffs[i-2][1].slice(0, -1); + } + } + if (!compact) { + return diffs; + } + var fixed_diffs = []; + for (var i = 0; i < diffs.length; i += 1) { + if (diffs[i][1].length > 0) { + fixed_diffs.push(diffs[i]); + } + } + return fixed_diffs; +} + +/* + * Try to merge tuples with their neigbors in a given range. + * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] + * + * @param {Array} diffs Array of diff tuples. + * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). + * @param {Int} length Number of consecutive elements to check. + * @return {Array} Array of merged diff tuples. + */ +function merge_tuples (diffs, start, length) { + // Check from (start-1) to (start+length). + for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { + if (i + 1 < diffs.length) { + var left_d = diffs[i]; + var right_d = diffs[i+1]; + if (left_d[0] === right_d[1]) { + diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); + } + } + } + return diffs; +} + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + +exports.shim = shim; +function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} + + +/***/ }), +/* 53 */ +/***/ (function(module, exports) { + +var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) +})() == '[object Arguments]'; + +exports = module.exports = supportsArgumentsClass ? supported : unsupported; + +exports.supported = supported; +function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +}; + +exports.unsupported = unsupported; +function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports) { + +'use strict'; + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @api private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {Mixed} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @api private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @api public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Boolean} exists Only check if there are listeners. + * @returns {Array|Boolean} + * @api public + */ +EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @api public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + 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++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (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 true; +}; + +/** + * Add a listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Add a one-time listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Remove the listeners of a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {Mixed} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn + && (!once || listeners.once) + && (!context || listeners.context === context) + ) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {String|Symbol} [event] The event name. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// This function doesn't apply anymore. +// +EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; +}; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extend2 = __webpack_require__(3); + +var _extend3 = _interopRequireDefault(_extend2); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _align = __webpack_require__(36); + +var _background = __webpack_require__(37); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _color = __webpack_require__(26); + +var _direction = __webpack_require__(38); + +var _font = __webpack_require__(39); + +var _size = __webpack_require__(40); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:clipboard'); + +var DOM_KEY = '__ql-matcher'; + +var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; + +var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var Clipboard = function (_Module) { + _inherits(Clipboard, _Module); + + function Clipboard(quill, options) { + _classCallCheck(this, Clipboard); + + var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); + + _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); + _this.container = _this.quill.addContainer('ql-clipboard'); + _this.container.setAttribute('contenteditable', true); + _this.container.setAttribute('tabindex', -1); + _this.matchers = []; + CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + selector = _ref2[0], + matcher = _ref2[1]; + + if (!options.matchVisual && matcher === matchSpacing) return; + _this.addMatcher(selector, matcher); + }); + return _this; + } + + _createClass(Clipboard, [{ + key: 'addMatcher', + value: function addMatcher(selector, matcher) { + this.matchers.push([selector, matcher]); + } + }, { + key: 'convert', + value: function convert(html) { + if (typeof html === 'string') { + this.container.innerHTML = html.replace(/\>\r?\n +\<'); // Remove spaces between tags + return this.convert(); + } + var formats = this.quill.getFormat(this.quill.selection.savedRange.index); + if (formats[_code2.default.blotName]) { + var text = this.container.innerText; + this.container.innerHTML = ''; + return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName])); + } + + var _prepareMatching = this.prepareMatching(), + _prepareMatching2 = _slicedToArray(_prepareMatching, 2), + elementMatchers = _prepareMatching2[0], + textMatchers = _prepareMatching2[1]; + + var delta = traverse(this.container, elementMatchers, textMatchers); + // Remove trailing newline + if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); + } + debug.log('convert', this.container.innerHTML, delta); + this.container.innerHTML = ''; + return delta; + } + }, { + key: 'dangerouslyPasteHTML', + value: function dangerouslyPasteHTML(index, html) { + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; + + if (typeof index === 'string') { + this.quill.setContents(this.convert(index), html); + this.quill.setSelection(0, _quill2.default.sources.SILENT); + } else { + var paste = this.convert(html); + this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); + this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT); + } + } + }, { + key: 'onPaste', + value: function onPaste(e) { + var _this2 = this; + + if (e.defaultPrevented || !this.quill.isEnabled()) return; + var range = this.quill.getSelection(); + var delta = new _quillDelta2.default().retain(range.index); + var scrollTop = this.quill.scrollingContainer.scrollTop; + this.container.focus(); + this.quill.selection.update(_quill2.default.sources.SILENT); + setTimeout(function () { + delta = delta.concat(_this2.convert()).delete(range.length); + _this2.quill.updateContents(delta, _quill2.default.sources.USER); + // range.length contributes to delta.length() + _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); + _this2.quill.scrollingContainer.scrollTop = scrollTop; + _this2.quill.focus(); + }, 1); + } + }, { + key: 'prepareMatching', + value: function prepareMatching() { + var _this3 = this; + + var elementMatchers = [], + textMatchers = []; + this.matchers.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + selector = _pair[0], + matcher = _pair[1]; + + switch (selector) { + case Node.TEXT_NODE: + textMatchers.push(matcher); + break; + case Node.ELEMENT_NODE: + elementMatchers.push(matcher); + break; + default: + [].forEach.call(_this3.container.querySelectorAll(selector), function (node) { + // TODO use weakmap + node[DOM_KEY] = node[DOM_KEY] || []; + node[DOM_KEY].push(matcher); + }); + break; + } + }); + return [elementMatchers, textMatchers]; + } + }]); + + return Clipboard; +}(_module2.default); + +Clipboard.DEFAULTS = { + matchers: [], + matchVisual: true +}; + +function applyFormat(delta, format, value) { + if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') { + return Object.keys(format).reduce(function (delta, key) { + return applyFormat(delta, key, format[key]); + }, delta); + } else { + return delta.reduce(function (delta, op) { + if (op.attributes && op.attributes[format]) { + return delta.push(op); + } else { + return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes)); + } + }, new _quillDelta2.default()); + } +} + +function computeStyle(node) { + if (node.nodeType !== Node.ELEMENT_NODE) return {}; + var DOM_KEY = '__ql-computed-style'; + return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); +} + +function deltaEndsWith(delta, text) { + var endText = ""; + for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { + var op = delta.ops[i]; + if (typeof op.insert !== 'string') break; + endText = op.insert + endText; + } + return endText.slice(-1 * text.length) === text; +} + +function isLine(node) { + if (node.childNodes.length === 0) return false; // Exclude embed blocks + var style = computeStyle(node); + return ['block', 'list-item'].indexOf(style.display) > -1; +} + +function traverse(node, elementMatchers, textMatchers) { + // Post-order + if (node.nodeType === node.TEXT_NODE) { + return textMatchers.reduce(function (delta, matcher) { + return matcher(node, delta); + }, new _quillDelta2.default()); + } else if (node.nodeType === node.ELEMENT_NODE) { + return [].reduce.call(node.childNodes || [], function (delta, childNode) { + var childrenDelta = traverse(childNode, elementMatchers, textMatchers); + if (childNode.nodeType === node.ELEMENT_NODE) { + childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + } + return delta.concat(childrenDelta); + }, new _quillDelta2.default()); + } else { + return new _quillDelta2.default(); + } +} + +function matchAlias(format, node, delta) { + return applyFormat(delta, format, true); +} + +function matchAttributor(node, delta) { + var attributes = _parchment2.default.Attributor.Attribute.keys(node); + var classes = _parchment2.default.Attributor.Class.keys(node); + var styles = _parchment2.default.Attributor.Style.keys(node); + var formats = {}; + attributes.concat(classes).concat(styles).forEach(function (name) { + var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); + if (attr != null) { + formats[attr.attrName] = attr.value(node); + if (formats[attr.attrName]) return; + } + attr = ATTRIBUTE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + formats[attr.attrName] = attr.value(node) || undefined; + } + attr = STYLE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + attr = STYLE_ATTRIBUTORS[name]; + formats[attr.attrName] = attr.value(node) || undefined; + } + }); + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + return delta; +} + +function matchBlot(node, delta) { + var match = _parchment2.default.query(node); + if (match == null) return delta; + if (match.prototype instanceof _parchment2.default.Embed) { + var embed = {}; + var value = match.value(node); + if (value != null) { + embed[match.blotName] = value; + delta = new _quillDelta2.default().insert(embed, match.formats(node)); + } + } else if (typeof match.formats === 'function') { + delta = applyFormat(delta, match.blotName, match.formats(node)); + } + return delta; +} + +function matchBreak(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + delta.insert('\n'); + } + return delta; +} + +function matchIgnore() { + return new _quillDelta2.default(); +} + +function matchIndent(node, delta) { + var match = _parchment2.default.query(node); + if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\n')) { + return delta; + } + var indent = -1, + parent = node.parentNode; + while (!parent.classList.contains('ql-clipboard')) { + if ((_parchment2.default.query(parent) || {}).blotName === 'list') { + indent += 1; + } + parent = parent.parentNode; + } + if (indent <= 0) return delta; + return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent })); +} + +function matchNewline(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) { + delta.insert('\n'); + } + } + return delta; +} + +function matchSpacing(node, delta) { + if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { + var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); + if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { + delta.insert('\n'); + } + } + return delta; +} + +function matchStyles(node, delta) { + var formats = {}; + var style = node.style || {}; + if (style.fontStyle && computeStyle(node).fontStyle === 'italic') { + formats.italic = true; + } + if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) { + formats.bold = true; + } + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + if (parseFloat(style.textIndent || 0) > 0) { + // Could be 0.5in + delta = new _quillDelta2.default().insert('\t').concat(delta); + } + return delta; +} + +function matchText(node, delta) { + var text = node.data; + // Word represents empty line with   + if (node.parentNode.tagName === 'O:P') { + return delta.insert(text.trim()); + } + if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) { + return delta; + } + if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { + // eslint-disable-next-line func-style + var replacer = function replacer(collapse, match) { + match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; + return match.length < 1 && collapse ? ' ' : match; + }; + text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); + text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace + if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { + text = text.replace(/^\s+/, replacer.bind(replacer, false)); + } + if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { + text = text.replace(/\s+$/, replacer.bind(replacer, false)); + } + } + return delta.insert(text); +} + +exports.default = Clipboard; +exports.matchAttributor = matchAttributor; +exports.matchBlot = matchBlot; +exports.matchNewline = matchNewline; +exports.matchSpacing = matchSpacing; +exports.matchText = matchText; + +/***/ }), +/* 56 */, +/* 57 */, +/* 58 */, +/* 59 */, +/* 60 */, +/* 61 */, +/* 62 */, +/* 63 */, +/* 64 */, +/* 65 */, +/* 66 */, +/* 67 */, +/* 68 */, +/* 69 */, +/* 70 */, +/* 71 */, +/* 72 */, +/* 73 */, +/* 74 */, +/* 75 */, +/* 76 */, +/* 77 */, +/* 78 */, +/* 79 */, +/* 80 */, +/* 81 */, +/* 82 */, +/* 83 */, +/* 84 */, +/* 85 */, +/* 86 */, +/* 87 */, +/* 88 */, +/* 89 */, +/* 90 */, +/* 91 */, +/* 92 */, +/* 93 */, +/* 94 */, +/* 95 */, +/* 96 */, +/* 97 */, +/* 98 */, +/* 99 */, +/* 100 */, +/* 101 */, +/* 102 */, +/* 103 */, +/* 104 */, +/* 105 */, +/* 106 */, +/* 107 */, +/* 108 */, +/* 109 */, +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(29); + + +/***/ }) +/******/ ])["default"]; +}); \ No newline at end of file diff -Nru bibledit-5.0.912/quill/1.3.6/quill.js bibledit-5.0.922/quill/1.3.6/quill.js --- bibledit-5.0.912/quill/1.3.6/quill.js 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.3.6/quill.js 2018-03-12 06:39:22.000000000 +0000 @@ -0,0 +1,11489 @@ +/*! + * Quill Editor v1.3.6 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["Quill"] = factory(); + else + root["Quill"] = factory(); +})(typeof self !== 'undefined' ? self : this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 109); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var format_1 = __webpack_require__(18); +var leaf_1 = __webpack_require__(19); +var scroll_1 = __webpack_require__(45); +var inline_1 = __webpack_require__(46); +var block_1 = __webpack_require__(47); +var embed_1 = __webpack_require__(48); +var text_1 = __webpack_require__(49); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(32); +var style_1 = __webpack_require__(33); +var store_1 = __webpack_require__(31); +var Registry = __webpack_require__(1); +var Parchment = { + Scope: Registry.Scope, + create: Registry.create, + find: Registry.find, + query: Registry.query, + register: Registry.register, + Container: container_1.default, + Format: format_1.default, + Leaf: leaf_1.default, + Embed: embed_1.default, + Scroll: scroll_1.default, + Block: block_1.default, + Inline: inline_1.default, + Text: text_1.default, + Attributor: { + Attribute: attributor_1.default, + Class: class_1.default, + Style: style_1.default, + Store: store_1.default, + }, +}; +exports.default = Parchment; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var ParchmentError = /** @class */ (function (_super) { + __extends(ParchmentError, _super); + function ParchmentError(message) { + var _this = this; + message = '[Parchment] ' + message; + _this = _super.call(this, message) || this; + _this.message = message; + _this.name = _this.constructor.name; + return _this; + } + return ParchmentError; +}(Error)); +exports.ParchmentError = ParchmentError; +var attributes = {}; +var classes = {}; +var tags = {}; +var types = {}; +exports.DATA_KEY = '__blot'; +var Scope; +(function (Scope) { + Scope[Scope["TYPE"] = 3] = "TYPE"; + Scope[Scope["LEVEL"] = 12] = "LEVEL"; + Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; + Scope[Scope["BLOT"] = 14] = "BLOT"; + Scope[Scope["INLINE"] = 7] = "INLINE"; + Scope[Scope["BLOCK"] = 11] = "BLOCK"; + Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; + Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; + Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; + Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; + Scope[Scope["ANY"] = 15] = "ANY"; +})(Scope = exports.Scope || (exports.Scope = {})); +function create(input, value) { + var match = query(input); + if (match == null) { + throw new ParchmentError("Unable to create " + input + " blot"); + } + var BlotClass = match; + var node = + // @ts-ignore + input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value); + return new BlotClass(node, value); +} +exports.create = create; +function find(node, bubble) { + if (bubble === void 0) { bubble = false; } + if (node == null) + return null; + // @ts-ignore + if (node[exports.DATA_KEY] != null) + return node[exports.DATA_KEY].blot; + if (bubble) + return find(node.parentNode, bubble); + return null; +} +exports.find = find; +function query(query, scope) { + if (scope === void 0) { scope = Scope.ANY; } + var match; + if (typeof query === 'string') { + match = types[query] || attributes[query]; + // @ts-ignore + } + else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) { + match = types['text']; + } + else if (typeof query === 'number') { + if (query & Scope.LEVEL & Scope.BLOCK) { + match = types['block']; + } + else if (query & Scope.LEVEL & Scope.INLINE) { + match = types['inline']; + } + } + else if (query instanceof HTMLElement) { + var names = (query.getAttribute('class') || '').split(/\s+/); + for (var i in names) { + match = classes[names[i]]; + if (match) + break; + } + match = match || tags[query.tagName]; + } + if (match == null) + return null; + // @ts-ignore + if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) + return match; + return null; +} +exports.query = query; +function register() { + var Definitions = []; + for (var _i = 0; _i < arguments.length; _i++) { + Definitions[_i] = arguments[_i]; + } + if (Definitions.length > 1) { + return Definitions.map(function (d) { + return register(d); + }); + } + var Definition = Definitions[0]; + if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { + throw new ParchmentError('Invalid definition'); + } + else if (Definition.blotName === 'abstract') { + throw new ParchmentError('Cannot register abstract class'); + } + types[Definition.blotName || Definition.attrName] = Definition; + if (typeof Definition.keyName === 'string') { + attributes[Definition.keyName] = Definition; + } + else { + if (Definition.className != null) { + classes[Definition.className] = Definition; + } + if (Definition.tagName != null) { + if (Array.isArray(Definition.tagName)) { + Definition.tagName = Definition.tagName.map(function (tagName) { + return tagName.toUpperCase(); + }); + } + else { + Definition.tagName = Definition.tagName.toUpperCase(); + } + var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; + tagNames.forEach(function (tag) { + if (tags[tag] == null || Definition.className == null) { + tags[tag] = Definition; + } + }); + } + } + return Definition; +} +exports.register = register; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +var diff = __webpack_require__(51); +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); +var op = __webpack_require__(20); + + +var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() + + +var Delta = function (ops) { + // Assume we are given a well formed ops + if (Array.isArray(ops)) { + this.ops = ops; + } else if (ops != null && Array.isArray(ops.ops)) { + this.ops = ops.ops; + } else { + this.ops = []; + } +}; + + +Delta.prototype.insert = function (text, attributes) { + var newOp = {}; + if (text.length === 0) return this; + newOp.insert = text; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype['delete'] = function (length) { + if (length <= 0) return this; + return this.push({ 'delete': length }); +}; + +Delta.prototype.retain = function (length, attributes) { + if (length <= 0) return this; + var newOp = { retain: length }; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype.push = function (newOp) { + var index = this.ops.length; + var lastOp = this.ops[index - 1]; + newOp = extend(true, {}, newOp); + if (typeof lastOp === 'object') { + if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { + this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; + return this; + } + // Since it does not matter if we insert before or after deleting at the same index, + // always prefer to insert first + if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { + index -= 1; + lastOp = this.ops[index - 1]; + if (typeof lastOp !== 'object') { + this.ops.unshift(newOp); + return this; + } + } + if (equal(newOp.attributes, lastOp.attributes)) { + if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { + this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { + this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } + } + } + if (index === this.ops.length) { + this.ops.push(newOp); + } else { + this.ops.splice(index, 0, newOp); + } + return this; +}; + +Delta.prototype.chop = function () { + var lastOp = this.ops[this.ops.length - 1]; + if (lastOp && lastOp.retain && !lastOp.attributes) { + this.ops.pop(); + } + return this; +}; + +Delta.prototype.filter = function (predicate) { + return this.ops.filter(predicate); +}; + +Delta.prototype.forEach = function (predicate) { + this.ops.forEach(predicate); +}; + +Delta.prototype.map = function (predicate) { + return this.ops.map(predicate); +}; + +Delta.prototype.partition = function (predicate) { + var passed = [], failed = []; + this.forEach(function(op) { + var target = predicate(op) ? passed : failed; + target.push(op); + }); + return [passed, failed]; +}; + +Delta.prototype.reduce = function (predicate, initial) { + return this.ops.reduce(predicate, initial); +}; + +Delta.prototype.changeLength = function () { + return this.reduce(function (length, elem) { + if (elem.insert) { + return length + op.length(elem); + } else if (elem.delete) { + return length - elem.delete; + } + return length; + }, 0); +}; + +Delta.prototype.length = function () { + return this.reduce(function (length, elem) { + return length + op.length(elem); + }, 0); +}; + +Delta.prototype.slice = function (start, end) { + start = start || 0; + if (typeof end !== 'number') end = Infinity; + var ops = []; + var iter = op.iterator(this.ops); + var index = 0; + while (index < end && iter.hasNext()) { + var nextOp; + if (index < start) { + nextOp = iter.next(start - index); + } else { + nextOp = iter.next(end - index); + ops.push(nextOp); + } + index += op.length(nextOp); + } + return new Delta(ops); +}; + + +Delta.prototype.compose = function (other) { + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else if (thisIter.peekType() === 'delete') { + delta.push(thisIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (typeof otherOp.retain === 'number') { + var newOp = {}; + if (typeof thisOp.retain === 'number') { + newOp.retain = length; + } else { + newOp.insert = thisOp.insert; + } + // Preserve null when composing with a retain, otherwise remove it for inserts + var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); + if (attributes) newOp.attributes = attributes; + delta.push(newOp); + // Other op should be delete, we could be an insert or retain + // Insert + delete cancels out + } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { + delta.push(otherOp); + } + } + } + return delta.chop(); +}; + +Delta.prototype.concat = function (other) { + var delta = new Delta(this.ops.slice()); + if (other.ops.length > 0) { + delta.push(other.ops[0]); + delta.ops = delta.ops.concat(other.ops.slice(1)); + } + return delta; +}; + +Delta.prototype.diff = function (other, index) { + if (this.ops === other.ops) { + return new Delta(); + } + var strings = [this, other].map(function (delta) { + return delta.map(function (op) { + if (op.insert != null) { + return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; + } + var prep = (delta === other) ? 'on' : 'with'; + throw new Error('diff() called ' + prep + ' non-document'); + }).join(''); + }); + var delta = new Delta(); + var diffResult = diff(strings[0], strings[1], index); + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + diffResult.forEach(function (component) { + var length = component[1].length; + while (length > 0) { + var opLength = 0; + switch (component[0]) { + case diff.INSERT: + opLength = Math.min(otherIter.peekLength(), length); + delta.push(otherIter.next(opLength)); + break; + case diff.DELETE: + opLength = Math.min(length, thisIter.peekLength()); + thisIter.next(opLength); + delta['delete'](opLength); + break; + case diff.EQUAL: + opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); + var thisOp = thisIter.next(opLength); + var otherOp = otherIter.next(opLength); + if (equal(thisOp.insert, otherOp.insert)) { + delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); + } else { + delta.push(otherOp)['delete'](opLength); + } + break; + } + length -= opLength; + } + }); + return delta.chop(); +}; + +Delta.prototype.eachLine = function (predicate, newline) { + newline = newline || '\n'; + var iter = op.iterator(this.ops); + var line = new Delta(); + var i = 0; + while (iter.hasNext()) { + if (iter.peekType() !== 'insert') return; + var thisOp = iter.peek(); + var start = op.length(thisOp) - iter.peekLength(); + var 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) === false) { + return; + } + i += 1; + line = new Delta(); + } + } + if (line.length() > 0) { + predicate(line, {}, i); + } +}; + +Delta.prototype.transform = function (other, priority) { + priority = !!priority; + if (typeof other === 'number') { + return this.transformPosition(other, priority); + } + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { + delta.retain(op.length(thisIter.next())); + } else if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (thisOp['delete']) { + // Our delete either makes their delete redundant or removes their retain + continue; + } else if (otherOp['delete']) { + delta.push(otherOp); + } else { + // We retain either their retain or insert + delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); + } + } + } + return delta.chop(); +}; + +Delta.prototype.transformPosition = function (index, priority) { + priority = !!priority; + var thisIter = op.iterator(this.ops); + var offset = 0; + while (thisIter.hasNext() && offset <= index) { + var length = thisIter.peekLength(); + var nextType = thisIter.peekType(); + thisIter.next(); + if (nextType === 'delete') { + index -= Math.min(length, index - offset); + continue; + } else if (nextType === 'insert' && (offset < index || !priority)) { + index += length; + } + offset += length; + } + return index; +}; + + +module.exports = Delta; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +'use strict'; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; +}; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var NEWLINE_LENGTH = 1; + +var BlockEmbed = function (_Parchment$Embed) { + _inherits(BlockEmbed, _Parchment$Embed); + + function BlockEmbed() { + _classCallCheck(this, BlockEmbed); + + return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); + } + + _createClass(BlockEmbed, [{ + key: 'attach', + value: function attach() { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); + this.attributes = new _parchment2.default.Attributor.Store(this.domNode); + } + }, { + key: 'delta', + value: function delta() { + return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); + } + }, { + key: 'format', + value: function format(name, value) { + var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); + if (attribute != null) { + this.attributes.attribute(attribute, value); + } + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + this.format(name, value); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (typeof value === 'string' && value.endsWith('\n')) { + var block = _parchment2.default.create(Block.blotName); + this.parent.insertBefore(block, index === 0 ? this : this.next); + block.insertAt(0, value.slice(0, -1)); + } else { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); + } + } + }]); + + return BlockEmbed; +}(_parchment2.default.Embed); + +BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; +// It is important for cursor behavior BlockEmbeds use tags that are block level elements + + +var Block = function (_Parchment$Block) { + _inherits(Block, _Parchment$Block); + + function Block(domNode) { + _classCallCheck(this, Block); + + var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); + + _this2.cache = {}; + return _this2; + } + + _createClass(Block, [{ + key: 'delta', + value: function delta() { + if (this.cache.delta == null) { + this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { + if (leaf.length() === 0) { + return delta; + } else { + return delta.insert(leaf.value(), bubbleFormats(leaf)); + } + }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); + } + return this.cache.delta; + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); + this.cache = {}; + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length <= 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + if (index + length === this.length()) { + this.format(name, value); + } + } else { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); + } + this.cache = {}; + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); + if (value.length === 0) return; + var lines = value.split('\n'); + var text = lines.shift(); + if (text.length > 0) { + if (index < this.length() - 1 || this.children.tail == null) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); + } else { + this.children.tail.insertAt(this.children.tail.length(), text); + } + this.cache = {}; + } + var block = this; + lines.reduce(function (index, line) { + block = block.split(index, true); + block.insertAt(0, line); + return line.length; + }, index + text.length); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + var head = this.children.head; + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); + if (head instanceof _break2.default) { + head.remove(); + } + this.cache = {}; + } + }, { + key: 'length', + value: function length() { + if (this.cache.length == null) { + this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; + } + return this.cache.length; + } + }, { + key: 'moveChildren', + value: function moveChildren(target, ref) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); + this.cache = {}; + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context); + this.cache = {}; + } + }, { + key: 'path', + value: function path(index) { + return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); + } + }, { + key: 'removeChild', + value: function removeChild(child) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); + this.cache = {}; + } + }, { + key: 'split', + value: function split(index) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { + var clone = this.clone(); + if (index === 0) { + this.parent.insertBefore(clone, this); + return this; + } else { + this.parent.insertBefore(clone, this.next); + return clone; + } + } else { + var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); + this.cache = {}; + return next; + } + } + }]); + + return Block; +}(_parchment2.default.Block); + +Block.blotName = 'block'; +Block.tagName = 'P'; +Block.defaultChild = 'break'; +Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default]; + +function bubbleFormats(blot) { + var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (blot == null) return formats; + if (typeof blot.formats === 'function') { + formats = (0, _extend2.default)(formats, blot.formats()); + } + if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { + return formats; + } + return bubbleFormats(blot.parent, formats); +} + +exports.bubbleFormats = bubbleFormats; +exports.BlockEmbed = BlockEmbed; +exports.default = Block; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.overload = exports.expandConfig = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +__webpack_require__(50); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _editor = __webpack_require__(14); + +var _editor2 = _interopRequireDefault(_editor); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _selection = __webpack_require__(15); + +var _selection2 = _interopRequireDefault(_selection); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _theme = __webpack_require__(34); + +var _theme2 = _interopRequireDefault(_theme); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill'); + +var Quill = function () { + _createClass(Quill, null, [{ + key: 'debug', + value: function debug(limit) { + if (limit === true) { + limit = 'log'; + } + _logger2.default.level(limit); + } + }, { + key: 'find', + value: function find(node) { + return node.__quill || _parchment2.default.find(node); + } + }, { + key: 'import', + value: function _import(name) { + if (this.imports[name] == null) { + debug.error('Cannot import ' + name + '. Are you sure it was registered?'); + } + return this.imports[name]; + } + }, { + key: 'register', + value: function register(path, target) { + var _this = this; + + var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (typeof path !== 'string') { + var name = path.attrName || path.blotName; + if (typeof name === 'string') { + // register(Blot | Attributor, overwrite) + this.register('formats/' + name, path, target); + } else { + Object.keys(path).forEach(function (key) { + _this.register(key, path[key], target); + }); + } + } else { + if (this.imports[path] != null && !overwrite) { + debug.warn('Overwriting ' + path + ' with', target); + } + this.imports[path] = target; + if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { + _parchment2.default.register(target); + } else if (path.startsWith('modules') && typeof target.register === 'function') { + target.register(); + } + } + } + }]); + + function Quill(container) { + var _this2 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Quill); + + this.options = expandConfig(container, options); + this.container = this.options.container; + if (this.container == null) { + return debug.error('Invalid Quill container', container); + } + if (this.options.debug) { + Quill.debug(this.options.debug); + } + var html = this.container.innerHTML.trim(); + this.container.classList.add('ql-container'); + this.container.innerHTML = ''; + this.container.__quill = this; + this.root = this.addContainer('ql-editor'); + this.root.classList.add('ql-blank'); + this.root.setAttribute('data-gramm', false); + this.scrollingContainer = this.options.scrollingContainer || this.root; + this.emitter = new _emitter4.default(); + this.scroll = _parchment2.default.create(this.root, { + emitter: this.emitter, + whitelist: this.options.formats + }); + this.editor = new _editor2.default(this.scroll); + this.selection = new _selection2.default(this.scroll, this.emitter); + this.theme = new this.options.theme(this, this.options); + this.keyboard = this.theme.addModule('keyboard'); + this.clipboard = this.theme.addModule('clipboard'); + this.history = this.theme.addModule('history'); + this.theme.init(); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { + if (type === _emitter4.default.events.TEXT_CHANGE) { + _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { + var range = _this2.selection.lastRange; + var index = range && range.length === 0 ? range.index : undefined; + modify.call(_this2, function () { + return _this2.editor.update(null, mutations, index); + }, source); + }); + var contents = this.clipboard.convert('
    ' + html + '


    '); + this.setContents(contents); + this.history.clear(); + if (this.options.placeholder) { + this.root.setAttribute('data-placeholder', this.options.placeholder); + } + if (this.options.readOnly) { + this.disable(); + } + } + + _createClass(Quill, [{ + key: 'addContainer', + value: function addContainer(container) { + var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (typeof container === 'string') { + var className = container; + container = document.createElement('div'); + container.classList.add(className); + } + this.container.insertBefore(container, refNode); + return container; + } + }, { + key: 'blur', + value: function blur() { + this.selection.setRange(null); + } + }, { + key: 'deleteText', + value: function deleteText(index, length, source) { + var _this3 = this; + + var _overload = overload(index, length, source); + + var _overload2 = _slicedToArray(_overload, 4); + + index = _overload2[0]; + length = _overload2[1]; + source = _overload2[3]; + + return modify.call(this, function () { + return _this3.editor.deleteText(index, length); + }, source, index, -1 * length); + } + }, { + key: 'disable', + value: function disable() { + this.enable(false); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.scroll.enable(enabled); + this.container.classList.toggle('ql-disabled', !enabled); + } + }, { + key: 'focus', + value: function focus() { + var scrollTop = this.scrollingContainer.scrollTop; + this.selection.focus(); + this.scrollingContainer.scrollTop = scrollTop; + this.scrollIntoView(); + } + }, { + key: 'format', + value: function format(name, value) { + var _this4 = this; + + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + return modify.call(this, function () { + var range = _this4.getSelection(true); + var change = new _quillDelta2.default(); + if (range == null) { + return change; + } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); + } else if (range.length === 0) { + _this4.selection.format(name, value); + return change; + } else { + change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); + } + _this4.setSelection(range, _emitter4.default.sources.SILENT); + return change; + }, source); + } + }, { + key: 'formatLine', + value: function formatLine(index, length, name, value, source) { + var _this5 = this; + + var formats = void 0; + + var _overload3 = overload(index, length, name, value, source); + + var _overload4 = _slicedToArray(_overload3, 4); + + index = _overload4[0]; + length = _overload4[1]; + formats = _overload4[2]; + source = _overload4[3]; + + return modify.call(this, function () { + return _this5.editor.formatLine(index, length, formats); + }, source, index, 0); + } + }, { + key: 'formatText', + value: function formatText(index, length, name, value, source) { + var _this6 = this; + + var formats = void 0; + + var _overload5 = overload(index, length, name, value, source); + + var _overload6 = _slicedToArray(_overload5, 4); + + index = _overload6[0]; + length = _overload6[1]; + formats = _overload6[2]; + source = _overload6[3]; + + return modify.call(this, function () { + return _this6.editor.formatText(index, length, formats); + }, source, index, 0); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var bounds = void 0; + if (typeof index === 'number') { + bounds = this.selection.getBounds(index, length); + } else { + bounds = this.selection.getBounds(index.index, index.length); + } + var containerBounds = this.container.getBoundingClientRect(); + return { + bottom: bounds.bottom - containerBounds.top, + height: bounds.height, + left: bounds.left - containerBounds.left, + right: bounds.right - containerBounds.left, + top: bounds.top - containerBounds.top, + width: bounds.width + }; + } + }, { + key: 'getContents', + value: function getContents() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload7 = overload(index, length); + + var _overload8 = _slicedToArray(_overload7, 2); + + index = _overload8[0]; + length = _overload8[1]; + + return this.editor.getContents(index, length); + } + }, { + key: 'getFormat', + value: function getFormat() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true); + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (typeof index === 'number') { + return this.editor.getFormat(index, length); + } else { + return this.editor.getFormat(index.index, index.length); + } + } + }, { + key: 'getIndex', + value: function getIndex(blot) { + return blot.offset(this.scroll); + } + }, { + key: 'getLength', + value: function getLength() { + return this.scroll.length(); + } + }, { + key: 'getLeaf', + value: function getLeaf(index) { + return this.scroll.leaf(index); + } + }, { + key: 'getLine', + value: function getLine(index) { + return this.scroll.line(index); + } + }, { + key: 'getLines', + value: function getLines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + if (typeof index !== 'number') { + return this.scroll.lines(index.index, index.length); + } else { + return this.scroll.lines(index, length); + } + } + }, { + key: 'getModule', + value: function getModule(name) { + return this.theme.modules[name]; + } + }, { + key: 'getSelection', + value: function getSelection() { + var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (focus) this.focus(); + this.update(); // Make sure we access getRange with editor in consistent state + return this.selection.getRange()[0]; + } + }, { + key: 'getText', + value: function getText() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload9 = overload(index, length); + + var _overload10 = _slicedToArray(_overload9, 2); + + index = _overload10[0]; + length = _overload10[1]; + + return this.editor.getText(index, length); + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return this.selection.hasFocus(); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + var _this7 = this; + + var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; + + return modify.call(this, function () { + return _this7.editor.insertEmbed(index, embed, value); + }, source, index); + } + }, { + key: 'insertText', + value: function insertText(index, text, name, value, source) { + var _this8 = this; + + var formats = void 0; + + var _overload11 = overload(index, 0, name, value, source); + + var _overload12 = _slicedToArray(_overload11, 4); + + index = _overload12[0]; + formats = _overload12[2]; + source = _overload12[3]; + + return modify.call(this, function () { + return _this8.editor.insertText(index, text, formats); + }, source, index, text.length); + } + }, { + key: 'isEnabled', + value: function isEnabled() { + return !this.container.classList.contains('ql-disabled'); + } + }, { + key: 'off', + value: function off() { + return this.emitter.off.apply(this.emitter, arguments); + } + }, { + key: 'on', + value: function on() { + return this.emitter.on.apply(this.emitter, arguments); + } + }, { + key: 'once', + value: function once() { + return this.emitter.once.apply(this.emitter, arguments); + } + }, { + key: 'pasteHTML', + value: function pasteHTML(index, html, source) { + this.clipboard.dangerouslyPasteHTML(index, html, source); + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length, source) { + var _this9 = this; + + var _overload13 = overload(index, length, source); + + var _overload14 = _slicedToArray(_overload13, 4); + + index = _overload14[0]; + length = _overload14[1]; + source = _overload14[3]; + + return modify.call(this, function () { + return _this9.editor.removeFormat(index, length); + }, source, index); + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView() { + this.selection.scrollIntoView(this.scrollingContainer); + } + }, { + key: 'setContents', + value: function setContents(delta) { + var _this10 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + var length = _this10.getLength(); + var deleted = _this10.editor.deleteText(0, length); + var applied = _this10.editor.applyDelta(delta); + var lastOp = applied.ops[applied.ops.length - 1]; + if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { + _this10.editor.deleteText(_this10.getLength() - 1, 1); + applied.delete(1); + } + var ret = deleted.compose(applied); + return ret; + }, source); + } + }, { + key: 'setSelection', + value: function setSelection(index, length, source) { + if (index == null) { + this.selection.setRange(null, length || Quill.sources.API); + } else { + var _overload15 = overload(index, length, source); + + var _overload16 = _slicedToArray(_overload15, 4); + + index = _overload16[0]; + length = _overload16[1]; + source = _overload16[3]; + + this.selection.setRange(new _selection.Range(index, length), source); + if (source !== _emitter4.default.sources.SILENT) { + this.selection.scrollIntoView(this.scrollingContainer); + } + } + } + }, { + key: 'setText', + value: function setText(text) { + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + var delta = new _quillDelta2.default().insert(text); + return this.setContents(delta, source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes + this.selection.update(source); + return change; + } + }, { + key: 'updateContents', + value: function updateContents(delta) { + var _this11 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + return _this11.editor.applyDelta(delta, source); + }, source, true); + } + }]); + + return Quill; +}(); + +Quill.DEFAULTS = { + bounds: null, + formats: null, + modules: {}, + placeholder: '', + readOnly: false, + scrollingContainer: null, + strict: true, + theme: 'default' +}; +Quill.events = _emitter4.default.events; +Quill.sources = _emitter4.default.sources; +// eslint-disable-next-line no-undef +Quill.version = false ? 'dev' : "1.3.6"; + +Quill.imports = { + 'delta': _quillDelta2.default, + 'parchment': _parchment2.default, + 'core/module': _module2.default, + 'core/theme': _theme2.default +}; + +function expandConfig(container, userConfig) { + userConfig = (0, _extend2.default)(true, { + container: container, + modules: { + clipboard: true, + keyboard: true, + history: true + } + }, userConfig); + if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { + userConfig.theme = _theme2.default; + } else { + userConfig.theme = Quill.import('themes/' + userConfig.theme); + if (userConfig.theme == null) { + throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); + } + } + var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); + [themeConfig, userConfig].forEach(function (config) { + config.modules = config.modules || {}; + Object.keys(config.modules).forEach(function (module) { + if (config.modules[module] === true) { + config.modules[module] = {}; + } + }); + }); + var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); + var moduleConfig = moduleNames.reduce(function (config, name) { + var moduleClass = Quill.import('modules/' + name); + if (moduleClass == null) { + debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); + } else { + config[name] = moduleClass.DEFAULTS || {}; + } + return config; + }, {}); + // Special case toolbar shorthand + if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { + userConfig.modules.toolbar = { + container: userConfig.modules.toolbar + }; + } + userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); + ['bounds', 'container', 'scrollingContainer'].forEach(function (key) { + if (typeof userConfig[key] === 'string') { + userConfig[key] = document.querySelector(userConfig[key]); + } + }); + userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { + if (userConfig.modules[name]) { + config[name] = userConfig.modules[name]; + } + return config; + }, {}); + return userConfig; +} + +// Handle selection preservation and TEXT_CHANGE emission +// common to modification APIs +function modify(modifier, source, index, shift) { + if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { + return new _quillDelta2.default(); + } + var range = index == null ? null : this.getSelection(); + var oldDelta = this.editor.delta; + var change = modifier(); + if (range != null) { + if (index === true) index = range.index; + if (shift == null) { + range = shiftRange(range, change, source); + } else if (shift !== 0) { + range = shiftRange(range, index, shift, source); + } + this.setSelection(range, _emitter4.default.sources.SILENT); + } + if (change.length() > 0) { + var _emitter; + + var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + return change; +} + +function overload(index, length, name, value, source) { + var formats = {}; + if (typeof index.index === 'number' && typeof index.length === 'number') { + // Allow for throwaway end (used by insertText/insertEmbed) + if (typeof length !== 'number') { + source = value, value = name, name = length, length = index.length, index = index.index; + } else { + length = index.length, index = index.index; + } + } else if (typeof length !== 'number') { + source = value, value = name, name = length, length = 0; + } + // Handle format being object, two format name/value strings or excluded + if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { + formats = name; + source = value; + } else if (typeof name === 'string') { + if (value != null) { + formats[name] = value; + } else { + source = name; + } + } + // Handle optional source + source = source || _emitter4.default.sources.API; + return [index, length, formats, source]; +} + +function shiftRange(range, index, length, source) { + if (range == null) return null; + var start = void 0, + end = void 0; + if (index instanceof _quillDelta2.default) { + var _map = [range.index, range.index + range.length].map(function (pos) { + return index.transformPosition(pos, source !== _emitter4.default.sources.USER); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + } else { + var _map3 = [range.index, range.index + range.length].map(function (pos) { + if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos; + if (length >= 0) { + return pos + length; + } else { + return Math.max(index, pos + length); + } + }); + + var _map4 = _slicedToArray(_map3, 2); + + start = _map4[0]; + end = _map4[1]; + } + return new _selection.Range(start, end - start); +} + +exports.expandConfig = expandConfig; +exports.overload = overload; +exports.default = Quill; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Inline = function (_Parchment$Inline) { + _inherits(Inline, _Parchment$Inline); + + function Inline() { + _classCallCheck(this, Inline); + + return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); + } + + _createClass(Inline, [{ + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { + var blot = this.isolate(index, length); + if (value) { + blot.wrap(name, value); + } + } else { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context); + if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { + var parent = this.parent.isolate(this.offset(), this.length()); + this.moveChildren(parent); + parent.wrap(this); + } + } + }], [{ + key: 'compare', + value: function compare(self, other) { + var selfIndex = Inline.order.indexOf(self); + var otherIndex = Inline.order.indexOf(other); + if (selfIndex >= 0 || otherIndex >= 0) { + return selfIndex - otherIndex; + } else if (self === other) { + return 0; + } else if (self < other) { + return -1; + } else { + return 1; + } + } + }]); + + return Inline; +}(_parchment2.default.Inline); + +Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default]; +// Lower index means deeper in the DOM tree, since not found (-1) is for embeds +Inline.order = ['cursor', 'inline', // Must be lower +'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher +]; + +exports.default = Inline; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TextBlot = function (_Parchment$Text) { + _inherits(TextBlot, _Parchment$Text); + + function TextBlot() { + _classCallCheck(this, TextBlot); + + return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); + } + + return TextBlot; +}(_parchment2.default.Text); + +exports.default = TextBlot; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _eventemitter = __webpack_require__(54); + +var _eventemitter2 = _interopRequireDefault(_eventemitter); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:events'); + +var EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click']; + +EVENTS.forEach(function (eventName) { + document.addEventListener(eventName, function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) { + // TODO use WeakMap + if (node.__quill && node.__quill.emitter) { + var _node$__quill$emitter; + + (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args); + } + }); + }); +}); + +var Emitter = function (_EventEmitter) { + _inherits(Emitter, _EventEmitter); + + function Emitter() { + _classCallCheck(this, Emitter); + + var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); + + _this.listeners = {}; + _this.on('error', debug.error); + return _this; + } + + _createClass(Emitter, [{ + key: 'emit', + value: function emit() { + debug.log.apply(debug, arguments); + _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); + } + }, { + key: 'handleDOM', + value: function handleDOM(event) { + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + (this.listeners[event.type] || []).forEach(function (_ref) { + var node = _ref.node, + handler = _ref.handler; + + if (event.target === node || node.contains(event.target)) { + handler.apply(undefined, [event].concat(args)); + } + }); + } + }, { + key: 'listenDOM', + value: function listenDOM(eventName, node, handler) { + if (!this.listeners[eventName]) { + this.listeners[eventName] = []; + } + this.listeners[eventName].push({ node: node, handler: handler }); + } + }]); + + return Emitter; +}(_eventemitter2.default); + +Emitter.events = { + EDITOR_CHANGE: 'editor-change', + SCROLL_BEFORE_UPDATE: 'scroll-before-update', + SCROLL_OPTIMIZE: 'scroll-optimize', + SCROLL_UPDATE: 'scroll-update', + SELECTION_CHANGE: 'selection-change', + TEXT_CHANGE: 'text-change' +}; +Emitter.sources = { + API: 'api', + SILENT: 'silent', + USER: 'user' +}; + +exports.default = Emitter; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Module = function Module(quill) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Module); + + this.quill = quill; + this.options = options; +}; + +Module.DEFAULTS = {}; + +exports.default = Module; + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var levels = ['error', 'warn', 'log', 'info']; +var level = 'warn'; + +function debug(method) { + if (levels.indexOf(method) <= levels.indexOf(level)) { + var _console; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + (_console = console)[method].apply(_console, args); // eslint-disable-line no-console + } +} + +function namespace(ns) { + return levels.reduce(function (logger, method) { + logger[method] = debug.bind(console, method, ns); + return logger; + }, {}); +} + +debug.level = namespace.level = function (newLevel) { + level = newLevel; +}; + +exports.default = namespace; + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +var pSlice = Array.prototype.slice; +var objectKeys = __webpack_require__(52); +var isArguments = __webpack_require__(53); + +var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } +} + +function isUndefinedOrNull(value) { + return value === null || value === undefined; +} + +function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; +} + +function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; +} + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var Attributor = /** @class */ (function () { + function Attributor(attrName, keyName, options) { + if (options === void 0) { options = {}; } + this.attrName = attrName; + this.keyName = keyName; + var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; + if (options.scope != null) { + // Ignore type bits, force attribute bit + this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; + } + else { + this.scope = Registry.Scope.ATTRIBUTE; + } + if (options.whitelist != null) + this.whitelist = options.whitelist; + } + Attributor.keys = function (node) { + return [].map.call(node.attributes, function (item) { + return item.name; + }); + }; + Attributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + node.setAttribute(this.keyName, value); + return true; + }; + Attributor.prototype.canAdd = function (node, value) { + var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); + if (match == null) + return false; + if (this.whitelist == null) + return true; + if (typeof value === 'string') { + return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1; + } + else { + return this.whitelist.indexOf(value) > -1; + } + }; + Attributor.prototype.remove = function (node) { + node.removeAttribute(this.keyName); + }; + Attributor.prototype.value = function (node) { + var value = node.getAttribute(this.keyName); + if (this.canAdd(node, value) && value) { + return value; + } + return ''; + }; + return Attributor; +}()); +exports.default = Attributor; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Code = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Code = function (_Inline) { + _inherits(Code, _Inline); + + function Code() { + _classCallCheck(this, Code); + + return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); + } + + return Code; +}(_inline2.default); + +Code.blotName = 'code'; +Code.tagName = 'CODE'; + +var CodeBlock = function (_Block) { + _inherits(CodeBlock, _Block); + + function CodeBlock() { + _classCallCheck(this, CodeBlock); + + return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); + } + + _createClass(CodeBlock, [{ + key: 'delta', + value: function delta() { + var _this3 = this; + + var text = this.domNode.textContent; + if (text.endsWith('\n')) { + // Should always be true + text = text.slice(0, -1); + } + return text.split('\n').reduce(function (delta, frag) { + return delta.insert(frag).insert('\n', _this3.formats()); + }, new _quillDelta2.default()); + } + }, { + key: 'format', + value: function format(name, value) { + if (name === this.statics.blotName && value) return; + + var _descendant = this.descendant(_text2.default, this.length() - 1), + _descendant2 = _slicedToArray(_descendant, 1), + text = _descendant2[0]; + + if (text != null) { + text.deleteAt(text.length() - 1, 1); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length === 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { + return; + } + var nextNewline = this.newlineIndex(index); + if (nextNewline < 0 || nextNewline >= index + length) return; + var prevNewline = this.newlineIndex(index, true) + 1; + var isolateLength = nextNewline - prevNewline + 1; + var blot = this.isolate(prevNewline, isolateLength); + var next = blot.next; + blot.format(name, value); + if (next instanceof CodeBlock) { + next.formatAt(0, index - prevNewline + length - isolateLength, name, value); + } + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return; + + var _descendant3 = this.descendant(_text2.default, index), + _descendant4 = _slicedToArray(_descendant3, 2), + text = _descendant4[0], + offset = _descendant4[1]; + + text.insertAt(offset, value); + } + }, { + key: 'length', + value: function length() { + var length = this.domNode.textContent.length; + if (!this.domNode.textContent.endsWith('\n')) { + return length + 1; + } + return length; + } + }, { + key: 'newlineIndex', + value: function newlineIndex(searchIndex) { + var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (!reverse) { + var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); + return offset > -1 ? searchIndex + offset : -1; + } else { + return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + if (!this.domNode.textContent.endsWith('\n')) { + this.appendChild(_parchment2.default.create('text', '\n')); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { + next.optimize(context); + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); + [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { + var blot = _parchment2.default.find(node); + if (blot == null) { + node.parentNode.removeChild(node); + } else if (blot instanceof _parchment2.default.Embed) { + blot.remove(); + } else { + blot.unwrap(); + } + }); + } + }], [{ + key: 'create', + value: function create(value) { + var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); + domNode.setAttribute('spellcheck', false); + return domNode; + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return CodeBlock; +}(_block2.default); + +CodeBlock.blotName = 'code-block'; +CodeBlock.tagName = 'PRE'; +CodeBlock.TAB = ' '; + +exports.Code = Code; +exports.default = CodeBlock; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _cursor = __webpack_require__(24); + +var _cursor2 = _interopRequireDefault(_cursor); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var ASCII = /^[ -~]*$/; + +var Editor = function () { + function Editor(scroll) { + _classCallCheck(this, Editor); + + this.scroll = scroll; + this.delta = this.getDelta(); + } + + _createClass(Editor, [{ + key: 'applyDelta', + value: function applyDelta(delta) { + var _this = this; + + var consumeNextNewline = false; + this.scroll.update(); + var scrollLength = this.scroll.length(); + this.scroll.batchStart(); + delta = normalizeDelta(delta); + delta.reduce(function (index, op) { + var length = op.retain || op.delete || op.insert.length || 1; + var attributes = op.attributes || {}; + if (op.insert != null) { + if (typeof op.insert === 'string') { + var text = op.insert; + if (text.endsWith('\n') && consumeNextNewline) { + consumeNextNewline = false; + text = text.slice(0, -1); + } + if (index >= scrollLength && !text.endsWith('\n')) { + consumeNextNewline = true; + } + _this.scroll.insertAt(index, text); + + var _scroll$line = _this.scroll.line(index), + _scroll$line2 = _slicedToArray(_scroll$line, 2), + line = _scroll$line2[0], + offset = _scroll$line2[1]; + + var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); + if (line instanceof _block2.default) { + var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), + _line$descendant2 = _slicedToArray(_line$descendant, 1), + leaf = _line$descendant2[0]; + + formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); + } + attributes = _op2.default.attributes.diff(formats, attributes) || {}; + } else if (_typeof(op.insert) === 'object') { + var key = Object.keys(op.insert)[0]; // There should only be one key + if (key == null) return index; + _this.scroll.insertAt(index, key, op.insert[key]); + } + scrollLength += length; + } + Object.keys(attributes).forEach(function (name) { + _this.scroll.formatAt(index, length, name, attributes[name]); + }); + return index + length; + }, 0); + delta.reduce(function (index, op) { + if (typeof op.delete === 'number') { + _this.scroll.deleteAt(index, op.delete); + return index; + } + return index + (op.retain || op.insert.length || 1); + }, 0); + this.scroll.batchEnd(); + return this.update(delta); + } + }, { + key: 'deleteText', + value: function deleteText(index, length) { + this.scroll.deleteAt(index, length); + return this.update(new _quillDelta2.default().retain(index).delete(length)); + } + }, { + key: 'formatLine', + value: function formatLine(index, length) { + var _this2 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + this.scroll.update(); + Object.keys(formats).forEach(function (format) { + if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return; + var lines = _this2.scroll.lines(index, Math.max(length, 1)); + var lengthRemaining = length; + lines.forEach(function (line) { + var lineLength = line.length(); + if (!(line instanceof _code2.default)) { + line.format(format, formats[format]); + } else { + var codeIndex = index - line.offset(_this2.scroll); + var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; + line.formatAt(codeIndex, codeLength, format, formats[format]); + } + lengthRemaining -= lineLength; + }); + }); + this.scroll.optimize(); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'formatText', + value: function formatText(index, length) { + var _this3 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + Object.keys(formats).forEach(function (format) { + _this3.scroll.formatAt(index, length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'getContents', + value: function getContents(index, length) { + return this.delta.slice(index, index + length); + } + }, { + key: 'getDelta', + value: function getDelta() { + return this.scroll.lines().reduce(function (delta, line) { + return delta.concat(line.delta()); + }, new _quillDelta2.default()); + } + }, { + key: 'getFormat', + value: function getFormat(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var lines = [], + leaves = []; + if (length === 0) { + this.scroll.path(index).forEach(function (path) { + var _path = _slicedToArray(path, 1), + blot = _path[0]; + + if (blot instanceof _block2.default) { + lines.push(blot); + } else if (blot instanceof _parchment2.default.Leaf) { + leaves.push(blot); + } + }); + } else { + lines = this.scroll.lines(index, length); + leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); + } + var formatsArr = [lines, leaves].map(function (blots) { + if (blots.length === 0) return {}; + var formats = (0, _block.bubbleFormats)(blots.shift()); + while (Object.keys(formats).length > 0) { + var blot = blots.shift(); + if (blot == null) return formats; + formats = combineFormats((0, _block.bubbleFormats)(blot), formats); + } + return formats; + }); + return _extend2.default.apply(_extend2.default, formatsArr); + } + }, { + key: 'getText', + value: function getText(index, length) { + return this.getContents(index, length).filter(function (op) { + return typeof op.insert === 'string'; + }).map(function (op) { + return op.insert; + }).join(''); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + this.scroll.insertAt(index, embed, value); + return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); + } + }, { + key: 'insertText', + value: function insertText(index, text) { + var _this4 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + this.scroll.insertAt(index, text); + Object.keys(formats).forEach(function (format) { + _this4.scroll.formatAt(index, text.length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); + } + }, { + key: 'isBlank', + value: function isBlank() { + if (this.scroll.children.length == 0) return true; + if (this.scroll.children.length > 1) return false; + var block = this.scroll.children.head; + if (block.statics.blotName !== _block2.default.blotName) return false; + if (block.children.length > 1) return false; + return block.children.head instanceof _break2.default; + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length) { + var text = this.getText(index, length); + + var _scroll$line3 = this.scroll.line(index + length), + _scroll$line4 = _slicedToArray(_scroll$line3, 2), + line = _scroll$line4[0], + offset = _scroll$line4[1]; + + var suffixLength = 0, + suffix = new _quillDelta2.default(); + if (line != null) { + if (!(line instanceof _code2.default)) { + suffixLength = line.length() - offset; + } else { + suffixLength = line.newlineIndex(offset) - offset + 1; + } + suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); + } + var contents = this.getContents(index, length + suffixLength); + var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); + var delta = new _quillDelta2.default().retain(index).concat(diff); + return this.applyDelta(delta); + } + }, { + key: 'update', + value: function update(change) { + var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + + var oldDelta = this.delta; + if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) { + // Optimization for character changes + var textBlot = _parchment2.default.find(mutations[0].target); + var formats = (0, _block.bubbleFormats)(textBlot); + var index = textBlot.offset(this.scroll); + var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); + var oldText = new _quillDelta2.default().insert(oldValue); + var newText = new _quillDelta2.default().insert(textBlot.value()); + var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); + change = diffDelta.reduce(function (delta, op) { + if (op.insert) { + return delta.insert(op.insert, formats); + } else { + return delta.push(op); + } + }, new _quillDelta2.default()); + this.delta = oldDelta.compose(change); + } else { + this.delta = this.getDelta(); + if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { + change = oldDelta.diff(this.delta, cursorIndex); + } + } + return change; + } + }]); + + return Editor; +}(); + +function combineFormats(formats, combined) { + return Object.keys(combined).reduce(function (merged, name) { + if (formats[name] == null) return merged; + if (combined[name] === formats[name]) { + merged[name] = combined[name]; + } else if (Array.isArray(combined[name])) { + if (combined[name].indexOf(formats[name]) < 0) { + merged[name] = combined[name].concat([formats[name]]); + } + } else { + merged[name] = [combined[name], formats[name]]; + } + return merged; + }, {}); +} + +function normalizeDelta(delta) { + return delta.reduce(function (delta, op) { + if (op.insert === 1) { + var attributes = (0, _clone2.default)(op.attributes); + delete attributes['image']; + return delta.insert({ image: op.attributes.image }, attributes); + } + if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { + op = (0, _clone2.default)(op); + if (op.attributes.list) { + op.attributes.list = 'ordered'; + } else { + op.attributes.list = 'bullet'; + delete op.attributes.bullet; + } + } + if (typeof op.insert === 'string') { + var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + return delta.insert(text, op.attributes); + } + return delta.push(op); + }, new _quillDelta2.default()); +} + +exports.default = Editor; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Range = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill:selection'); + +var Range = function Range(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + _classCallCheck(this, Range); + + this.index = index; + this.length = length; +}; + +var Selection = function () { + function Selection(scroll, emitter) { + var _this = this; + + _classCallCheck(this, Selection); + + this.emitter = emitter; + this.scroll = scroll; + this.composing = false; + this.mouseDown = false; + this.root = this.scroll.domNode; + this.cursor = _parchment2.default.create('cursor', this); + // savedRange is last non-null range + this.lastRange = this.savedRange = new Range(0, 0); + this.handleComposition(); + this.handleDragging(); + this.emitter.listenDOM('selectionchange', document, function () { + if (!_this.mouseDown) { + setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1); + } + }); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { + if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { + _this.update(_emitter4.default.sources.SILENT); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { + if (!_this.hasFocus()) return; + var native = _this.getNativeRange(); + if (native == null) return; + if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle + // TODO unclear if this has negative side effects + _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { + try { + _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); + } catch (ignored) {} + }); + }); + this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) { + if (context.range) { + var _context$range = context.range, + startNode = _context$range.startNode, + startOffset = _context$range.startOffset, + endNode = _context$range.endNode, + endOffset = _context$range.endOffset; + + _this.setNativeRange(startNode, startOffset, endNode, endOffset); + } + }); + this.update(_emitter4.default.sources.SILENT); + } + + _createClass(Selection, [{ + key: 'handleComposition', + value: function handleComposition() { + var _this2 = this; + + this.root.addEventListener('compositionstart', function () { + _this2.composing = true; + }); + this.root.addEventListener('compositionend', function () { + _this2.composing = false; + if (_this2.cursor.parent) { + var range = _this2.cursor.restore(); + if (!range) return; + setTimeout(function () { + _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset); + }, 1); + } + }); + } + }, { + key: 'handleDragging', + value: function handleDragging() { + var _this3 = this; + + this.emitter.listenDOM('mousedown', document.body, function () { + _this3.mouseDown = true; + }); + this.emitter.listenDOM('mouseup', document.body, function () { + _this3.mouseDown = false; + _this3.update(_emitter4.default.sources.USER); + }); + } + }, { + key: 'focus', + value: function focus() { + if (this.hasFocus()) return; + this.root.focus(); + this.setRange(this.savedRange); + } + }, { + key: 'format', + value: function format(_format, value) { + if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return; + this.scroll.update(); + var nativeRange = this.getNativeRange(); + if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; + if (nativeRange.start.node !== this.cursor.textNode) { + var blot = _parchment2.default.find(nativeRange.start.node, false); + if (blot == null) return; + // TODO Give blot ability to not split + if (blot instanceof _parchment2.default.Leaf) { + var after = blot.split(nativeRange.start.offset); + blot.parent.insertBefore(this.cursor, after); + } else { + blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen + } + this.cursor.attach(); + } + this.cursor.format(_format, value); + this.scroll.optimize(); + this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); + this.update(); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var scrollLength = this.scroll.length(); + index = Math.min(index, scrollLength - 1); + length = Math.min(index + length, scrollLength - 1) - index; + var node = void 0, + _scroll$leaf = this.scroll.leaf(index), + _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), + leaf = _scroll$leaf2[0], + offset = _scroll$leaf2[1]; + if (leaf == null) return null; + + var _leaf$position = leaf.position(offset, true); + + var _leaf$position2 = _slicedToArray(_leaf$position, 2); + + node = _leaf$position2[0]; + offset = _leaf$position2[1]; + + var range = document.createRange(); + if (length > 0) { + range.setStart(node, offset); + + var _scroll$leaf3 = this.scroll.leaf(index + length); + + var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); + + leaf = _scroll$leaf4[0]; + offset = _scroll$leaf4[1]; + + if (leaf == null) return null; + + var _leaf$position3 = leaf.position(offset, true); + + var _leaf$position4 = _slicedToArray(_leaf$position3, 2); + + node = _leaf$position4[0]; + offset = _leaf$position4[1]; + + range.setEnd(node, offset); + return range.getBoundingClientRect(); + } else { + var side = 'left'; + var rect = void 0; + if (node instanceof Text) { + if (offset < node.data.length) { + range.setStart(node, offset); + range.setEnd(node, offset + 1); + } else { + range.setStart(node, offset - 1); + range.setEnd(node, offset); + side = 'right'; + } + rect = range.getBoundingClientRect(); + } else { + rect = leaf.domNode.getBoundingClientRect(); + if (offset > 0) side = 'right'; + } + return { + bottom: rect.top + rect.height, + height: rect.height, + left: rect[side], + right: rect[side], + top: rect.top, + width: 0 + }; + } + } + }, { + key: 'getNativeRange', + value: function getNativeRange() { + var selection = document.getSelection(); + if (selection == null || selection.rangeCount <= 0) return null; + var nativeRange = selection.getRangeAt(0); + if (nativeRange == null) return null; + var range = this.normalizeNative(nativeRange); + debug.info('getNativeRange', range); + return range; + } + }, { + key: 'getRange', + value: function getRange() { + var normalized = this.getNativeRange(); + if (normalized == null) return [null, null]; + var range = this.normalizedToRange(normalized); + return [range, normalized]; + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return document.activeElement === this.root; + } + }, { + key: 'normalizedToRange', + value: function normalizedToRange(range) { + var _this4 = this; + + var positions = [[range.start.node, range.start.offset]]; + if (!range.native.collapsed) { + positions.push([range.end.node, range.end.offset]); + } + var indexes = positions.map(function (position) { + var _position = _slicedToArray(position, 2), + node = _position[0], + offset = _position[1]; + + var blot = _parchment2.default.find(node, true); + var index = blot.offset(_this4.scroll); + if (offset === 0) { + return index; + } else if (blot instanceof _parchment2.default.Container) { + return index + blot.length(); + } else { + return index + blot.index(node, offset); + } + }); + var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1); + var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes))); + return new Range(start, end - start); + } + }, { + key: 'normalizeNative', + value: function normalizeNative(nativeRange) { + if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { + return null; + } + var range = { + start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, + end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, + native: nativeRange + }; + [range.start, range.end].forEach(function (position) { + var node = position.node, + offset = position.offset; + while (!(node instanceof Text) && node.childNodes.length > 0) { + if (node.childNodes.length > offset) { + node = node.childNodes[offset]; + offset = 0; + } else if (node.childNodes.length === offset) { + node = node.lastChild; + offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; + } else { + break; + } + } + position.node = node, position.offset = offset; + }); + return range; + } + }, { + key: 'rangeToNative', + value: function rangeToNative(range) { + var _this5 = this; + + var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; + var args = []; + var scrollLength = this.scroll.length(); + indexes.forEach(function (index, i) { + index = Math.min(scrollLength - 1, index); + var node = void 0, + _scroll$leaf5 = _this5.scroll.leaf(index), + _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), + leaf = _scroll$leaf6[0], + offset = _scroll$leaf6[1]; + var _leaf$position5 = leaf.position(offset, i !== 0); + + var _leaf$position6 = _slicedToArray(_leaf$position5, 2); + + node = _leaf$position6[0]; + offset = _leaf$position6[1]; + + args.push(node, offset); + }); + if (args.length < 2) { + args = args.concat(args); + } + return args; + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView(scrollingContainer) { + var range = this.lastRange; + if (range == null) return; + var bounds = this.getBounds(range.index, range.length); + if (bounds == null) return; + var limit = this.scroll.length() - 1; + + var _scroll$line = this.scroll.line(Math.min(range.index, limit)), + _scroll$line2 = _slicedToArray(_scroll$line, 1), + first = _scroll$line2[0]; + + var last = first; + if (range.length > 0) { + var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit)); + + var _scroll$line4 = _slicedToArray(_scroll$line3, 1); + + last = _scroll$line4[0]; + } + if (first == null || last == null) return; + var scrollBounds = scrollingContainer.getBoundingClientRect(); + if (bounds.top < scrollBounds.top) { + scrollingContainer.scrollTop -= scrollBounds.top - bounds.top; + } else if (bounds.bottom > scrollBounds.bottom) { + scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom; + } + } + }, { + key: 'setNativeRange', + value: function setNativeRange(startNode, startOffset) { + var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; + var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; + var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); + if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { + return; + } + var selection = document.getSelection(); + if (selection == null) return; + if (startNode != null) { + if (!this.hasFocus()) this.root.focus(); + var native = (this.getNativeRange() || {}).native; + if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) { + + if (startNode.tagName == "BR") { + startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode); + startNode = startNode.parentNode; + } + if (endNode.tagName == "BR") { + endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode); + endNode = endNode.parentNode; + } + var range = document.createRange(); + range.setStart(startNode, startOffset); + range.setEnd(endNode, endOffset); + selection.removeAllRanges(); + selection.addRange(range); + } + } else { + selection.removeAllRanges(); + this.root.blur(); + document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) + } + } + }, { + key: 'setRange', + value: function setRange(range) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + if (typeof force === 'string') { + source = force; + force = false; + } + debug.info('setRange', range); + if (range != null) { + var args = this.rangeToNative(range); + this.setNativeRange.apply(this, _toConsumableArray(args).concat([force])); + } else { + this.setNativeRange(null); + } + this.update(source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var oldRange = this.lastRange; + + var _getRange = this.getRange(), + _getRange2 = _slicedToArray(_getRange, 2), + lastRange = _getRange2[0], + nativeRange = _getRange2[1]; + + this.lastRange = lastRange; + if (this.lastRange != null) { + this.savedRange = this.lastRange; + } + if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { + var _emitter; + + if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { + this.cursor.restore(); + } + var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + } + }]); + + return Selection; +}(); + +function contains(parent, descendant) { + try { + // Firefox inserts inaccessible nodes around video elements + descendant.parentNode; + } catch (e) { + return false; + } + // IE11 has bug with Text nodes + // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect + if (descendant instanceof Text) { + descendant = descendant.parentNode; + } + return parent.contains(descendant); +} + +exports.Range = Range; +exports.default = Selection; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Break = function (_Parchment$Embed) { + _inherits(Break, _Parchment$Embed); + + function Break() { + _classCallCheck(this, Break); + + return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); + } + + _createClass(Break, [{ + key: 'insertInto', + value: function insertInto(parent, ref) { + if (parent.children.length === 0) { + _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); + } else { + this.remove(); + } + } + }, { + key: 'length', + value: function length() { + return 0; + } + }, { + key: 'value', + value: function value() { + return ''; + } + }], [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + return Break; +}(_parchment2.default.Embed); + +Break.blotName = 'break'; +Break.tagName = 'BR'; + +exports.default = Break; + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var linked_list_1 = __webpack_require__(44); +var shadow_1 = __webpack_require__(30); +var Registry = __webpack_require__(1); +var ContainerBlot = /** @class */ (function (_super) { + __extends(ContainerBlot, _super); + function ContainerBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.build(); + return _this; + } + ContainerBlot.prototype.appendChild = function (other) { + this.insertBefore(other); + }; + ContainerBlot.prototype.attach = function () { + _super.prototype.attach.call(this); + this.children.forEach(function (child) { + child.attach(); + }); + }; + ContainerBlot.prototype.build = function () { + var _this = this; + this.children = new linked_list_1.default(); + // Need to be reversed for if DOM nodes already in order + [].slice + .call(this.domNode.childNodes) + .reverse() + .forEach(function (node) { + try { + var child = makeBlot(node); + _this.insertBefore(child, _this.children.head || undefined); + } + catch (err) { + if (err instanceof Registry.ParchmentError) + return; + else + throw err; + } + }); + }; + ContainerBlot.prototype.deleteAt = function (index, length) { + if (index === 0 && length === this.length()) { + return this.remove(); + } + this.children.forEachAt(index, length, function (child, offset, length) { + child.deleteAt(offset, length); + }); + }; + ContainerBlot.prototype.descendant = function (criteria, index) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + return [child, offset]; + } + else if (child instanceof ContainerBlot) { + return child.descendant(criteria, offset); + } + else { + return [null, -1]; + } + }; + ContainerBlot.prototype.descendants = function (criteria, index, length) { + if (index === void 0) { index = 0; } + if (length === void 0) { length = Number.MAX_VALUE; } + var descendants = []; + var lengthLeft = length; + this.children.forEachAt(index, length, function (child, index, length) { + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + descendants.push(child); + } + if (child instanceof ContainerBlot) { + descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); + } + lengthLeft -= length; + }); + return descendants; + }; + ContainerBlot.prototype.detach = function () { + this.children.forEach(function (child) { + child.detach(); + }); + _super.prototype.detach.call(this); + }; + ContainerBlot.prototype.formatAt = function (index, length, name, value) { + this.children.forEachAt(index, length, function (child, offset, length) { + child.formatAt(offset, length, name, value); + }); + }; + ContainerBlot.prototype.insertAt = function (index, value, def) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if (child) { + child.insertAt(offset, value, def); + } + else { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + this.appendChild(blot); + } + }; + ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { + if (this.statics.allowedChildren != null && + !this.statics.allowedChildren.some(function (child) { + return childBlot instanceof child; + })) { + throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); + } + childBlot.insertInto(this, refBlot); + }; + ContainerBlot.prototype.length = function () { + return this.children.reduce(function (memo, child) { + return memo + child.length(); + }, 0); + }; + ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { + this.children.forEach(function (child) { + targetParent.insertBefore(child, refNode); + }); + }; + ContainerBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + if (this.children.length === 0) { + if (this.statics.defaultChild != null) { + var child = Registry.create(this.statics.defaultChild); + this.appendChild(child); + child.optimize(context); + } + else { + this.remove(); + } + } + }; + ContainerBlot.prototype.path = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; + var position = [[this, index]]; + if (child instanceof ContainerBlot) { + return position.concat(child.path(offset, inclusive)); + } + else if (child != null) { + position.push([child, offset]); + } + return position; + }; + ContainerBlot.prototype.removeChild = function (child) { + this.children.remove(child); + }; + ContainerBlot.prototype.replace = function (target) { + if (target instanceof ContainerBlot) { + target.moveChildren(this); + } + _super.prototype.replace.call(this, target); + }; + ContainerBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = this.clone(); + this.parent.insertBefore(after, this.next); + this.children.forEachAt(index, this.length(), function (child, offset, length) { + child = child.split(offset, force); + after.appendChild(child); + }); + return after; + }; + ContainerBlot.prototype.unwrap = function () { + this.moveChildren(this.parent, this.next); + this.remove(); + }; + ContainerBlot.prototype.update = function (mutations, context) { + var _this = this; + var addedNodes = []; + var removedNodes = []; + mutations.forEach(function (mutation) { + if (mutation.target === _this.domNode && mutation.type === 'childList') { + addedNodes.push.apply(addedNodes, mutation.addedNodes); + removedNodes.push.apply(removedNodes, mutation.removedNodes); + } + }); + removedNodes.forEach(function (node) { + // Check node has actually been removed + // One exception is Chrome does not immediately remove IFRAMEs + // from DOM but MutationRecord is correct in its reported removal + if (node.parentNode != null && + // @ts-ignore + node.tagName !== 'IFRAME' && + document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return; + } + var blot = Registry.find(node); + if (blot == null) + return; + if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { + blot.detach(); + } + }); + addedNodes + .filter(function (node) { + return node.parentNode == _this.domNode; + }) + .sort(function (a, b) { + if (a === b) + return 0; + if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { + return 1; + } + return -1; + }) + .forEach(function (node) { + var refBlot = null; + if (node.nextSibling != null) { + refBlot = Registry.find(node.nextSibling); + } + var blot = makeBlot(node); + if (blot.next != refBlot || blot.next == null) { + if (blot.parent != null) { + blot.parent.removeChild(_this); + } + _this.insertBefore(blot, refBlot || undefined); + } + }); + }; + return ContainerBlot; +}(shadow_1.default)); +function makeBlot(node) { + var blot = Registry.find(node); + if (blot == null) { + try { + blot = Registry.create(node); + } + catch (e) { + blot = Registry.create(Registry.Scope.INLINE); + [].slice.call(node.childNodes).forEach(function (child) { + // @ts-ignore + blot.domNode.appendChild(child); + }); + if (node.parentNode) { + node.parentNode.replaceChild(blot.domNode, node); + } + blot.attach(); + } + } + return blot; +} +exports.default = ContainerBlot; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var store_1 = __webpack_require__(31); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var FormatBlot = /** @class */ (function (_super) { + __extends(FormatBlot, _super); + function FormatBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.attributes = new store_1.default(_this.domNode); + return _this; + } + FormatBlot.formats = function (domNode) { + if (typeof this.tagName === 'string') { + return true; + } + else if (Array.isArray(this.tagName)) { + return domNode.tagName.toLowerCase(); + } + return undefined; + }; + FormatBlot.prototype.format = function (name, value) { + var format = Registry.query(name); + if (format instanceof attributor_1.default) { + this.attributes.attribute(format, value); + } + else if (value) { + if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { + this.replaceWith(name, value); + } + } + }; + FormatBlot.prototype.formats = function () { + var formats = this.attributes.values(); + var format = this.statics.formats(this.domNode); + if (format != null) { + formats[this.statics.blotName] = format; + } + return formats; + }; + FormatBlot.prototype.replaceWith = function (name, value) { + var replacement = _super.prototype.replaceWith.call(this, name, value); + this.attributes.copy(replacement); + return replacement; + }; + FormatBlot.prototype.update = function (mutations, context) { + var _this = this; + _super.prototype.update.call(this, mutations, context); + if (mutations.some(function (mutation) { + return mutation.target === _this.domNode && mutation.type === 'attributes'; + })) { + this.attributes.build(); + } + }; + FormatBlot.prototype.wrap = function (name, value) { + var wrapper = _super.prototype.wrap.call(this, name, value); + if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { + this.attributes.move(wrapper); + } + return wrapper; + }; + return FormatBlot; +}(container_1.default)); +exports.default = FormatBlot; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var shadow_1 = __webpack_require__(30); +var Registry = __webpack_require__(1); +var LeafBlot = /** @class */ (function (_super) { + __extends(LeafBlot, _super); + function LeafBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + LeafBlot.value = function (domNode) { + return true; + }; + LeafBlot.prototype.index = function (node, offset) { + if (this.domNode === node || + this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return Math.min(offset, 1); + } + return -1; + }; + LeafBlot.prototype.position = function (index, inclusive) { + var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); + if (index > 0) + offset += 1; + return [this.parent.domNode, offset]; + }; + LeafBlot.prototype.value = function () { + return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a; + var _a; + }; + LeafBlot.scope = Registry.Scope.INLINE_BLOT; + return LeafBlot; +}(shadow_1.default)); +exports.default = LeafBlot; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); + + +var lib = { + attributes: { + compose: function (a, b, keepNull) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = extend(true, {}, b); + if (!keepNull) { + attributes = Object.keys(attributes).reduce(function (copy, key) { + if (attributes[key] != null) { + copy[key] = attributes[key]; + } + return copy; + }, {}); + } + for (var key in a) { + if (a[key] !== undefined && b[key] === undefined) { + attributes[key] = a[key]; + } + } + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + diff: function(a, b) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { + if (!equal(a[key], b[key])) { + attributes[key] = b[key] === undefined ? null : b[key]; + } + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + transform: function (a, b, priority) { + if (typeof a !== 'object') return b; + if (typeof b !== 'object') return undefined; + if (!priority) return b; // b simply overwrites us without priority + var attributes = Object.keys(b).reduce(function (attributes, key) { + if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + } + }, + + iterator: function (ops) { + return new Iterator(ops); + }, + + length: function (op) { + if (typeof op['delete'] === 'number') { + return op['delete']; + } else if (typeof op.retain === 'number') { + return op.retain; + } else { + return typeof op.insert === 'string' ? op.insert.length : 1; + } + } +}; + + +function Iterator(ops) { + this.ops = ops; + this.index = 0; + this.offset = 0; +}; + +Iterator.prototype.hasNext = function () { + return this.peekLength() < Infinity; +}; + +Iterator.prototype.next = function (length) { + if (!length) length = Infinity; + var nextOp = this.ops[this.index]; + if (nextOp) { + var offset = this.offset; + var opLength = lib.length(nextOp) + if (length >= opLength - offset) { + length = opLength - offset; + this.index += 1; + this.offset = 0; + } else { + this.offset += length; + } + if (typeof nextOp['delete'] === 'number') { + return { 'delete': length }; + } else { + var retOp = {}; + if (nextOp.attributes) { + retOp.attributes = nextOp.attributes; + } + if (typeof nextOp.retain === 'number') { + retOp.retain = length; + } else if (typeof nextOp.insert === 'string') { + retOp.insert = nextOp.insert.substr(offset, length); + } else { + // offset should === 0, length should === 1 + retOp.insert = nextOp.insert; + } + return retOp; + } + } else { + return { retain: Infinity }; + } +}; + +Iterator.prototype.peek = function () { + return this.ops[this.index]; +}; + +Iterator.prototype.peekLength = function () { + if (this.ops[this.index]) { + // Should never return 0 if our index is being managed correctly + return lib.length(this.ops[this.index]) - this.offset; + } else { + return Infinity; + } +}; + +Iterator.prototype.peekType = function () { + if (this.ops[this.index]) { + if (typeof this.ops[this.index]['delete'] === 'number') { + return 'delete'; + } else if (typeof this.ops[this.index].retain === 'number') { + return 'retain'; + } else { + return 'insert'; + } + } + return 'retain'; +}; + + +module.exports = lib; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports) { + +var clone = (function() { +'use strict'; + +function _instanceof(obj, type) { + return type != null && obj instanceof type; +} + +var nativeMap; +try { + nativeMap = Map; +} catch(_) { + // maybe a reference error because no `Map`. Give it a dummy value that no + // value will ever be an instanceof. + nativeMap = function() {}; +} + +var nativeSet; +try { + nativeSet = Set; +} catch(_) { + nativeSet = function() {}; +} + +var nativePromise; +try { + nativePromise = Promise; +} catch(_) { + nativePromise = function() {}; +} + +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). + * @param `includeNonEnumerable` - set to true if the non-enumerable properties + * should be cloned as well. Non-enumerable properties on the prototype + * chain will be ignored. (optional - false by default) +*/ +function clone(parent, circular, depth, prototype, includeNonEnumerable) { + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + includeNonEnumerable = circular.includeNonEnumerable; + circular = circular.circular; + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth === 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (_instanceof(parent, nativeMap)) { + child = new nativeMap(); + } else if (_instanceof(parent, nativeSet)) { + child = new nativeSet(); + } else if (_instanceof(parent, nativePromise)) { + child = new nativePromise(function (resolve, reject) { + parent.then(function(value) { + resolve(_clone(value, depth - 1)); + }, function(err) { + reject(_clone(err, depth - 1)); + }); + }); + } else if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + child = new Buffer(parent.length); + parent.copy(child); + return child; + } else if (_instanceof(parent, Error)) { + child = Object.create(parent); + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + if (_instanceof(parent, nativeMap)) { + parent.forEach(function(value, key) { + var keyChild = _clone(key, depth - 1); + var valueChild = _clone(value, depth - 1); + child.set(keyChild, valueChild); + }); + } + if (_instanceof(parent, nativeSet)) { + parent.forEach(function(value) { + var entryChild = _clone(value, depth - 1); + child.add(entryChild); + }); + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(parent); + for (var i = 0; i < symbols.length; i++) { + // Don't need to worry about cloning a symbol because it is a primitive, + // like a number or string. + var symbol = symbols[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, symbol); + if (descriptor && !descriptor.enumerable && !includeNonEnumerable) { + continue; + } + child[symbol] = _clone(parent[symbol], depth - 1); + if (!descriptor.enumerable) { + Object.defineProperty(child, symbol, { + enumerable: false + }); + } + } + } + + if (includeNonEnumerable) { + var allPropertyNames = Object.getOwnPropertyNames(parent); + for (var i = 0; i < allPropertyNames.length; i++) { + var propertyName = allPropertyNames[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName); + if (descriptor && descriptor.enumerable) { + continue; + } + child[propertyName] = _clone(parent[propertyName], depth - 1); + Object.defineProperty(child, propertyName, { + enumerable: false + }); + } + } + + return child; + } + + return _clone(parent, depth); +} + +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); +}; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +} +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +} +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +} +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +} +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +} +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _container = __webpack_require__(25); + +var _container2 = _interopRequireDefault(_container); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function isLine(blot) { + return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; +} + +var Scroll = function (_Parchment$Scroll) { + _inherits(Scroll, _Parchment$Scroll); + + function Scroll(domNode, config) { + _classCallCheck(this, Scroll); + + var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); + + _this.emitter = config.emitter; + if (Array.isArray(config.whitelist)) { + _this.whitelist = config.whitelist.reduce(function (whitelist, format) { + whitelist[format] = true; + return whitelist; + }, {}); + } + // Some reason fixes composition issues with character languages in Windows/Chrome, Safari + _this.domNode.addEventListener('DOMNodeInserted', function () {}); + _this.optimize(); + _this.enable(); + return _this; + } + + _createClass(Scroll, [{ + key: 'batchStart', + value: function batchStart() { + this.batch = true; + } + }, { + key: 'batchEnd', + value: function batchEnd() { + this.batch = false; + this.optimize(); + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + var _line = this.line(index), + _line2 = _slicedToArray(_line, 2), + first = _line2[0], + offset = _line2[1]; + + var _line3 = this.line(index + length), + _line4 = _slicedToArray(_line3, 1), + last = _line4[0]; + + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); + if (last != null && first !== last && offset > 0) { + if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) { + this.optimize(); + return; + } + if (first instanceof _code2.default) { + var newlineIndex = first.newlineIndex(first.length(), true); + if (newlineIndex > -1) { + first = first.split(newlineIndex + 1); + if (first === last) { + this.optimize(); + return; + } + } + } else if (last instanceof _code2.default) { + var _newlineIndex = last.newlineIndex(0); + if (_newlineIndex > -1) { + last.split(_newlineIndex + 1); + } + } + var ref = last.children.head instanceof _break2.default ? null : last.children.head; + first.moveChildren(last, ref); + first.remove(); + } + this.optimize(); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.domNode.setAttribute('contenteditable', enabled); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, format, value) { + if (this.whitelist != null && !this.whitelist[format]) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); + this.optimize(); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null && this.whitelist != null && !this.whitelist[value]) return; + if (index >= this.length()) { + if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { + var blot = _parchment2.default.create(this.statics.defaultChild); + this.appendChild(blot); + if (def == null && value.endsWith('\n')) { + value = value.slice(0, -1); + } + blot.insertAt(0, value, def); + } else { + var embed = _parchment2.default.create(value, def); + this.appendChild(embed); + } + } else { + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); + } + this.optimize(); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { + var wrapper = _parchment2.default.create(this.statics.defaultChild); + wrapper.appendChild(blot); + blot = wrapper; + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); + } + }, { + key: 'leaf', + value: function leaf(index) { + return this.path(index).pop() || [null, -1]; + } + }, { + key: 'line', + value: function line(index) { + if (index === this.length()) { + return this.line(index - 1); + } + return this.descendant(isLine, index); + } + }, { + key: 'lines', + value: function lines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + var getLines = function getLines(blot, index, length) { + var lines = [], + lengthLeft = length; + blot.children.forEachAt(index, length, function (child, index, length) { + if (isLine(child)) { + lines.push(child); + } else if (child instanceof _parchment2.default.Container) { + lines = lines.concat(getLines(child, index, lengthLeft)); + } + lengthLeft -= length; + }); + return lines; + }; + return getLines(this, index, length); + } + }, { + key: 'optimize', + value: function optimize() { + var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (this.batch === true) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context); + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context); + } + } + }, { + key: 'path', + value: function path(index) { + return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self + } + }, { + key: 'update', + value: function update(mutations) { + if (this.batch === true) return; + var source = _emitter2.default.sources.USER; + if (typeof mutations === 'string') { + source = mutations; + } + if (!Array.isArray(mutations)) { + mutations = this.observer.takeRecords(); + } + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); + } + } + }]); + + return Scroll; +}(_parchment2.default.Scroll); + +Scroll.blotName = 'scroll'; +Scroll.className = 'ql-editor'; +Scroll.tagName = 'DIV'; +Scroll.defaultChild = 'block'; +Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; + +exports.default = Scroll; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SHORTKEY = exports.default = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:keyboard'); + +var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; + +var Keyboard = function (_Module) { + _inherits(Keyboard, _Module); + + _createClass(Keyboard, null, [{ + key: 'match', + value: function match(evt, binding) { + binding = normalize(binding); + if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { + return !!binding[key] !== evt[key] && binding[key] !== null; + })) { + return false; + } + return binding.key === (evt.which || evt.keyCode); + } + }]); + + function Keyboard(quill, options) { + _classCallCheck(this, Keyboard); + + var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); + + _this.bindings = {}; + Object.keys(_this.options.bindings).forEach(function (name) { + if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) { + return; + } + if (_this.options.bindings[name]) { + _this.addBinding(_this.options.bindings[name]); + } + }); + _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); + _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); + if (/Firefox/i.test(navigator.userAgent)) { + // Need to handle delete and backspace for Firefox in the general case #1171 + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete); + } else { + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete); + } + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace); + _this.listen(); + return _this; + } + + _createClass(Keyboard, [{ + key: 'addBinding', + value: function addBinding(key) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var binding = normalize(key); + if (binding == null || binding.key == null) { + return debug.warn('Attempted to add invalid keyboard binding', binding); + } + if (typeof context === 'function') { + context = { handler: context }; + } + if (typeof handler === 'function') { + handler = { handler: handler }; + } + binding = (0, _extend2.default)(binding, context, handler); + this.bindings[binding.key] = this.bindings[binding.key] || []; + this.bindings[binding.key].push(binding); + } + }, { + key: 'listen', + value: function listen() { + var _this2 = this; + + this.quill.root.addEventListener('keydown', function (evt) { + if (evt.defaultPrevented) return; + var which = evt.which || evt.keyCode; + var bindings = (_this2.bindings[which] || []).filter(function (binding) { + return Keyboard.match(evt, binding); + }); + if (bindings.length === 0) return; + var range = _this2.quill.getSelection(); + if (range == null || !_this2.quill.hasFocus()) return; + + var _quill$getLine = _this2.quill.getLine(range.index), + _quill$getLine2 = _slicedToArray(_quill$getLine, 2), + line = _quill$getLine2[0], + offset = _quill$getLine2[1]; + + var _quill$getLeaf = _this2.quill.getLeaf(range.index), + _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), + leafStart = _quill$getLeaf2[0], + offsetStart = _quill$getLeaf2[1]; + + var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), + _ref2 = _slicedToArray(_ref, 2), + leafEnd = _ref2[0], + offsetEnd = _ref2[1]; + + var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; + var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; + var curContext = { + collapsed: range.length === 0, + empty: range.length === 0 && line.length() <= 1, + format: _this2.quill.getFormat(range), + offset: offset, + prefix: prefixText, + suffix: suffixText + }; + var prevented = bindings.some(function (binding) { + if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; + if (binding.empty != null && binding.empty !== curContext.empty) return false; + if (binding.offset != null && binding.offset !== curContext.offset) return false; + if (Array.isArray(binding.format)) { + // any format is present + if (binding.format.every(function (name) { + return curContext.format[name] == null; + })) { + return false; + } + } else if (_typeof(binding.format) === 'object') { + // all formats must match + if (!Object.keys(binding.format).every(function (name) { + if (binding.format[name] === true) return curContext.format[name] != null; + if (binding.format[name] === false) return curContext.format[name] == null; + return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); + })) { + return false; + } + } + if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; + if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; + return binding.handler.call(_this2, range, curContext) !== true; + }); + if (prevented) { + evt.preventDefault(); + } + }); + } + }]); + + return Keyboard; +}(_module2.default); + +Keyboard.keys = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + ESCAPE: 27, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46 +}; + +Keyboard.DEFAULTS = { + bindings: { + 'bold': makeFormatHandler('bold'), + 'italic': makeFormatHandler('italic'), + 'underline': makeFormatHandler('underline'), + 'indent': { + // highlight tab or tab at beginning of list, indent or blockquote + key: Keyboard.keys.TAB, + format: ['blockquote', 'indent', 'list'], + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '+1', _quill2.default.sources.USER); + } + }, + 'outdent': { + key: Keyboard.keys.TAB, + shiftKey: true, + format: ['blockquote', 'indent', 'list'], + // highlight tab or tab at beginning of list, indent or blockquote + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } + }, + 'outdent backspace': { + key: Keyboard.keys.BACKSPACE, + collapsed: true, + shiftKey: null, + metaKey: null, + ctrlKey: null, + altKey: null, + format: ['indent', 'list'], + offset: 0, + handler: function handler(range, context) { + if (context.format.indent != null) { + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } else if (context.format.list != null) { + this.quill.format('list', false, _quill2.default.sources.USER); + } + } + }, + 'indent code-block': makeCodeBlockHandler(true), + 'outdent code-block': makeCodeBlockHandler(false), + 'remove tab': { + key: Keyboard.keys.TAB, + shiftKey: true, + collapsed: true, + prefix: /\t$/, + handler: function handler(range) { + this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); + } + }, + 'tab': { + key: Keyboard.keys.TAB, + handler: function handler(range) { + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\t'); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + } + }, + 'list empty enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['list'], + empty: true, + handler: function handler(range, context) { + this.quill.format('list', false, _quill2.default.sources.USER); + if (context.format.indent) { + this.quill.format('indent', false, _quill2.default.sources.USER); + } + } + }, + 'checklist enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: { list: 'checked' }, + handler: function handler(range) { + var _quill$getLine3 = this.quill.getLine(range.index), + _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), + line = _quill$getLine4[0], + offset = _quill$getLine4[1]; + + var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' }); + var delta = new _quillDelta2.default().retain(range.index).insert('\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'header enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['header'], + suffix: /^$/, + handler: function handler(range, context) { + var _quill$getLine5 = this.quill.getLine(range.index), + _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), + line = _quill$getLine6[0], + offset = _quill$getLine6[1]; + + var delta = new _quillDelta2.default().retain(range.index).insert('\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'list autofill': { + key: ' ', + collapsed: true, + format: { list: false }, + prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/, + handler: function handler(range, context) { + var length = context.prefix.length; + + var _quill$getLine7 = this.quill.getLine(range.index), + _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), + line = _quill$getLine8[0], + offset = _quill$getLine8[1]; + + if (offset > length) return true; + var value = void 0; + switch (context.prefix.trim()) { + case '[]':case '[ ]': + value = 'unchecked'; + break; + case '[x]': + value = 'checked'; + break; + case '-':case '*': + value = 'bullet'; + break; + default: + value = 'ordered'; + } + this.quill.insertText(range.index, ' ', _quill2.default.sources.USER); + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); + } + }, + 'code exit': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['code-block'], + prefix: /\n\n$/, + suffix: /^\s+$/, + handler: function handler(range) { + var _quill$getLine9 = this.quill.getLine(range.index), + _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), + line = _quill$getLine10[0], + offset = _quill$getLine10[1]; + + var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1); + this.quill.updateContents(delta, _quill2.default.sources.USER); + } + }, + 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false), + 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true), + 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false), + 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true) + } +}; + +function makeEmbedArrowHandler(key, shiftKey) { + var _ref3; + + var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix'; + return _ref3 = { + key: key, + shiftKey: shiftKey, + altKey: null + }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) { + var index = range.index; + if (key === Keyboard.keys.RIGHT) { + index += range.length + 1; + } + + var _quill$getLeaf3 = this.quill.getLeaf(index), + _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), + leaf = _quill$getLeaf4[0]; + + if (!(leaf instanceof _parchment2.default.Embed)) return true; + if (key === Keyboard.keys.LEFT) { + if (shiftKey) { + this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index - 1, _quill2.default.sources.USER); + } + } else { + if (shiftKey) { + this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER); + } + } + return false; + }), _ref3; +} + +function handleBackspace(range, context) { + if (range.index === 0 || this.quill.getLength() <= 1) return; + + var _quill$getLine11 = this.quill.getLine(range.index), + _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), + line = _quill$getLine12[0]; + + var formats = {}; + if (context.offset === 0) { + var _quill$getLine13 = this.quill.getLine(range.index - 1), + _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), + prev = _quill$getLine14[0]; + + if (prev != null && prev.length() > 1) { + var curFormats = line.formats(); + var prevFormats = this.quill.getFormat(range.index - 1, 1); + formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; + } + } + // Check for astral symbols + var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1; + this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER); + } + this.quill.focus(); +} + +function handleDelete(range, context) { + // Check for astral symbols + var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1; + if (range.index >= this.quill.getLength() - length) return; + var formats = {}, + nextLength = 0; + + var _quill$getLine15 = this.quill.getLine(range.index), + _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), + line = _quill$getLine16[0]; + + if (context.offset >= line.length() - 1) { + var _quill$getLine17 = this.quill.getLine(range.index + 1), + _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), + next = _quill$getLine18[0]; + + if (next) { + var curFormats = line.formats(); + var nextFormats = this.quill.getFormat(range.index, 1); + formats = _op2.default.attributes.diff(curFormats, nextFormats) || {}; + nextLength = next.length(); + } + } + this.quill.deleteText(range.index, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER); + } +} + +function handleDeleteRange(range) { + var lines = this.quill.getLines(range); + var formats = {}; + if (lines.length > 1) { + var firstFormats = lines[0].formats(); + var lastFormats = lines[lines.length - 1].formats(); + formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {}; + } + this.quill.deleteText(range, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER); + } + this.quill.setSelection(range.index, _quill2.default.sources.SILENT); + this.quill.focus(); +} + +function handleEnter(range, context) { + var _this3 = this; + + if (range.length > 0) { + this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change + } + var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { + if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { + lineFormats[format] = context.format[format]; + } + return lineFormats; + }, {}); + this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); + // Earlier scroll.deleteAt might have messed up our selection, + // so insertText's built in selection preservation is not reliable + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.focus(); + Object.keys(context.format).forEach(function (name) { + if (lineFormats[name] != null) return; + if (Array.isArray(context.format[name])) return; + if (name === 'link') return; + _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); + }); +} + +function makeCodeBlockHandler(indent) { + return { + key: Keyboard.keys.TAB, + shiftKey: !indent, + format: { 'code-block': true }, + handler: function handler(range) { + var CodeBlock = _parchment2.default.query('code-block'); + var index = range.index, + length = range.length; + + var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + block = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (block == null) return; + var scrollIndex = this.quill.getIndex(block); + var start = block.newlineIndex(offset, true) + 1; + var end = block.newlineIndex(scrollIndex + offset + length); + var lines = block.domNode.textContent.slice(start, end).split('\n'); + offset = 0; + lines.forEach(function (line, i) { + if (indent) { + block.insertAt(start + offset, CodeBlock.TAB); + offset += CodeBlock.TAB.length; + if (i === 0) { + index += CodeBlock.TAB.length; + } else { + length += CodeBlock.TAB.length; + } + } else if (line.startsWith(CodeBlock.TAB)) { + block.deleteAt(start + offset, CodeBlock.TAB.length); + offset -= CodeBlock.TAB.length; + if (i === 0) { + index -= CodeBlock.TAB.length; + } else { + length -= CodeBlock.TAB.length; + } + } + offset += line.length + 1; + }); + this.quill.update(_quill2.default.sources.USER); + this.quill.setSelection(index, length, _quill2.default.sources.SILENT); + } + }; +} + +function makeFormatHandler(format) { + return { + key: format[0].toUpperCase(), + shortKey: true, + handler: function handler(range, context) { + this.quill.format(format, !context.format[format], _quill2.default.sources.USER); + } + }; +} + +function normalize(binding) { + if (typeof binding === 'string' || typeof binding === 'number') { + return normalize({ key: binding }); + } + if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { + binding = (0, _clone2.default)(binding, false); + } + if (typeof binding.key === 'string') { + if (Keyboard.keys[binding.key.toUpperCase()] != null) { + binding.key = Keyboard.keys[binding.key.toUpperCase()]; + } else if (binding.key.length === 1) { + binding.key = binding.key.toUpperCase().charCodeAt(0); + } else { + return null; + } + } + if (binding.shortKey) { + binding[SHORTKEY] = binding.shortKey; + delete binding.shortKey; + } + return binding; +} + +exports.default = Keyboard; +exports.SHORTKEY = SHORTKEY; + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Cursor = function (_Parchment$Embed) { + _inherits(Cursor, _Parchment$Embed); + + _createClass(Cursor, null, [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + function Cursor(domNode, selection) { + _classCallCheck(this, Cursor); + + var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); + + _this.selection = selection; + _this.textNode = document.createTextNode(Cursor.CONTENTS); + _this.domNode.appendChild(_this.textNode); + _this._length = 0; + return _this; + } + + _createClass(Cursor, [{ + key: 'detach', + value: function detach() { + // super.detach() will also clear domNode.__blot + if (this.parent != null) this.parent.removeChild(this); + } + }, { + key: 'format', + value: function format(name, value) { + if (this._length !== 0) { + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); + } + var target = this, + index = 0; + while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { + index += target.offset(target.parent); + target = target.parent; + } + if (target != null) { + this._length = Cursor.CONTENTS.length; + target.optimize(); + target.formatAt(index, Cursor.CONTENTS.length, name, value); + this._length = 0; + } + } + }, { + key: 'index', + value: function index(node, offset) { + if (node === this.textNode) return 0; + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'length', + value: function length() { + return this._length; + } + }, { + key: 'position', + value: function position() { + return [this.textNode, this.textNode.data.length]; + } + }, { + key: 'remove', + value: function remove() { + _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); + this.parent = null; + } + }, { + key: 'restore', + value: function restore() { + if (this.selection.composing || this.parent == null) return; + var textNode = this.textNode; + var range = this.selection.getNativeRange(); + var restoreText = void 0, + start = void 0, + end = void 0; + if (range != null && range.start.node === textNode && range.end.node === textNode) { + var _ref = [textNode, range.start.offset, range.end.offset]; + restoreText = _ref[0]; + start = _ref[1]; + end = _ref[2]; + } + // Link format will insert text outside of anchor tag + while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { + this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); + } + if (this.textNode.data !== Cursor.CONTENTS) { + var text = this.textNode.data.split(Cursor.CONTENTS).join(''); + if (this.next instanceof _text2.default) { + restoreText = this.next.domNode; + this.next.insertAt(0, text); + this.textNode.data = Cursor.CONTENTS; + } else { + this.textNode.data = text; + this.parent.insertBefore(_parchment2.default.create(this.textNode), this); + this.textNode = document.createTextNode(Cursor.CONTENTS); + this.domNode.appendChild(this.textNode); + } + } + this.remove(); + if (start != null) { + var _map = [start, end].map(function (offset) { + return Math.max(0, Math.min(restoreText.data.length, offset - 1)); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + + return { + startNode: restoreText, + startOffset: start, + endNode: restoreText, + endOffset: end + }; + } + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this2.textNode; + })) { + var range = this.restore(); + if (range) context.range = range; + } + } + }, { + key: 'value', + value: function value() { + return ''; + } + }]); + + return Cursor; +}(_parchment2.default.Embed); + +Cursor.blotName = 'cursor'; +Cursor.className = 'ql-cursor'; +Cursor.tagName = 'span'; +Cursor.CONTENTS = '\uFEFF'; // Zero width no break space + + +exports.default = Cursor; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Container = function (_Parchment$Container) { + _inherits(Container, _Parchment$Container); + + function Container() { + _classCallCheck(this, Container); + + return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); + } + + return Container; +}(_parchment2.default.Container); + +Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; + +exports.default = Container; + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ColorAttributor = function (_Parchment$Attributor) { + _inherits(ColorAttributor, _Parchment$Attributor); + + function ColorAttributor() { + _classCallCheck(this, ColorAttributor); + + return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); + } + + _createClass(ColorAttributor, [{ + key: 'value', + value: function value(domNode) { + var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); + if (!value.startsWith('rgb(')) return value; + value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); + return '#' + value.split(',').map(function (component) { + return ('00' + parseInt(component).toString(16)).slice(-2); + }).join(''); + } + }]); + + return ColorAttributor; +}(_parchment2.default.Attributor.Style); + +var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { + scope: _parchment2.default.Scope.INLINE +}); +var ColorStyle = new ColorAttributor('color', 'color', { + scope: _parchment2.default.Scope.INLINE +}); + +exports.ColorAttributor = ColorAttributor; +exports.ColorClass = ColorClass; +exports.ColorStyle = ColorStyle; + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sanitize = exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Link = function (_Inline) { + _inherits(Link, _Inline); + + function Link() { + _classCallCheck(this, Link); + + return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments)); + } + + _createClass(Link, [{ + key: 'format', + value: function format(name, value) { + if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value); + value = this.constructor.sanitize(value); + this.domNode.setAttribute('href', value); + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value); + value = this.sanitize(value); + node.setAttribute('href', value); + node.setAttribute('target', '_blank'); + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return domNode.getAttribute('href'); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL; + } + }]); + + return Link; +}(_inline2.default); + +Link.blotName = 'link'; +Link.tagName = 'A'; +Link.SANITIZED_URL = 'about:blank'; +Link.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel']; + +function _sanitize(url, protocols) { + var anchor = document.createElement('a'); + anchor.href = url; + var protocol = anchor.href.slice(0, anchor.href.indexOf(':')); + return protocols.indexOf(protocol) > -1; +} + +exports.default = Link; +exports.sanitize = _sanitize; + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _keyboard = __webpack_require__(23); + +var _keyboard2 = _interopRequireDefault(_keyboard); + +var _dropdown = __webpack_require__(107); + +var _dropdown2 = _interopRequireDefault(_dropdown); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var optionsCounter = 0; + +function toggleAriaAttribute(element, attribute) { + element.setAttribute(attribute, !(element.getAttribute(attribute) === 'true')); +} + +var Picker = function () { + function Picker(select) { + var _this = this; + + _classCallCheck(this, Picker); + + 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', function () { + _this.togglePicker(); + }); + this.label.addEventListener('keydown', function (event) { + switch (event.keyCode) { + // Allows the "Enter" key to open the picker + case _keyboard2.default.keys.ENTER: + _this.togglePicker(); + break; + + // Allows the "Escape" key to close the picker + case _keyboard2.default.keys.ESCAPE: + _this.escape(); + event.preventDefault(); + break; + default: + } + }); + this.select.addEventListener('change', this.update.bind(this)); + } + + _createClass(Picker, [{ + key: 'togglePicker', + value: function togglePicker() { + this.container.classList.toggle('ql-expanded'); + // Toggle aria-expanded and aria-hidden to make the picker accessible + toggleAriaAttribute(this.label, 'aria-expanded'); + toggleAriaAttribute(this.options, 'aria-hidden'); + } + }, { + key: 'buildItem', + value: function buildItem(option) { + var _this2 = this; + + var item = document.createElement('span'); + item.tabIndex = '0'; + item.setAttribute('role', 'button'); + + item.classList.add('ql-picker-item'); + if (option.hasAttribute('value')) { + item.setAttribute('data-value', option.getAttribute('value')); + } + if (option.textContent) { + item.setAttribute('data-label', option.textContent); + } + item.addEventListener('click', function () { + _this2.selectItem(item, true); + }); + item.addEventListener('keydown', function (event) { + switch (event.keyCode) { + // Allows the "Enter" key to select an item + case _keyboard2.default.keys.ENTER: + _this2.selectItem(item, true); + event.preventDefault(); + break; + + // Allows the "Escape" key to close the picker + case _keyboard2.default.keys.ESCAPE: + _this2.escape(); + event.preventDefault(); + break; + default: + } + }); + + return item; + } + }, { + key: 'buildLabel', + value: function buildLabel() { + var label = document.createElement('span'); + label.classList.add('ql-picker-label'); + label.innerHTML = _dropdown2.default; + label.tabIndex = '0'; + label.setAttribute('role', 'button'); + label.setAttribute('aria-expanded', 'false'); + this.container.appendChild(label); + return label; + } + }, { + key: 'buildOptions', + value: function buildOptions() { + var _this3 = this; + + var options = document.createElement('span'); + options.classList.add('ql-picker-options'); + + // Don't want screen readers to read this until options are visible + options.setAttribute('aria-hidden', 'true'); + options.tabIndex = '-1'; + + // Need a unique id for aria-controls + options.id = 'ql-picker-options-' + optionsCounter; + optionsCounter += 1; + this.label.setAttribute('aria-controls', options.id); + + this.options = options; + + [].slice.call(this.select.options).forEach(function (option) { + var item = _this3.buildItem(option); + options.appendChild(item); + if (option.selected === true) { + _this3.selectItem(item); + } + }); + this.container.appendChild(options); + } + }, { + key: 'buildPicker', + value: function buildPicker() { + var _this4 = this; + + [].slice.call(this.select.attributes).forEach(function (item) { + _this4.container.setAttribute(item.name, item.value); + }); + this.container.classList.add('ql-picker'); + this.label = this.buildLabel(); + this.buildOptions(); + } + }, { + key: 'escape', + value: function escape() { + var _this5 = this; + + // Close menu and return focus to trigger label + this.close(); + // Need setTimeout for accessibility to ensure that the browser executes + // focus on the next process thread and after any DOM content changes + setTimeout(function () { + return _this5.label.focus(); + }, 1); + } + }, { + key: 'close', + value: function close() { + this.container.classList.remove('ql-expanded'); + this.label.setAttribute('aria-expanded', 'false'); + this.options.setAttribute('aria-hidden', 'true'); + } + }, { + key: 'selectItem', + value: function selectItem(item) { + var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var selected = this.container.querySelector('.ql-selected'); + if (item === selected) return; + if (selected != null) { + selected.classList.remove('ql-selected'); + } + if (item == null) return; + item.classList.add('ql-selected'); + this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item); + if (item.hasAttribute('data-value')) { + this.label.setAttribute('data-value', item.getAttribute('data-value')); + } else { + this.label.removeAttribute('data-value'); + } + if (item.hasAttribute('data-label')) { + this.label.setAttribute('data-label', item.getAttribute('data-label')); + } else { + this.label.removeAttribute('data-label'); + } + if (trigger) { + if (typeof Event === 'function') { + this.select.dispatchEvent(new Event('change')); + } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') { + // IE11 + var event = document.createEvent('Event'); + event.initEvent('change', true, true); + this.select.dispatchEvent(event); + } + this.close(); + } + } + }, { + key: 'update', + value: function update() { + var option = void 0; + if (this.select.selectedIndex > -1) { + var 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); + } + var isActive = option != null && option !== this.select.querySelector('option[selected]'); + this.label.classList.toggle('ql-active', isActive); + } + }]); + + return Picker; +}(); + +exports.default = Picker; + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _container = __webpack_require__(25); + +var _container2 = _interopRequireDefault(_container); + +var _cursor = __webpack_require__(24); + +var _cursor2 = _interopRequireDefault(_cursor); + +var _embed = __webpack_require__(35); + +var _embed2 = _interopRequireDefault(_embed); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _scroll = __webpack_require__(22); + +var _scroll2 = _interopRequireDefault(_scroll); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +var _clipboard = __webpack_require__(55); + +var _clipboard2 = _interopRequireDefault(_clipboard); + +var _history = __webpack_require__(42); + +var _history2 = _interopRequireDefault(_history); + +var _keyboard = __webpack_require__(23); + +var _keyboard2 = _interopRequireDefault(_keyboard); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_quill2.default.register({ + 'blots/block': _block2.default, + 'blots/block/embed': _block.BlockEmbed, + 'blots/break': _break2.default, + 'blots/container': _container2.default, + 'blots/cursor': _cursor2.default, + 'blots/embed': _embed2.default, + 'blots/inline': _inline2.default, + 'blots/scroll': _scroll2.default, + 'blots/text': _text2.default, + + 'modules/clipboard': _clipboard2.default, + 'modules/history': _history2.default, + 'modules/keyboard': _keyboard2.default +}); + +_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); + +exports.default = _quill2.default; + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var ShadowBlot = /** @class */ (function () { + function ShadowBlot(domNode) { + this.domNode = domNode; + // @ts-ignore + this.domNode[Registry.DATA_KEY] = { blot: this }; + } + Object.defineProperty(ShadowBlot.prototype, "statics", { + // Hack for accessing inherited static methods + get: function () { + return this.constructor; + }, + enumerable: true, + configurable: true + }); + ShadowBlot.create = function (value) { + if (this.tagName == null) { + throw new Registry.ParchmentError('Blot definition missing tagName'); + } + var node; + if (Array.isArray(this.tagName)) { + if (typeof value === 'string') { + value = value.toUpperCase(); + if (parseInt(value).toString() === value) { + value = parseInt(value); + } + } + if (typeof value === 'number') { + node = document.createElement(this.tagName[value - 1]); + } + else if (this.tagName.indexOf(value) > -1) { + node = document.createElement(value); + } + else { + node = document.createElement(this.tagName[0]); + } + } + else { + node = document.createElement(this.tagName); + } + if (this.className) { + node.classList.add(this.className); + } + return node; + }; + ShadowBlot.prototype.attach = function () { + if (this.parent != null) { + this.scroll = this.parent.scroll; + } + }; + ShadowBlot.prototype.clone = function () { + var domNode = this.domNode.cloneNode(false); + return Registry.create(domNode); + }; + ShadowBlot.prototype.detach = function () { + if (this.parent != null) + this.parent.removeChild(this); + // @ts-ignore + delete this.domNode[Registry.DATA_KEY]; + }; + ShadowBlot.prototype.deleteAt = function (index, length) { + var blot = this.isolate(index, length); + blot.remove(); + }; + ShadowBlot.prototype.formatAt = function (index, length, name, value) { + var blot = this.isolate(index, length); + if (Registry.query(name, Registry.Scope.BLOT) != null && value) { + blot.wrap(name, value); + } + else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { + var parent = Registry.create(this.statics.scope); + blot.wrap(parent); + parent.format(name, value); + } + }; + ShadowBlot.prototype.insertAt = function (index, value, def) { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + var ref = this.split(index); + this.parent.insertBefore(blot, ref); + }; + ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { + if (refBlot === void 0) { refBlot = null; } + if (this.parent != null) { + this.parent.children.remove(this); + } + var refDomNode = null; + parentBlot.children.insertBefore(this, refBlot); + if (refBlot != null) { + refDomNode = refBlot.domNode; + } + if (this.domNode.parentNode != parentBlot.domNode || + this.domNode.nextSibling != refDomNode) { + parentBlot.domNode.insertBefore(this.domNode, refDomNode); + } + this.parent = parentBlot; + this.attach(); + }; + ShadowBlot.prototype.isolate = function (index, length) { + var target = this.split(index); + target.split(length); + return target; + }; + ShadowBlot.prototype.length = function () { + return 1; + }; + ShadowBlot.prototype.offset = function (root) { + if (root === void 0) { root = this.parent; } + if (this.parent == null || this == root) + return 0; + return this.parent.children.offset(this) + this.parent.offset(root); + }; + ShadowBlot.prototype.optimize = function (context) { + // TODO clean up once we use WeakMap + // @ts-ignore + if (this.domNode[Registry.DATA_KEY] != null) { + // @ts-ignore + delete this.domNode[Registry.DATA_KEY].mutations; + } + }; + ShadowBlot.prototype.remove = function () { + if (this.domNode.parentNode != null) { + this.domNode.parentNode.removeChild(this.domNode); + } + this.detach(); + }; + ShadowBlot.prototype.replace = function (target) { + if (target.parent == null) + return; + target.parent.insertBefore(this, target.next); + target.remove(); + }; + ShadowBlot.prototype.replaceWith = function (name, value) { + var replacement = typeof name === 'string' ? Registry.create(name, value) : name; + replacement.replace(this); + return replacement; + }; + ShadowBlot.prototype.split = function (index, force) { + return index === 0 ? this : this.next; + }; + ShadowBlot.prototype.update = function (mutations, context) { + // Nothing to do by default + }; + ShadowBlot.prototype.wrap = function (name, value) { + var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; + if (this.parent != null) { + this.parent.insertBefore(wrapper, this.next); + } + wrapper.appendChild(this); + return wrapper; + }; + ShadowBlot.blotName = 'abstract'; + return ShadowBlot; +}()); +exports.default = ShadowBlot; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(32); +var style_1 = __webpack_require__(33); +var Registry = __webpack_require__(1); +var AttributorStore = /** @class */ (function () { + function AttributorStore(domNode) { + this.attributes = {}; + this.domNode = domNode; + this.build(); + } + AttributorStore.prototype.attribute = function (attribute, value) { + // verb + if (value) { + if (attribute.add(this.domNode, value)) { + if (attribute.value(this.domNode) != null) { + this.attributes[attribute.attrName] = attribute; + } + else { + delete this.attributes[attribute.attrName]; + } + } + } + else { + attribute.remove(this.domNode); + delete this.attributes[attribute.attrName]; + } + }; + AttributorStore.prototype.build = function () { + var _this = this; + this.attributes = {}; + var attributes = attributor_1.default.keys(this.domNode); + var classes = class_1.default.keys(this.domNode); + var styles = style_1.default.keys(this.domNode); + attributes + .concat(classes) + .concat(styles) + .forEach(function (name) { + var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); + if (attr instanceof attributor_1.default) { + _this.attributes[attr.attrName] = attr; + } + }); + }; + AttributorStore.prototype.copy = function (target) { + var _this = this; + Object.keys(this.attributes).forEach(function (key) { + var value = _this.attributes[key].value(_this.domNode); + target.format(key, value); + }); + }; + AttributorStore.prototype.move = function (target) { + var _this = this; + this.copy(target); + Object.keys(this.attributes).forEach(function (key) { + _this.attributes[key].remove(_this.domNode); + }); + this.attributes = {}; + }; + AttributorStore.prototype.values = function () { + var _this = this; + return Object.keys(this.attributes).reduce(function (attributes, name) { + attributes[name] = _this.attributes[name].value(_this.domNode); + return attributes; + }, {}); + }; + return AttributorStore; +}()); +exports.default = AttributorStore; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function match(node, prefix) { + var className = node.getAttribute('class') || ''; + return className.split(/\s+/).filter(function (name) { + return name.indexOf(prefix + "-") === 0; + }); +} +var ClassAttributor = /** @class */ (function (_super) { + __extends(ClassAttributor, _super); + function ClassAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + ClassAttributor.keys = function (node) { + return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { + return name + .split('-') + .slice(0, -1) + .join('-'); + }); + }; + ClassAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + this.remove(node); + node.classList.add(this.keyName + "-" + value); + return true; + }; + ClassAttributor.prototype.remove = function (node) { + var matches = match(node, this.keyName); + matches.forEach(function (name) { + node.classList.remove(name); + }); + if (node.classList.length === 0) { + node.removeAttribute('class'); + } + }; + ClassAttributor.prototype.value = function (node) { + var result = match(node, this.keyName)[0] || ''; + var value = result.slice(this.keyName.length + 1); // +1 for hyphen + return this.canAdd(node, value) ? value : ''; + }; + return ClassAttributor; +}(attributor_1.default)); +exports.default = ClassAttributor; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function camelize(name) { + var parts = name.split('-'); + var rest = parts + .slice(1) + .map(function (part) { + return part[0].toUpperCase() + part.slice(1); + }) + .join(''); + return parts[0] + rest; +} +var StyleAttributor = /** @class */ (function (_super) { + __extends(StyleAttributor, _super); + function StyleAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + StyleAttributor.keys = function (node) { + return (node.getAttribute('style') || '').split(';').map(function (value) { + var arr = value.split(':'); + return arr[0].trim(); + }); + }; + StyleAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + // @ts-ignore + node.style[camelize(this.keyName)] = value; + return true; + }; + StyleAttributor.prototype.remove = function (node) { + // @ts-ignore + node.style[camelize(this.keyName)] = ''; + if (!node.getAttribute('style')) { + node.removeAttribute('style'); + } + }; + StyleAttributor.prototype.value = function (node) { + // @ts-ignore + var value = node.style[camelize(this.keyName)]; + return this.canAdd(node, value) ? value : ''; + }; + return StyleAttributor; +}(attributor_1.default)); +exports.default = StyleAttributor; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Theme = function () { + function Theme(quill, options) { + _classCallCheck(this, Theme); + + this.quill = quill; + this.options = options; + this.modules = {}; + } + + _createClass(Theme, [{ + key: 'init', + value: function init() { + var _this = this; + + Object.keys(this.options.modules).forEach(function (name) { + if (_this.modules[name] == null) { + _this.addModule(name); + } + }); + } + }, { + key: 'addModule', + value: function addModule(name) { + var moduleClass = this.quill.constructor.import('modules/' + name); + this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); + return this.modules[name]; + } + }]); + + return Theme; +}(); + +Theme.DEFAULTS = { + modules: {} +}; +Theme.themes = { + 'default': Theme +}; + +exports.default = Theme; + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var GUARD_TEXT = '\uFEFF'; + +var Embed = function (_Parchment$Embed) { + _inherits(Embed, _Parchment$Embed); + + function Embed(node) { + _classCallCheck(this, Embed); + + var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node)); + + _this.contentNode = document.createElement('span'); + _this.contentNode.setAttribute('contenteditable', false); + [].slice.call(_this.domNode.childNodes).forEach(function (childNode) { + _this.contentNode.appendChild(childNode); + }); + _this.leftGuard = document.createTextNode(GUARD_TEXT); + _this.rightGuard = document.createTextNode(GUARD_TEXT); + _this.domNode.appendChild(_this.leftGuard); + _this.domNode.appendChild(_this.contentNode); + _this.domNode.appendChild(_this.rightGuard); + return _this; + } + + _createClass(Embed, [{ + key: 'index', + value: function index(node, offset) { + if (node === this.leftGuard) return 0; + if (node === this.rightGuard) return 1; + return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'restore', + value: function restore(node) { + var range = void 0, + textNode = void 0; + var text = node.data.split(GUARD_TEXT).join(''); + if (node === this.leftGuard) { + if (this.prev instanceof _text2.default) { + var prevLength = this.prev.length(); + this.prev.insertAt(prevLength, text); + range = { + startNode: this.prev.domNode, + startOffset: prevLength + text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } else if (node === this.rightGuard) { + if (this.next instanceof _text2.default) { + this.next.insertAt(0, text); + range = { + startNode: this.next.domNode, + startOffset: text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this.next); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } + node.data = GUARD_TEXT; + return range; + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + mutations.forEach(function (mutation) { + if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) { + var range = _this2.restore(mutation.target); + if (range) context.range = range; + } + }); + } + }]); + + return Embed; +}(_parchment2.default.Embed); + +exports.default = Embed; + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['right', 'center', 'justify'] +}; + +var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); +var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); +var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); + +exports.AlignAttribute = AlignAttribute; +exports.AlignClass = AlignClass; +exports.AlignStyle = AlignStyle; + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BackgroundStyle = exports.BackgroundClass = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _color = __webpack_require__(26); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { + scope: _parchment2.default.Scope.INLINE +}); +var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { + scope: _parchment2.default.Scope.INLINE +}); + +exports.BackgroundClass = BackgroundClass; +exports.BackgroundStyle = BackgroundStyle; + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['rtl'] +}; + +var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); +var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); +var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); + +exports.DirectionAttribute = DirectionAttribute; +exports.DirectionClass = DirectionClass; +exports.DirectionStyle = DirectionStyle; + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FontClass = exports.FontStyle = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var config = { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['serif', 'monospace'] +}; + +var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); + +var FontStyleAttributor = function (_Parchment$Attributor) { + _inherits(FontStyleAttributor, _Parchment$Attributor); + + function FontStyleAttributor() { + _classCallCheck(this, FontStyleAttributor); + + return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); + } + + _createClass(FontStyleAttributor, [{ + key: 'value', + value: function value(node) { + return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); + } + }]); + + return FontStyleAttributor; +}(_parchment2.default.Attributor.Style); + +var FontStyle = new FontStyleAttributor('font', 'font-family', config); + +exports.FontStyle = FontStyle; +exports.FontClass = FontClass; + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SizeStyle = exports.SizeClass = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['small', 'large', 'huge'] +}); +var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['10px', '18px', '32px'] +}); + +exports.SizeClass = SizeClass; +exports.SizeStyle = SizeStyle; + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + 'align': { + '': __webpack_require__(76), + 'center': __webpack_require__(77), + 'right': __webpack_require__(78), + 'justify': __webpack_require__(79) + }, + 'background': __webpack_require__(80), + 'blockquote': __webpack_require__(81), + 'bold': __webpack_require__(82), + 'clean': __webpack_require__(83), + 'code': __webpack_require__(58), + 'code-block': __webpack_require__(58), + 'color': __webpack_require__(84), + 'direction': { + '': __webpack_require__(85), + 'rtl': __webpack_require__(86) + }, + 'float': { + 'center': __webpack_require__(87), + 'full': __webpack_require__(88), + 'left': __webpack_require__(89), + 'right': __webpack_require__(90) + }, + 'formula': __webpack_require__(91), + 'header': { + '1': __webpack_require__(92), + '2': __webpack_require__(93) + }, + 'italic': __webpack_require__(94), + 'image': __webpack_require__(95), + 'indent': { + '+1': __webpack_require__(96), + '-1': __webpack_require__(97) + }, + 'link': __webpack_require__(98), + 'list': { + 'ordered': __webpack_require__(99), + 'bullet': __webpack_require__(100), + 'check': __webpack_require__(101) + }, + 'script': { + 'sub': __webpack_require__(102), + 'super': __webpack_require__(103) + }, + 'strike': __webpack_require__(104), + 'underline': __webpack_require__(105), + 'video': __webpack_require__(106) +}; + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getLastChangeIndex = exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var History = function (_Module) { + _inherits(History, _Module); + + function History(quill, options) { + _classCallCheck(this, History); + + var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); + + _this.lastRecorded = 0; + _this.ignoreChange = false; + _this.clear(); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { + if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; + if (!_this.options.userOnly || source === _quill2.default.sources.USER) { + _this.record(delta, oldDelta); + } else { + _this.transform(delta); + } + }); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); + if (/Win/i.test(navigator.platform)) { + _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); + } + return _this; + } + + _createClass(History, [{ + key: 'change', + value: function change(source, dest) { + if (this.stack[source].length === 0) return; + var delta = this.stack[source].pop(); + this.stack[dest].push(delta); + this.lastRecorded = 0; + this.ignoreChange = true; + this.quill.updateContents(delta[source], _quill2.default.sources.USER); + this.ignoreChange = false; + var index = getLastChangeIndex(delta[source]); + this.quill.setSelection(index); + } + }, { + key: 'clear', + value: function clear() { + this.stack = { undo: [], redo: [] }; + } + }, { + key: 'cutoff', + value: function cutoff() { + this.lastRecorded = 0; + } + }, { + key: 'record', + value: function record(changeDelta, oldDelta) { + if (changeDelta.ops.length === 0) return; + this.stack.redo = []; + var undoDelta = this.quill.getContents().diff(oldDelta); + var timestamp = Date.now(); + if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { + var delta = this.stack.undo.pop(); + undoDelta = undoDelta.compose(delta.undo); + changeDelta = delta.redo.compose(changeDelta); + } else { + this.lastRecorded = timestamp; + } + this.stack.undo.push({ + redo: changeDelta, + undo: undoDelta + }); + if (this.stack.undo.length > this.options.maxStack) { + this.stack.undo.shift(); + } + } + }, { + key: 'redo', + value: function redo() { + this.change('redo', 'undo'); + } + }, { + key: 'transform', + value: function transform(delta) { + this.stack.undo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + this.stack.redo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + } + }, { + key: 'undo', + value: function undo() { + this.change('undo', 'redo'); + } + }]); + + return History; +}(_module2.default); + +History.DEFAULTS = { + delay: 1000, + maxStack: 100, + userOnly: false +}; + +function endsWithNewlineChange(delta) { + var lastOp = delta.ops[delta.ops.length - 1]; + if (lastOp == null) return false; + if (lastOp.insert != null) { + return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); + } + if (lastOp.attributes != null) { + return Object.keys(lastOp.attributes).some(function (attr) { + return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; + }); + } + return false; +} + +function getLastChangeIndex(delta) { + var deleteLength = delta.reduce(function (length, op) { + length += op.delete || 0; + return length; + }, 0); + var changeIndex = delta.length() - deleteLength; + if (endsWithNewlineChange(delta)) { + changeIndex -= 1; + } + return changeIndex; +} + +exports.default = History; +exports.getLastChangeIndex = getLastChangeIndex; + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BaseTooltip = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _keyboard = __webpack_require__(23); + +var _keyboard2 = _interopRequireDefault(_keyboard); + +var _theme = __webpack_require__(34); + +var _theme2 = _interopRequireDefault(_theme); + +var _colorPicker = __webpack_require__(59); + +var _colorPicker2 = _interopRequireDefault(_colorPicker); + +var _iconPicker = __webpack_require__(60); + +var _iconPicker2 = _interopRequireDefault(_iconPicker); + +var _picker = __webpack_require__(28); + +var _picker2 = _interopRequireDefault(_picker); + +var _tooltip = __webpack_require__(61); + +var _tooltip2 = _interopRequireDefault(_tooltip); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ALIGNS = [false, 'center', 'right', 'justify']; + +var 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"]; + +var FONTS = [false, 'serif', 'monospace']; + +var HEADERS = ['1', '2', '3', false]; + +var SIZES = ['small', false, 'large', 'huge']; + +var BaseTheme = function (_Theme) { + _inherits(BaseTheme, _Theme); + + function BaseTheme(quill, options) { + _classCallCheck(this, BaseTheme); + + var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options)); + + var listener = function listener(e) { + if (!document.body.contains(quill.root)) { + return document.body.removeEventListener('click', listener); + } + if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) { + _this.tooltip.hide(); + } + if (_this.pickers != null) { + _this.pickers.forEach(function (picker) { + if (!picker.container.contains(e.target)) { + picker.close(); + } + }); + } + }; + quill.emitter.listenDOM('click', document.body, listener); + return _this; + } + + _createClass(BaseTheme, [{ + key: 'addModule', + value: function addModule(name) { + var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name); + if (name === 'toolbar') { + this.extendToolbar(module); + } + return module; + } + }, { + key: 'buildButtons', + value: function buildButtons(buttons, icons) { + buttons.forEach(function (button) { + var className = button.getAttribute('class') || ''; + className.split(/\s+/).forEach(function (name) { + if (!name.startsWith('ql-')) return; + name = name.slice('ql-'.length); + if (icons[name] == null) return; + if (name === 'direction') { + button.innerHTML = icons[name][''] + icons[name]['rtl']; + } else if (typeof icons[name] === 'string') { + button.innerHTML = icons[name]; + } else { + var value = button.value || ''; + if (value != null && icons[name][value]) { + button.innerHTML = icons[name][value]; + } + } + }); + }); + } + }, { + key: 'buildPickers', + value: function buildPickers(selects, icons) { + var _this2 = this; + + this.pickers = selects.map(function (select) { + if (select.classList.contains('ql-align')) { + if (select.querySelector('option') == null) { + fillSelect(select, ALIGNS); + } + return new _iconPicker2.default(select, icons.align); + } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) { + var format = select.classList.contains('ql-background') ? 'background' : 'color'; + if (select.querySelector('option') == null) { + fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000'); + } + return new _colorPicker2.default(select, icons[format]); + } else { + if (select.querySelector('option') == null) { + if (select.classList.contains('ql-font')) { + fillSelect(select, FONTS); + } else if (select.classList.contains('ql-header')) { + fillSelect(select, HEADERS); + } else if (select.classList.contains('ql-size')) { + fillSelect(select, SIZES); + } + } + return new _picker2.default(select); + } + }); + var update = function update() { + _this2.pickers.forEach(function (picker) { + picker.update(); + }); + }; + this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update); + } + }]); + + return BaseTheme; +}(_theme2.default); + +BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + formula: function formula() { + this.quill.theme.tooltip.edit('formula'); + }, + image: function image() { + var _this3 = this; + + var fileInput = this.container.querySelector('input.ql-image[type=file]'); + if (fileInput == null) { + fileInput = document.createElement('input'); + fileInput.setAttribute('type', 'file'); + fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'); + fileInput.classList.add('ql-image'); + fileInput.addEventListener('change', function () { + if (fileInput.files != null && fileInput.files[0] != null) { + var reader = new FileReader(); + reader.onload = function (e) { + var range = _this3.quill.getSelection(true); + _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER); + _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT); + fileInput.value = ""; + }; + reader.readAsDataURL(fileInput.files[0]); + } + }); + this.container.appendChild(fileInput); + } + fileInput.click(); + }, + video: function video() { + this.quill.theme.tooltip.edit('video'); + } + } + } + } +}); + +var BaseTooltip = function (_Tooltip) { + _inherits(BaseTooltip, _Tooltip); + + function BaseTooltip(quill, boundsContainer) { + _classCallCheck(this, BaseTooltip); + + var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer)); + + _this4.textbox = _this4.root.querySelector('input[type="text"]'); + _this4.listen(); + return _this4; + } + + _createClass(BaseTooltip, [{ + key: 'listen', + value: function listen() { + var _this5 = this; + + this.textbox.addEventListener('keydown', function (event) { + if (_keyboard2.default.match(event, 'enter')) { + _this5.save(); + event.preventDefault(); + } else if (_keyboard2.default.match(event, 'escape')) { + _this5.cancel(); + event.preventDefault(); + } + }); + } + }, { + key: 'cancel', + value: function cancel() { + this.hide(); + } + }, { + key: 'edit', + value: function edit() { + var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link'; + var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + this.root.classList.remove('ql-hidden'); + this.root.classList.add('ql-editing'); + if (preview != null) { + this.textbox.value = preview; + } else if (mode !== this.root.getAttribute('data-mode')) { + this.textbox.value = ''; + } + this.position(this.quill.getBounds(this.quill.selection.savedRange)); + this.textbox.select(); + this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || ''); + this.root.setAttribute('data-mode', mode); + } + }, { + key: 'restoreFocus', + value: function restoreFocus() { + var scrollTop = this.quill.scrollingContainer.scrollTop; + this.quill.focus(); + this.quill.scrollingContainer.scrollTop = scrollTop; + } + }, { + key: 'save', + value: function save() { + var value = this.textbox.value; + switch (this.root.getAttribute('data-mode')) { + case 'link': + { + var scrollTop = this.quill.root.scrollTop; + if (this.linkRange) { + this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER); + delete this.linkRange; + } else { + this.restoreFocus(); + this.quill.format('link', value, _emitter2.default.sources.USER); + } + this.quill.root.scrollTop = scrollTop; + break; + } + case 'video': + { + value = extractVideoUrl(value); + } // eslint-disable-next-line no-fallthrough + case 'formula': + { + if (!value) break; + var range = this.quill.getSelection(true); + if (range != null) { + var index = range.index + range.length; + this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER); + if (this.root.getAttribute('data-mode') === 'formula') { + this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER); + } + this.quill.setSelection(index + 2, _emitter2.default.sources.USER); + } + break; + } + default: + } + this.textbox.value = ''; + this.hide(); + } + }]); + + return BaseTooltip; +}(_tooltip2.default); + +function extractVideoUrl(url) { + var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/); + if (match) { + return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0'; + } + if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) { + // eslint-disable-line no-cond-assign + return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/'; + } + return url; +} + +function fillSelect(select, values) { + var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + values.forEach(function (value) { + var option = document.createElement('option'); + if (value === defaultValue) { + option.setAttribute('selected', 'selected'); + } else { + option.setAttribute('value', value); + } + select.appendChild(option); + }); +} + +exports.BaseTooltip = BaseTooltip; +exports.default = BaseTheme; + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var LinkedList = /** @class */ (function () { + function LinkedList() { + this.head = this.tail = null; + this.length = 0; + } + LinkedList.prototype.append = function () { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i] = arguments[_i]; + } + this.insertBefore(nodes[0], null); + if (nodes.length > 1) { + this.append.apply(this, nodes.slice(1)); + } + }; + LinkedList.prototype.contains = function (node) { + var cur, next = this.iterator(); + while ((cur = next())) { + if (cur === node) + return true; + } + return false; + }; + LinkedList.prototype.insertBefore = function (node, refNode) { + if (!node) + return; + node.next = refNode; + if (refNode != null) { + node.prev = refNode.prev; + if (refNode.prev != null) { + refNode.prev.next = node; + } + refNode.prev = node; + if (refNode === this.head) { + this.head = node; + } + } + else if (this.tail != null) { + this.tail.next = node; + node.prev = this.tail; + this.tail = node; + } + else { + node.prev = null; + this.head = this.tail = node; + } + this.length += 1; + }; + LinkedList.prototype.offset = function (target) { + var index = 0, cur = this.head; + while (cur != null) { + if (cur === target) + return index; + index += cur.length(); + cur = cur.next; + } + return -1; + }; + LinkedList.prototype.remove = function (node) { + if (!this.contains(node)) + return; + if (node.prev != null) + node.prev.next = node.next; + if (node.next != null) + node.next.prev = node.prev; + if (node === this.head) + this.head = node.next; + if (node === this.tail) + this.tail = node.prev; + this.length -= 1; + }; + LinkedList.prototype.iterator = function (curNode) { + if (curNode === void 0) { curNode = this.head; } + // TODO use yield when we can + return function () { + var ret = curNode; + if (curNode != null) + curNode = curNode.next; + return ret; + }; + }; + LinkedList.prototype.find = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var cur, next = this.iterator(); + while ((cur = next())) { + var length = cur.length(); + if (index < length || + (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) { + return [cur, index]; + } + index -= length; + } + return [null, 0]; + }; + LinkedList.prototype.forEach = function (callback) { + var cur, next = this.iterator(); + while ((cur = next())) { + callback(cur); + } + }; + LinkedList.prototype.forEachAt = function (index, length, callback) { + if (length <= 0) + return; + var _a = this.find(index), startNode = _a[0], offset = _a[1]; + var cur, curIndex = index - offset, next = this.iterator(startNode); + while ((cur = next()) && curIndex < index + length) { + var curLength = cur.length(); + if (index > curIndex) { + callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); + } + else { + callback(cur, 0, Math.min(curLength, index + length - curIndex)); + } + curIndex += curLength; + } + }; + LinkedList.prototype.map = function (callback) { + return this.reduce(function (memo, cur) { + memo.push(callback(cur)); + return memo; + }, []); + }; + LinkedList.prototype.reduce = function (callback, memo) { + var cur, next = this.iterator(); + while ((cur = next())) { + memo = callback(memo, cur); + } + return memo; + }; + return LinkedList; +}()); +exports.default = LinkedList; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var OBSERVER_CONFIG = { + attributes: true, + characterData: true, + characterDataOldValue: true, + childList: true, + subtree: true, +}; +var MAX_OPTIMIZE_ITERATIONS = 100; +var ScrollBlot = /** @class */ (function (_super) { + __extends(ScrollBlot, _super); + function ScrollBlot(node) { + var _this = _super.call(this, node) || this; + _this.scroll = _this; + _this.observer = new MutationObserver(function (mutations) { + _this.update(mutations); + }); + _this.observer.observe(_this.domNode, OBSERVER_CONFIG); + _this.attach(); + return _this; + } + ScrollBlot.prototype.detach = function () { + _super.prototype.detach.call(this); + this.observer.disconnect(); + }; + ScrollBlot.prototype.deleteAt = function (index, length) { + this.update(); + if (index === 0 && length === this.length()) { + this.children.forEach(function (child) { + child.remove(); + }); + } + else { + _super.prototype.deleteAt.call(this, index, length); + } + }; + ScrollBlot.prototype.formatAt = function (index, length, name, value) { + this.update(); + _super.prototype.formatAt.call(this, index, length, name, value); + }; + ScrollBlot.prototype.insertAt = function (index, value, def) { + this.update(); + _super.prototype.insertAt.call(this, index, value, def); + }; + ScrollBlot.prototype.optimize = function (mutations, context) { + var _this = this; + if (mutations === void 0) { mutations = []; } + if (context === void 0) { context = {}; } + _super.prototype.optimize.call(this, context); + // We must modify mutations directly, cannot make copy and then modify + var records = [].slice.call(this.observer.takeRecords()); + // Array.push currently seems to be implemented by a non-tail recursive function + // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords()); + while (records.length > 0) + mutations.push(records.pop()); + // TODO use WeakMap + var mark = function (blot, markParent) { + if (markParent === void 0) { markParent = true; } + if (blot == null || blot === _this) + return; + if (blot.domNode.parentNode == null) + return; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = []; + } + if (markParent) + mark(blot.parent); + }; + var optimize = function (blot) { + // Post-order traversal + if ( + // @ts-ignore + blot.domNode[Registry.DATA_KEY] == null || + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations == null) { + return; + } + if (blot instanceof container_1.default) { + blot.children.forEach(optimize); + } + blot.optimize(context); + }; + var remaining = mutations; + for (var i = 0; remaining.length > 0; i += 1) { + if (i >= MAX_OPTIMIZE_ITERATIONS) { + throw new Error('[Parchment] Maximum optimize iterations reached'); + } + remaining.forEach(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return; + if (blot.domNode === mutation.target) { + if (mutation.type === 'childList') { + mark(Registry.find(mutation.previousSibling, false)); + [].forEach.call(mutation.addedNodes, function (node) { + var child = Registry.find(node, false); + mark(child, false); + if (child instanceof container_1.default) { + child.children.forEach(function (grandChild) { + mark(grandChild, false); + }); + } + }); + } + else if (mutation.type === 'attributes') { + mark(blot.prev); + } + } + mark(blot); + }); + this.children.forEach(optimize); + remaining = [].slice.call(this.observer.takeRecords()); + records = remaining.slice(); + while (records.length > 0) + mutations.push(records.pop()); + } + }; + ScrollBlot.prototype.update = function (mutations, context) { + var _this = this; + if (context === void 0) { context = {}; } + mutations = mutations || this.observer.takeRecords(); + // TODO use WeakMap + mutations + .map(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return null; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = [mutation]; + return blot; + } + else { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations.push(mutation); + return null; + } + }) + .forEach(function (blot) { + if (blot == null || + blot === _this || + //@ts-ignore + blot.domNode[Registry.DATA_KEY] == null) + return; + // @ts-ignore + blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context); + }); + // @ts-ignore + if (this.domNode[Registry.DATA_KEY].mutations != null) { + // @ts-ignore + _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context); + } + this.optimize(mutations, context); + }; + ScrollBlot.blotName = 'scroll'; + ScrollBlot.defaultChild = 'block'; + ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; + ScrollBlot.tagName = 'DIV'; + return ScrollBlot; +}(container_1.default)); +exports.default = ScrollBlot; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +// Shallow object comparison +function isEqual(obj1, obj2) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) + return false; + // @ts-ignore + for (var prop in obj1) { + // @ts-ignore + if (obj1[prop] !== obj2[prop]) + return false; + } + return true; +} +var InlineBlot = /** @class */ (function (_super) { + __extends(InlineBlot, _super); + function InlineBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + InlineBlot.formats = function (domNode) { + if (domNode.tagName === InlineBlot.tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + InlineBlot.prototype.format = function (name, value) { + var _this = this; + if (name === this.statics.blotName && !value) { + this.children.forEach(function (child) { + if (!(child instanceof format_1.default)) { + child = child.wrap(InlineBlot.blotName, true); + } + _this.attributes.copy(child); + }); + this.unwrap(); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + InlineBlot.prototype.formatAt = function (index, length, name, value) { + if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { + var blot = this.isolate(index, length); + blot.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + InlineBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + var formats = this.formats(); + if (Object.keys(formats).length === 0) { + return this.unwrap(); // unformatted span + } + var next = this.next; + if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { + next.moveChildren(this); + next.remove(); + } + }; + InlineBlot.blotName = 'inline'; + InlineBlot.scope = Registry.Scope.INLINE_BLOT; + InlineBlot.tagName = 'SPAN'; + return InlineBlot; +}(format_1.default)); +exports.default = InlineBlot; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +var BlockBlot = /** @class */ (function (_super) { + __extends(BlockBlot, _super); + function BlockBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlockBlot.formats = function (domNode) { + var tagName = Registry.query(BlockBlot.blotName).tagName; + if (domNode.tagName === tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + BlockBlot.prototype.format = function (name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) == null) { + return; + } + else if (name === this.statics.blotName && !value) { + this.replaceWith(BlockBlot.blotName); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + BlockBlot.prototype.formatAt = function (index, length, name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) != null) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + BlockBlot.prototype.insertAt = function (index, value, def) { + if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { + // Insert text or inline + _super.prototype.insertAt.call(this, index, value, def); + } + else { + var after = this.split(index); + var blot = Registry.create(value, def); + after.parent.insertBefore(blot, after); + } + }; + BlockBlot.prototype.update = function (mutations, context) { + if (navigator.userAgent.match(/Trident/)) { + this.build(); + } + else { + _super.prototype.update.call(this, mutations, context); + } + }; + BlockBlot.blotName = 'block'; + BlockBlot.scope = Registry.Scope.BLOCK_BLOT; + BlockBlot.tagName = 'P'; + return BlockBlot; +}(format_1.default)); +exports.default = BlockBlot; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var EmbedBlot = /** @class */ (function (_super) { + __extends(EmbedBlot, _super); + function EmbedBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + EmbedBlot.formats = function (domNode) { + return undefined; + }; + EmbedBlot.prototype.format = function (name, value) { + // super.formatAt wraps, which is what we want in general, + // but this allows subclasses to overwrite for formats + // that just apply to particular embeds + _super.prototype.formatAt.call(this, 0, this.length(), name, value); + }; + EmbedBlot.prototype.formatAt = function (index, length, name, value) { + if (index === 0 && length === this.length()) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + EmbedBlot.prototype.formats = function () { + return this.statics.formats(this.domNode); + }; + return EmbedBlot; +}(leaf_1.default)); +exports.default = EmbedBlot; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var Registry = __webpack_require__(1); +var TextBlot = /** @class */ (function (_super) { + __extends(TextBlot, _super); + function TextBlot(node) { + var _this = _super.call(this, node) || this; + _this.text = _this.statics.value(_this.domNode); + return _this; + } + TextBlot.create = function (value) { + return document.createTextNode(value); + }; + TextBlot.value = function (domNode) { + var text = domNode.data; + // @ts-ignore + if (text['normalize']) + text = text['normalize'](); + return text; + }; + TextBlot.prototype.deleteAt = function (index, length) { + this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); + }; + TextBlot.prototype.index = function (node, offset) { + if (this.domNode === node) { + return offset; + } + return -1; + }; + TextBlot.prototype.insertAt = function (index, value, def) { + if (def == null) { + this.text = this.text.slice(0, index) + value + this.text.slice(index); + this.domNode.data = this.text; + } + else { + _super.prototype.insertAt.call(this, index, value, def); + } + }; + TextBlot.prototype.length = function () { + return this.text.length; + }; + TextBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + this.text = this.statics.value(this.domNode); + if (this.text.length === 0) { + this.remove(); + } + else if (this.next instanceof TextBlot && this.next.prev === this) { + this.insertAt(this.length(), this.next.value()); + this.next.remove(); + } + }; + TextBlot.prototype.position = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + return [this.domNode, index]; + }; + TextBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = Registry.create(this.domNode.splitText(index)); + this.parent.insertBefore(after, this.next); + this.text = this.statics.value(this.domNode); + return after; + }; + TextBlot.prototype.update = function (mutations, context) { + var _this = this; + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this.domNode; + })) { + this.text = this.statics.value(this.domNode); + } + }; + TextBlot.prototype.value = function () { + return this.text; + }; + TextBlot.blotName = 'text'; + TextBlot.scope = Registry.Scope.INLINE_BLOT; + return TextBlot; +}(leaf_1.default)); +exports.default = TextBlot; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var elem = document.createElement('div'); +elem.classList.toggle('test-class', false); +if (elem.classList.contains('test-class')) { + var _toggle = DOMTokenList.prototype.toggle; + DOMTokenList.prototype.toggle = function (token, force) { + if (arguments.length > 1 && !this.contains(token) === !force) { + return force; + } else { + return _toggle.call(this, token); + } + }; +} + +if (!String.prototype.startsWith) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; +} + +if (!String.prototype.endsWith) { + String.prototype.endsWith = function (searchString, position) { + var subjectString = this.toString(); + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length; + } + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; +} + +if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, "find", { + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } + } + return undefined; + } + }); +} + +document.addEventListener("DOMContentLoaded", function () { + // Disable resizing in Firefox + document.execCommand("enableObjectResizing", false, false); + // Disable automatic linkifying in IE11 + document.execCommand("autoUrlDetect", false, false); +}); + +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + +/** + * This library modifies the diff-patch-match library by Neil Fraser + * by removing the patch and match functionality and certain advanced + * options in the diff function. The original license is as follows: + * + * === + * + * Diff Match and Patch + * + * Copyright 2006 Google Inc. + * http://code.google.com/p/google-diff-match-patch/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ +var DIFF_DELETE = -1; +var DIFF_INSERT = 1; +var DIFF_EQUAL = 0; + + +/** + * Find the differences between two texts. Simplifies the problem by stripping + * any common prefix or suffix off the texts before diffing. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {Int} cursor_pos Expected edit position in text1 (optional) + * @return {Array} Array of diff tuples. + */ +function diff_main(text1, text2, cursor_pos) { + // Check for equality (speedup). + if (text1 == text2) { + if (text1) { + return [[DIFF_EQUAL, text1]]; + } + return []; + } + + // Check cursor_pos within bounds + if (cursor_pos < 0 || text1.length < cursor_pos) { + cursor_pos = null; + } + + // Trim off common prefix (speedup). + var commonlength = diff_commonPrefix(text1, text2); + var commonprefix = text1.substring(0, commonlength); + text1 = text1.substring(commonlength); + text2 = text2.substring(commonlength); + + // Trim off common suffix (speedup). + 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); + + // Compute the diff on the middle block. + var diffs = diff_compute_(text1, text2); + + // Restore the prefix and suffix. + if (commonprefix) { + diffs.unshift([DIFF_EQUAL, commonprefix]); + } + if (commonsuffix) { + diffs.push([DIFF_EQUAL, commonsuffix]); + } + diff_cleanupMerge(diffs); + if (cursor_pos != null) { + diffs = fix_cursor(diffs, cursor_pos); + } + diffs = fix_emoji(diffs); + return diffs; +}; + + +/** + * Find the differences between two texts. Assumes that the texts do not + * have any common prefix or suffix. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + */ +function diff_compute_(text1, text2) { + var diffs; + + if (!text1) { + // Just add some text (speedup). + return [[DIFF_INSERT, text2]]; + } + + if (!text2) { + // Just delete some text (speedup). + return [[DIFF_DELETE, text1]]; + } + + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + var i = longtext.indexOf(shorttext); + if (i != -1) { + // Shorter text is inside the longer text (speedup). + diffs = [[DIFF_INSERT, longtext.substring(0, i)], + [DIFF_EQUAL, shorttext], + [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; + // Swap insertions for deletions if diff is reversed. + if (text1.length > text2.length) { + diffs[0][0] = diffs[2][0] = DIFF_DELETE; + } + return diffs; + } + + if (shorttext.length == 1) { + // Single character string. + // After the previous speedup, the character can't be an equality. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + } + + // Check to see if the problem can be split in two. + var hm = diff_halfMatch_(text1, text2); + if (hm) { + // A half-match was found, sort out the return data. + var text1_a = hm[0]; + var text1_b = hm[1]; + var text2_a = hm[2]; + var text2_b = hm[3]; + var mid_common = hm[4]; + // Send both pairs off for separate processing. + var diffs_a = diff_main(text1_a, text2_a); + var diffs_b = diff_main(text1_b, text2_b); + // Merge the results. + return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); + } + + return diff_bisect_(text1, text2); +}; + + +/** + * Find the 'middle snake' of a diff, split the problem in two + * and return the recursively constructed diff. + * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + * @private + */ +function diff_bisect_(text1, text2) { + // Cache the text lengths to prevent multiple calls. + var text1_length = text1.length; + var text2_length = text2.length; + var max_d = Math.ceil((text1_length + text2_length) / 2); + var v_offset = max_d; + var v_length = 2 * max_d; + var v1 = new Array(v_length); + var v2 = new Array(v_length); + // Setting all elements to -1 is faster in Chrome & Firefox than mixing + // integers and undefined. + for (var x = 0; x < v_length; x++) { + v1[x] = -1; + v2[x] = -1; + } + v1[v_offset + 1] = 0; + v2[v_offset + 1] = 0; + var delta = text1_length - text2_length; + // If the total number of characters is odd, then the front path will collide + // with the reverse path. + var front = (delta % 2 != 0); + // Offsets for start and end of k loop. + // Prevents mapping of space beyond the grid. + var k1start = 0; + var k1end = 0; + var k2start = 0; + var k2end = 0; + for (var d = 0; d < max_d; d++) { + // Walk the front path one step. + for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { + var k1_offset = v_offset + k1; + var x1; + if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { + x1 = v1[k1_offset + 1]; + } else { + x1 = v1[k1_offset - 1] + 1; + } + var y1 = x1 - k1; + while (x1 < text1_length && y1 < text2_length && + text1.charAt(x1) == text2.charAt(y1)) { + x1++; + y1++; + } + v1[k1_offset] = x1; + if (x1 > text1_length) { + // Ran off the right of the graph. + k1end += 2; + } else if (y1 > text2_length) { + // Ran off the bottom of the graph. + k1start += 2; + } else if (front) { + var k2_offset = v_offset + delta - k1; + if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { + // Mirror x2 onto top-left coordinate system. + var x2 = text1_length - v2[k2_offset]; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + + // Walk the reverse path one step. + for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { + var k2_offset = v_offset + k2; + var x2; + if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { + x2 = v2[k2_offset + 1]; + } else { + x2 = v2[k2_offset - 1] + 1; + } + var y2 = x2 - k2; + while (x2 < text1_length && y2 < text2_length && + text1.charAt(text1_length - x2 - 1) == + text2.charAt(text2_length - y2 - 1)) { + x2++; + y2++; + } + v2[k2_offset] = x2; + if (x2 > text1_length) { + // Ran off the left of the graph. + k2end += 2; + } else if (y2 > text2_length) { + // Ran off the top of the graph. + 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]; + var y1 = v_offset + x1 - k1_offset; + // Mirror x2 onto top-left coordinate system. + x2 = text1_length - x2; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + } + // Diff took too long and hit the deadline or + // number of diffs equals number of characters, no commonality at all. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; +}; + + +/** + * Given the location of the 'middle snake', split the diff in two parts + * and recurse. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} x Index of split point in text1. + * @param {number} y Index of split point in text2. + * @return {Array} Array of diff tuples. + */ +function diff_bisectSplit_(text1, text2, x, y) { + var text1a = text1.substring(0, x); + var text2a = text2.substring(0, y); + var text1b = text1.substring(x); + var text2b = text2.substring(y); + + // Compute both diffs serially. + var diffs = diff_main(text1a, text2a); + var diffsb = diff_main(text1b, text2b); + + return diffs.concat(diffsb); +}; + + +/** + * Determine the common prefix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the start of each + * string. + */ +function diff_commonPrefix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerstart = 0; + while (pointermin < pointermid) { + if (text1.substring(pointerstart, pointermid) == + text2.substring(pointerstart, pointermid)) { + pointermin = pointermid; + pointerstart = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Determine the common suffix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of each string. + */ +function diff_commonSuffix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || + text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerend = 0; + while (pointermin < pointermid) { + if (text1.substring(text1.length - pointermid, text1.length - pointerend) == + text2.substring(text2.length - pointermid, text2.length - pointerend)) { + pointermin = pointermid; + pointerend = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Do the two texts share a substring which is at least half the length of the + * longer text? + * This speedup can produce non-minimal diffs. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {Array.} Five element Array, containing the prefix of + * text1, the suffix of text1, the prefix of text2, the suffix of + * text2 and the common middle. Or null if there was no match. + */ +function diff_halfMatch_(text1, text2) { + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { + return null; // Pointless. + } + + /** + * Does a substring of shorttext exist within longtext such that the substring + * is at least half the length of longtext? + * Closure, but does not reference any external variables. + * @param {string} longtext Longer string. + * @param {string} shorttext Shorter string. + * @param {number} i Start index of quarter length substring within longtext. + * @return {Array.} Five element Array, containing the prefix of + * longtext, the suffix of longtext, the prefix of shorttext, the suffix + * of shorttext and the common middle. Or null if there was no match. + * @private + */ + function diff_halfMatchI_(longtext, shorttext, i) { + // Start with a 1/4 length substring at position i as a seed. + var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); + var j = -1; + var best_common = ''; + var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; + while ((j = shorttext.indexOf(seed, j + 1)) != -1) { + var prefixLength = diff_commonPrefix(longtext.substring(i), + shorttext.substring(j)); + var suffixLength = diff_commonSuffix(longtext.substring(0, i), + shorttext.substring(0, j)); + if (best_common.length < suffixLength + prefixLength) { + best_common = shorttext.substring(j - suffixLength, j) + + shorttext.substring(j, j + prefixLength); + best_longtext_a = longtext.substring(0, i - suffixLength); + best_longtext_b = longtext.substring(i + prefixLength); + best_shorttext_a = shorttext.substring(0, j - suffixLength); + best_shorttext_b = shorttext.substring(j + prefixLength); + } + } + if (best_common.length * 2 >= longtext.length) { + return [best_longtext_a, best_longtext_b, + best_shorttext_a, best_shorttext_b, best_common]; + } else { + return null; + } + } + + // First check if the second quarter is the seed for a half-match. + var hm1 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 4)); + // Check again based on the third quarter. + var hm2 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 2)); + var hm; + if (!hm1 && !hm2) { + return null; + } else if (!hm2) { + hm = hm1; + } else if (!hm1) { + hm = hm2; + } else { + // Both matched. Select the longest. + hm = hm1[4].length > hm2[4].length ? hm1 : hm2; + } + + // A half-match was found, sort out the return data. + var text1_a, text1_b, text2_a, text2_b; + if (text1.length > text2.length) { + text1_a = hm[0]; + text1_b = hm[1]; + text2_a = hm[2]; + text2_b = hm[3]; + } else { + 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]; +}; + + +/** + * Reorder and merge like edit sections. Merge equalities. + * Any edit section can move as long as it doesn't cross an equality. + * @param {Array} diffs Array of diff tuples. + */ +function diff_cleanupMerge(diffs) { + diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. + var pointer = 0; + var count_delete = 0; + var count_insert = 0; + var text_delete = ''; + var text_insert = ''; + var commonlength; + while (pointer < diffs.length) { + 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: + // Upon reaching an equality, check for prior redundancies. + if (count_delete + count_insert > 1) { + if (count_delete !== 0 && count_insert !== 0) { + // Factor out any common prefixies. + commonlength = diff_commonPrefix(text_insert, text_delete); + if (commonlength !== 0) { + if ((pointer - count_delete - count_insert) > 0 && + diffs[pointer - count_delete - count_insert - 1][0] == + DIFF_EQUAL) { + diffs[pointer - count_delete - count_insert - 1][1] += + text_insert.substring(0, commonlength); + } else { + diffs.splice(0, 0, [DIFF_EQUAL, + text_insert.substring(0, commonlength)]); + pointer++; + } + text_insert = text_insert.substring(commonlength); + text_delete = text_delete.substring(commonlength); + } + // Factor out any common suffixies. + commonlength = diff_commonSuffix(text_insert, text_delete); + if (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); + } + } + // Delete the offending records and add the merged ones. + if (count_delete === 0) { + diffs.splice(pointer - count_insert, + count_delete + count_insert, [DIFF_INSERT, text_insert]); + } else if (count_insert === 0) { + diffs.splice(pointer - count_delete, + count_delete + count_insert, [DIFF_DELETE, text_delete]); + } else { + diffs.splice(pointer - count_delete - count_insert, + count_delete + count_insert, [DIFF_DELETE, text_delete], + [DIFF_INSERT, text_insert]); + } + pointer = pointer - count_delete - count_insert + + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; + } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { + // Merge this equality with the previous one. + diffs[pointer - 1][1] += diffs[pointer][1]; + diffs.splice(pointer, 1); + } else { + pointer++; + } + count_insert = 0; + count_delete = 0; + text_delete = ''; + text_insert = ''; + break; + } + } + if (diffs[diffs.length - 1][1] === '') { + diffs.pop(); // Remove the dummy entry at the end. + } + + // Second pass: look for single edits surrounded on both sides by equalities + // which can be shifted sideways to eliminate an equality. + // e.g: ABAC -> ABAC + var changes = false; + pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if (diffs[pointer - 1][0] == DIFF_EQUAL && + diffs[pointer + 1][0] == DIFF_EQUAL) { + // This is a single edit surrounded by equalities. + if (diffs[pointer][1].substring(diffs[pointer][1].length - + diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { + // Shift the edit over the previous equality. + 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 = true; + } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == + diffs[pointer + 1][1]) { + // Shift the edit over the next equality. + 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 = true; + } + } + pointer++; + } + // If shifts were made, the diff needs reordering and another shift sweep. + if (changes) { + diff_cleanupMerge(diffs); + } +}; + + +var diff = diff_main; +diff.INSERT = DIFF_INSERT; +diff.DELETE = DIFF_DELETE; +diff.EQUAL = DIFF_EQUAL; + +module.exports = diff; + +/* + * Modify a diff such that the cursor position points to the start of a change: + * E.g. + * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) + * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] + * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) + * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} A tuple [cursor location in the modified diff, modified diff] + */ +function cursor_normalize_diff (diffs, cursor_pos) { + if (cursor_pos === 0) { + return [DIFF_EQUAL, diffs]; + } + for (var current_pos = 0, i = 0; i < diffs.length; i++) { + var d = diffs[i]; + if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { + var next_pos = current_pos + d[1].length; + if (cursor_pos === next_pos) { + return [i + 1, diffs]; + } else if (cursor_pos < next_pos) { + // copy to prevent side effects + diffs = diffs.slice(); + // split d into two diff changes + var split_pos = cursor_pos - current_pos; + var d_left = [d[0], d[1].slice(0, split_pos)]; + var d_right = [d[0], d[1].slice(split_pos)]; + diffs.splice(i, 1, d_left, d_right); + return [i + 1, diffs]; + } else { + current_pos = next_pos; + } + } + } + throw new Error('cursor_pos is out of bounds!') +} + +/* + * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). + * + * Case 1) + * Check if a naive shift is possible: + * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) + * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result + * Case 2) + * Check if the following shifts are possible: + * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] + * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] + * ^ ^ + * d d_next + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} Array of diff tuples + */ +function fix_cursor (diffs, cursor_pos) { + var norm = cursor_normalize_diff(diffs, cursor_pos); + var ndiffs = norm[1]; + var cursor_pointer = norm[0]; + var d = ndiffs[cursor_pointer]; + var d_next = ndiffs[cursor_pointer + 1]; + + if (d == null) { + // Text was deleted from end of original string, + // cursor is now out of bounds in new string + return diffs; + } else if (d[0] !== DIFF_EQUAL) { + // A modification happened at the cursor location. + // This is the expected outcome, so we can return the original diff. + return diffs; + } else { + if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { + // Case 1) + // It is possible to perform a naive shift + ndiffs.splice(cursor_pointer, 2, d_next, d) + return merge_tuples(ndiffs, cursor_pointer, 2) + } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { + // Case 2) + // d[1] is a prefix of d_next[1] + // We can assume that d_next[0] !== 0, since d[0] === 0 + // Shift edit locations.. + ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); + var suffix = d_next[1].slice(d[1].length); + if (suffix.length > 0) { + ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); + } + return merge_tuples(ndiffs, cursor_pointer, 3) + } else { + // Not possible to perform any modification + return diffs; + } + } +} + +/* + * Check diff did not split surrogate pairs. + * Ex. [0, '\uD83D'], [-1, '\uDC36'], [1, '\uDC2F'] -> [-1, '\uD83D\uDC36'], [1, '\uD83D\uDC2F'] + * '\uD83D\uDC36' === '🐶', '\uD83D\uDC2F' === '🐯' + * + * @param {Array} diffs Array of diff tuples + * @return {Array} Array of diff tuples + */ +function fix_emoji (diffs) { + var compact = false; + var starts_with_pair_end = function(str) { + return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF; + } + var ends_with_pair_start = function(str) { + return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF; + } + for (var i = 2; i < diffs.length; i += 1) { + if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) && + diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) && + diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) { + compact = true; + + diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1]; + diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1]; + + diffs[i-2][1] = diffs[i-2][1].slice(0, -1); + } + } + if (!compact) { + return diffs; + } + var fixed_diffs = []; + for (var i = 0; i < diffs.length; i += 1) { + if (diffs[i][1].length > 0) { + fixed_diffs.push(diffs[i]); + } + } + return fixed_diffs; +} + +/* + * Try to merge tuples with their neigbors in a given range. + * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] + * + * @param {Array} diffs Array of diff tuples. + * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). + * @param {Int} length Number of consecutive elements to check. + * @return {Array} Array of merged diff tuples. + */ +function merge_tuples (diffs, start, length) { + // Check from (start-1) to (start+length). + for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { + if (i + 1 < diffs.length) { + var left_d = diffs[i]; + var right_d = diffs[i+1]; + if (left_d[0] === right_d[1]) { + diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); + } + } + } + return diffs; +} + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + +exports.shim = shim; +function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} + + +/***/ }), +/* 53 */ +/***/ (function(module, exports) { + +var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) +})() == '[object Arguments]'; + +exports = module.exports = supportsArgumentsClass ? supported : unsupported; + +exports.supported = supported; +function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +}; + +exports.unsupported = unsupported; +function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports) { + +'use strict'; + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @api private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {Mixed} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @api private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @api public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Boolean} exists Only check if there are listeners. + * @returns {Array|Boolean} + * @api public + */ +EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @api public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + 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++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (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 true; +}; + +/** + * Add a listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Add a one-time listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Remove the listeners of a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {Mixed} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn + && (!once || listeners.once) + && (!context || listeners.context === context) + ) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {String|Symbol} [event] The event name. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// This function doesn't apply anymore. +// +EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; +}; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extend2 = __webpack_require__(3); + +var _extend3 = _interopRequireDefault(_extend2); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _align = __webpack_require__(36); + +var _background = __webpack_require__(37); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _color = __webpack_require__(26); + +var _direction = __webpack_require__(38); + +var _font = __webpack_require__(39); + +var _size = __webpack_require__(40); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:clipboard'); + +var DOM_KEY = '__ql-matcher'; + +var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; + +var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var Clipboard = function (_Module) { + _inherits(Clipboard, _Module); + + function Clipboard(quill, options) { + _classCallCheck(this, Clipboard); + + var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); + + _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); + _this.container = _this.quill.addContainer('ql-clipboard'); + _this.container.setAttribute('contenteditable', true); + _this.container.setAttribute('tabindex', -1); + _this.matchers = []; + CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + selector = _ref2[0], + matcher = _ref2[1]; + + if (!options.matchVisual && matcher === matchSpacing) return; + _this.addMatcher(selector, matcher); + }); + return _this; + } + + _createClass(Clipboard, [{ + key: 'addMatcher', + value: function addMatcher(selector, matcher) { + this.matchers.push([selector, matcher]); + } + }, { + key: 'convert', + value: function convert(html) { + if (typeof html === 'string') { + this.container.innerHTML = html.replace(/\>\r?\n +\<'); // Remove spaces between tags + return this.convert(); + } + var formats = this.quill.getFormat(this.quill.selection.savedRange.index); + if (formats[_code2.default.blotName]) { + var text = this.container.innerText; + this.container.innerHTML = ''; + return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName])); + } + + var _prepareMatching = this.prepareMatching(), + _prepareMatching2 = _slicedToArray(_prepareMatching, 2), + elementMatchers = _prepareMatching2[0], + textMatchers = _prepareMatching2[1]; + + var delta = traverse(this.container, elementMatchers, textMatchers); + // Remove trailing newline + if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); + } + debug.log('convert', this.container.innerHTML, delta); + this.container.innerHTML = ''; + return delta; + } + }, { + key: 'dangerouslyPasteHTML', + value: function dangerouslyPasteHTML(index, html) { + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; + + if (typeof index === 'string') { + this.quill.setContents(this.convert(index), html); + this.quill.setSelection(0, _quill2.default.sources.SILENT); + } else { + var paste = this.convert(html); + this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); + this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT); + } + } + }, { + key: 'onPaste', + value: function onPaste(e) { + var _this2 = this; + + if (e.defaultPrevented || !this.quill.isEnabled()) return; + var range = this.quill.getSelection(); + var delta = new _quillDelta2.default().retain(range.index); + var scrollTop = this.quill.scrollingContainer.scrollTop; + this.container.focus(); + this.quill.selection.update(_quill2.default.sources.SILENT); + setTimeout(function () { + delta = delta.concat(_this2.convert()).delete(range.length); + _this2.quill.updateContents(delta, _quill2.default.sources.USER); + // range.length contributes to delta.length() + _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); + _this2.quill.scrollingContainer.scrollTop = scrollTop; + _this2.quill.focus(); + }, 1); + } + }, { + key: 'prepareMatching', + value: function prepareMatching() { + var _this3 = this; + + var elementMatchers = [], + textMatchers = []; + this.matchers.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + selector = _pair[0], + matcher = _pair[1]; + + switch (selector) { + case Node.TEXT_NODE: + textMatchers.push(matcher); + break; + case Node.ELEMENT_NODE: + elementMatchers.push(matcher); + break; + default: + [].forEach.call(_this3.container.querySelectorAll(selector), function (node) { + // TODO use weakmap + node[DOM_KEY] = node[DOM_KEY] || []; + node[DOM_KEY].push(matcher); + }); + break; + } + }); + return [elementMatchers, textMatchers]; + } + }]); + + return Clipboard; +}(_module2.default); + +Clipboard.DEFAULTS = { + matchers: [], + matchVisual: true +}; + +function applyFormat(delta, format, value) { + if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') { + return Object.keys(format).reduce(function (delta, key) { + return applyFormat(delta, key, format[key]); + }, delta); + } else { + return delta.reduce(function (delta, op) { + if (op.attributes && op.attributes[format]) { + return delta.push(op); + } else { + return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes)); + } + }, new _quillDelta2.default()); + } +} + +function computeStyle(node) { + if (node.nodeType !== Node.ELEMENT_NODE) return {}; + var DOM_KEY = '__ql-computed-style'; + return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); +} + +function deltaEndsWith(delta, text) { + var endText = ""; + for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { + var op = delta.ops[i]; + if (typeof op.insert !== 'string') break; + endText = op.insert + endText; + } + return endText.slice(-1 * text.length) === text; +} + +function isLine(node) { + if (node.childNodes.length === 0) return false; // Exclude embed blocks + var style = computeStyle(node); + return ['block', 'list-item'].indexOf(style.display) > -1; +} + +function traverse(node, elementMatchers, textMatchers) { + // Post-order + if (node.nodeType === node.TEXT_NODE) { + return textMatchers.reduce(function (delta, matcher) { + return matcher(node, delta); + }, new _quillDelta2.default()); + } else if (node.nodeType === node.ELEMENT_NODE) { + return [].reduce.call(node.childNodes || [], function (delta, childNode) { + var childrenDelta = traverse(childNode, elementMatchers, textMatchers); + if (childNode.nodeType === node.ELEMENT_NODE) { + childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + } + return delta.concat(childrenDelta); + }, new _quillDelta2.default()); + } else { + return new _quillDelta2.default(); + } +} + +function matchAlias(format, node, delta) { + return applyFormat(delta, format, true); +} + +function matchAttributor(node, delta) { + var attributes = _parchment2.default.Attributor.Attribute.keys(node); + var classes = _parchment2.default.Attributor.Class.keys(node); + var styles = _parchment2.default.Attributor.Style.keys(node); + var formats = {}; + attributes.concat(classes).concat(styles).forEach(function (name) { + var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); + if (attr != null) { + formats[attr.attrName] = attr.value(node); + if (formats[attr.attrName]) return; + } + attr = ATTRIBUTE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + formats[attr.attrName] = attr.value(node) || undefined; + } + attr = STYLE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + attr = STYLE_ATTRIBUTORS[name]; + formats[attr.attrName] = attr.value(node) || undefined; + } + }); + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + return delta; +} + +function matchBlot(node, delta) { + var match = _parchment2.default.query(node); + if (match == null) return delta; + if (match.prototype instanceof _parchment2.default.Embed) { + var embed = {}; + var value = match.value(node); + if (value != null) { + embed[match.blotName] = value; + delta = new _quillDelta2.default().insert(embed, match.formats(node)); + } + } else if (typeof match.formats === 'function') { + delta = applyFormat(delta, match.blotName, match.formats(node)); + } + return delta; +} + +function matchBreak(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + delta.insert('\n'); + } + return delta; +} + +function matchIgnore() { + return new _quillDelta2.default(); +} + +function matchIndent(node, delta) { + var match = _parchment2.default.query(node); + if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\n')) { + return delta; + } + var indent = -1, + parent = node.parentNode; + while (!parent.classList.contains('ql-clipboard')) { + if ((_parchment2.default.query(parent) || {}).blotName === 'list') { + indent += 1; + } + parent = parent.parentNode; + } + if (indent <= 0) return delta; + return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent })); +} + +function matchNewline(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) { + delta.insert('\n'); + } + } + return delta; +} + +function matchSpacing(node, delta) { + if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { + var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); + if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { + delta.insert('\n'); + } + } + return delta; +} + +function matchStyles(node, delta) { + var formats = {}; + var style = node.style || {}; + if (style.fontStyle && computeStyle(node).fontStyle === 'italic') { + formats.italic = true; + } + if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) { + formats.bold = true; + } + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + if (parseFloat(style.textIndent || 0) > 0) { + // Could be 0.5in + delta = new _quillDelta2.default().insert('\t').concat(delta); + } + return delta; +} + +function matchText(node, delta) { + var text = node.data; + // Word represents empty line with   + if (node.parentNode.tagName === 'O:P') { + return delta.insert(text.trim()); + } + if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) { + return delta; + } + if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { + // eslint-disable-next-line func-style + var replacer = function replacer(collapse, match) { + match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; + return match.length < 1 && collapse ? ' ' : match; + }; + text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); + text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace + if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { + text = text.replace(/^\s+/, replacer.bind(replacer, false)); + } + if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { + text = text.replace(/\s+$/, replacer.bind(replacer, false)); + } + } + return delta.insert(text); +} + +exports.default = Clipboard; +exports.matchAttributor = matchAttributor; +exports.matchBlot = matchBlot; +exports.matchNewline = matchNewline; +exports.matchSpacing = matchSpacing; +exports.matchText = matchText; + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Bold = function (_Inline) { + _inherits(Bold, _Inline); + + function Bold() { + _classCallCheck(this, Bold); + + return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments)); + } + + _createClass(Bold, [{ + key: 'optimize', + value: function optimize(context) { + _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context); + if (this.domNode.tagName !== this.statics.tagName[0]) { + this.replaceWith(this.statics.blotName); + } + } + }], [{ + key: 'create', + value: function create() { + return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this); + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return Bold; +}(_inline2.default); + +Bold.blotName = 'bold'; +Bold.tagName = ['STRONG', 'B']; + +exports.default = Bold; + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addControls = exports.default = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:toolbar'); + +var Toolbar = function (_Module) { + _inherits(Toolbar, _Module); + + function Toolbar(quill, options) { + _classCallCheck(this, Toolbar); + + var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options)); + + if (Array.isArray(_this.options.container)) { + var container = document.createElement('div'); + addControls(container, _this.options.container); + quill.container.parentNode.insertBefore(container, quill.container); + _this.container = container; + } else if (typeof _this.options.container === 'string') { + _this.container = document.querySelector(_this.options.container); + } else { + _this.container = _this.options.container; + } + if (!(_this.container instanceof HTMLElement)) { + var _ret; + + return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret); + } + _this.container.classList.add('ql-toolbar'); + _this.controls = []; + _this.handlers = {}; + Object.keys(_this.options.handlers).forEach(function (format) { + _this.addHandler(format, _this.options.handlers[format]); + }); + [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) { + _this.attach(input); + }); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) { + if (type === _quill2.default.events.SELECTION_CHANGE) { + _this.update(range); + } + }); + _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { + var _this$quill$selection = _this.quill.selection.getRange(), + _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), + range = _this$quill$selection2[0]; // quill.getSelection triggers update + + + _this.update(range); + }); + return _this; + } + + _createClass(Toolbar, [{ + key: 'addHandler', + value: function addHandler(format, handler) { + this.handlers[format] = handler; + } + }, { + key: 'attach', + value: function attach(input) { + var _this2 = this; + + var format = [].find.call(input.classList, function (className) { + return className.indexOf('ql-') === 0; + }); + if (!format) return; + format = format.slice('ql-'.length); + if (input.tagName === 'BUTTON') { + input.setAttribute('type', 'button'); + } + if (this.handlers[format] == null) { + if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) { + debug.warn('ignoring attaching to disabled format', format, input); + return; + } + if (_parchment2.default.query(format) == null) { + debug.warn('ignoring attaching to nonexistent format', format, input); + return; + } + } + var eventName = input.tagName === 'SELECT' ? 'change' : 'click'; + input.addEventListener(eventName, function (e) { + var value = void 0; + if (input.tagName === 'SELECT') { + if (input.selectedIndex < 0) return; + var selected = input.options[input.selectedIndex]; + if (selected.hasAttribute('selected')) { + value = false; + } else { + value = selected.value || false; + } + } else { + if (input.classList.contains('ql-active')) { + value = false; + } else { + value = input.value || !input.hasAttribute('value'); + } + e.preventDefault(); + } + _this2.quill.focus(); + + var _quill$selection$getR = _this2.quill.selection.getRange(), + _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), + range = _quill$selection$getR2[0]; + + if (_this2.handlers[format] != null) { + _this2.handlers[format].call(_this2, value); + } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) { + value = prompt('Enter ' + format); + if (!value) return; + _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER); + } else { + _this2.quill.format(format, value, _quill2.default.sources.USER); + } + _this2.update(range); + }); + // TODO use weakmap + this.controls.push([format, input]); + } + }, { + key: 'update', + value: function update(range) { + var formats = range == null ? {} : this.quill.getFormat(range); + this.controls.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + format = _pair[0], + input = _pair[1]; + + if (input.tagName === 'SELECT') { + var option = void 0; + if (range == null) { + option = null; + } else if (formats[format] == null) { + option = input.querySelector('option[selected]'); + } else if (!Array.isArray(formats[format])) { + var value = formats[format]; + if (typeof value === 'string') { + value = value.replace(/\"/g, '\\"'); + } + option = input.querySelector('option[value="' + value + '"]'); + } + if (option == null) { + input.value = ''; // TODO make configurable? + input.selectedIndex = -1; + } else { + option.selected = true; + } + } else { + if (range == null) { + input.classList.remove('ql-active'); + } else if (input.hasAttribute('value')) { + // both being null should match (default values) + // '1' should match with 1 (headers) + var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value'); + input.classList.toggle('ql-active', isActive); + } else { + input.classList.toggle('ql-active', formats[format] != null); + } + } + }); + } + }]); + + return Toolbar; +}(_module2.default); + +Toolbar.DEFAULTS = {}; + +function addButton(container, format, value) { + var input = document.createElement('button'); + input.setAttribute('type', 'button'); + input.classList.add('ql-' + format); + if (value != null) { + input.value = value; + } + container.appendChild(input); +} + +function addControls(container, groups) { + if (!Array.isArray(groups[0])) { + groups = [groups]; + } + groups.forEach(function (controls) { + var group = document.createElement('span'); + group.classList.add('ql-formats'); + controls.forEach(function (control) { + if (typeof control === 'string') { + addButton(group, control); + } else { + var format = Object.keys(control)[0]; + var value = control[format]; + if (Array.isArray(value)) { + addSelect(group, format, value); + } else { + addButton(group, format, value); + } + } + }); + container.appendChild(group); + }); +} + +function addSelect(container, format, values) { + var input = document.createElement('select'); + input.classList.add('ql-' + format); + values.forEach(function (value) { + var option = document.createElement('option'); + if (value !== false) { + option.setAttribute('value', value); + } else { + option.setAttribute('selected', 'selected'); + } + input.appendChild(option); + }); + container.appendChild(input); +} + +Toolbar.DEFAULTS = { + container: null, + handlers: { + clean: function clean() { + var _this3 = this; + + var range = this.quill.getSelection(); + if (range == null) return; + if (range.length == 0) { + var formats = this.quill.getFormat(); + Object.keys(formats).forEach(function (name) { + // Clean functionality in existing apps only clean inline formats + if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) { + _this3.quill.format(name, false); + } + }); + } else { + this.quill.removeFormat(range, _quill2.default.sources.USER); + } + }, + direction: function direction(value) { + var align = this.quill.getFormat()['align']; + if (value === 'rtl' && align == null) { + this.quill.format('align', 'right', _quill2.default.sources.USER); + } else if (!value && align === 'right') { + this.quill.format('align', false, _quill2.default.sources.USER); + } + this.quill.format('direction', value, _quill2.default.sources.USER); + }, + indent: function indent(value) { + var range = this.quill.getSelection(); + var formats = this.quill.getFormat(range); + var indent = parseInt(formats.indent || 0); + if (value === '+1' || value === '-1') { + var modifier = value === '+1' ? 1 : -1; + if (formats.direction === 'rtl') modifier *= -1; + this.quill.format('indent', indent + modifier, _quill2.default.sources.USER); + } + }, + link: function link(value) { + if (value === true) { + value = prompt('Enter link URL:'); + } + this.quill.format('link', value, _quill2.default.sources.USER); + }, + list: function list(value) { + var range = this.quill.getSelection(); + var formats = this.quill.getFormat(range); + if (value === 'check') { + if (formats['list'] === 'checked' || formats['list'] === 'unchecked') { + this.quill.format('list', false, _quill2.default.sources.USER); + } else { + this.quill.format('list', 'unchecked', _quill2.default.sources.USER); + } + } else { + this.quill.format('list', value, _quill2.default.sources.USER); + } + } + } +}; + +exports.default = Toolbar; +exports.addControls = addControls; + +/***/ }), +/* 58 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _picker = __webpack_require__(28); + +var _picker2 = _interopRequireDefault(_picker); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ColorPicker = function (_Picker) { + _inherits(ColorPicker, _Picker); + + function ColorPicker(select, label) { + _classCallCheck(this, ColorPicker); + + var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select)); + + _this.label.innerHTML = label; + _this.container.classList.add('ql-color-picker'); + [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) { + item.classList.add('ql-primary'); + }); + return _this; + } + + _createClass(ColorPicker, [{ + key: 'buildItem', + value: function buildItem(option) { + var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option); + item.style.backgroundColor = option.getAttribute('value') || ''; + return item; + } + }, { + key: 'selectItem', + value: function selectItem(item, trigger) { + _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger); + var colorLabel = this.label.querySelector('.ql-color-label'); + var value = item ? item.getAttribute('data-value') || '' : ''; + if (colorLabel) { + if (colorLabel.tagName === 'line') { + colorLabel.style.stroke = value; + } else { + colorLabel.style.fill = value; + } + } + } + }]); + + return ColorPicker; +}(_picker2.default); + +exports.default = ColorPicker; + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _picker = __webpack_require__(28); + +var _picker2 = _interopRequireDefault(_picker); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var IconPicker = function (_Picker) { + _inherits(IconPicker, _Picker); + + function IconPicker(select, icons) { + _classCallCheck(this, IconPicker); + + var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select)); + + _this.container.classList.add('ql-icon-picker'); + [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) { + item.innerHTML = icons[item.getAttribute('data-value') || '']; + }); + _this.defaultItem = _this.container.querySelector('.ql-selected'); + _this.selectItem(_this.defaultItem); + return _this; + } + + _createClass(IconPicker, [{ + key: 'selectItem', + value: function selectItem(item, trigger) { + _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger); + item = item || this.defaultItem; + this.label.innerHTML = item.innerHTML; + } + }]); + + return IconPicker; +}(_picker2.default); + +exports.default = IconPicker; + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Tooltip = function () { + function Tooltip(quill, boundsContainer) { + var _this = this; + + _classCallCheck(this, Tooltip); + + this.quill = quill; + this.boundsContainer = boundsContainer || document.body; + this.root = quill.addContainer('ql-tooltip'); + this.root.innerHTML = this.constructor.TEMPLATE; + if (this.quill.root === this.quill.scrollingContainer) { + this.quill.root.addEventListener('scroll', function () { + _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px'; + }); + } + this.hide(); + } + + _createClass(Tooltip, [{ + key: 'hide', + value: function hide() { + this.root.classList.add('ql-hidden'); + } + }, { + key: 'position', + value: function position(reference) { + var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2; + // root.scrollTop should be 0 if scrollContainer !== root + var 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'); + var containerBounds = this.boundsContainer.getBoundingClientRect(); + var rootBounds = this.root.getBoundingClientRect(); + var shift = 0; + if (rootBounds.right > containerBounds.right) { + shift = containerBounds.right - rootBounds.right; + this.root.style.left = left + shift + 'px'; + } + if (rootBounds.left < containerBounds.left) { + shift = containerBounds.left - rootBounds.left; + this.root.style.left = left + shift + 'px'; + } + if (rootBounds.bottom > containerBounds.bottom) { + var height = rootBounds.bottom - rootBounds.top; + var verticalShift = reference.bottom - reference.top + height; + this.root.style.top = top - verticalShift + 'px'; + this.root.classList.add('ql-flip'); + } + return shift; + } + }, { + key: 'show', + value: function show() { + this.root.classList.remove('ql-editing'); + this.root.classList.remove('ql-hidden'); + } + }]); + + return Tooltip; +}(); + +exports.default = Tooltip; + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _base = __webpack_require__(43); + +var _base2 = _interopRequireDefault(_base); + +var _link = __webpack_require__(27); + +var _link2 = _interopRequireDefault(_link); + +var _selection = __webpack_require__(15); + +var _icons = __webpack_require__(41); + +var _icons2 = _interopRequireDefault(_icons); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']]; + +var SnowTheme = function (_BaseTheme) { + _inherits(SnowTheme, _BaseTheme); + + function SnowTheme(quill, options) { + _classCallCheck(this, SnowTheme); + + if (options.modules.toolbar != null && options.modules.toolbar.container == null) { + options.modules.toolbar.container = TOOLBAR_CONFIG; + } + + var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options)); + + _this.quill.container.classList.add('ql-snow'); + return _this; + } + + _createClass(SnowTheme, [{ + key: 'extendToolbar', + value: function extendToolbar(toolbar) { + toolbar.container.classList.add('ql-snow'); + this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); + this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); + this.tooltip = new SnowTooltip(this.quill, this.options.bounds); + if (toolbar.container.querySelector('.ql-link')) { + this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) { + toolbar.handlers['link'].call(toolbar, !context.format.link); + }); + } + } + }]); + + return SnowTheme; +}(_base2.default); + +SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + link: function link(value) { + if (value) { + var range = this.quill.getSelection(); + if (range == null || range.length == 0) return; + var preview = this.quill.getText(range); + if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) { + preview = 'mailto:' + preview; + } + var tooltip = this.quill.theme.tooltip; + tooltip.edit('link', preview); + } else { + this.quill.format('link', false); + } + } + } + } + } +}); + +var SnowTooltip = function (_BaseTooltip) { + _inherits(SnowTooltip, _BaseTooltip); + + function SnowTooltip(quill, bounds) { + _classCallCheck(this, SnowTooltip); + + var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds)); + + _this2.preview = _this2.root.querySelector('a.ql-preview'); + return _this2; + } + + _createClass(SnowTooltip, [{ + key: 'listen', + value: function listen() { + var _this3 = this; + + _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this); + this.root.querySelector('a.ql-action').addEventListener('click', function (event) { + if (_this3.root.classList.contains('ql-editing')) { + _this3.save(); + } else { + _this3.edit('link', _this3.preview.textContent); + } + event.preventDefault(); + }); + this.root.querySelector('a.ql-remove').addEventListener('click', function (event) { + if (_this3.linkRange != null) { + var range = _this3.linkRange; + _this3.restoreFocus(); + _this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER); + delete _this3.linkRange; + } + event.preventDefault(); + _this3.hide(); + }); + this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) { + if (range == null) return; + if (range.length === 0 && source === _emitter2.default.sources.USER) { + var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + link = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (link != null) { + _this3.linkRange = new _selection.Range(range.index - offset, link.length()); + var preview = _link2.default.formats(link.domNode); + _this3.preview.textContent = preview; + _this3.preview.setAttribute('href', preview); + _this3.show(); + _this3.position(_this3.quill.getBounds(_this3.linkRange)); + return; + } + } else { + delete _this3.linkRange; + } + _this3.hide(); + }); + } + }, { + key: 'show', + value: function show() { + _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this); + this.root.removeAttribute('data-mode'); + } + }]); + + return SnowTooltip; +}(_base.BaseTooltip); + +SnowTooltip.TEMPLATE = ['', '', '', ''].join(''); + +exports.default = SnowTheme; + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _core = __webpack_require__(29); + +var _core2 = _interopRequireDefault(_core); + +var _align = __webpack_require__(36); + +var _direction = __webpack_require__(38); + +var _indent = __webpack_require__(64); + +var _blockquote = __webpack_require__(65); + +var _blockquote2 = _interopRequireDefault(_blockquote); + +var _header = __webpack_require__(66); + +var _header2 = _interopRequireDefault(_header); + +var _list = __webpack_require__(67); + +var _list2 = _interopRequireDefault(_list); + +var _background = __webpack_require__(37); + +var _color = __webpack_require__(26); + +var _font = __webpack_require__(39); + +var _size = __webpack_require__(40); + +var _bold = __webpack_require__(56); + +var _bold2 = _interopRequireDefault(_bold); + +var _italic = __webpack_require__(68); + +var _italic2 = _interopRequireDefault(_italic); + +var _link = __webpack_require__(27); + +var _link2 = _interopRequireDefault(_link); + +var _script = __webpack_require__(69); + +var _script2 = _interopRequireDefault(_script); + +var _strike = __webpack_require__(70); + +var _strike2 = _interopRequireDefault(_strike); + +var _underline = __webpack_require__(71); + +var _underline2 = _interopRequireDefault(_underline); + +var _image = __webpack_require__(72); + +var _image2 = _interopRequireDefault(_image); + +var _video = __webpack_require__(73); + +var _video2 = _interopRequireDefault(_video); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _formula = __webpack_require__(74); + +var _formula2 = _interopRequireDefault(_formula); + +var _syntax = __webpack_require__(75); + +var _syntax2 = _interopRequireDefault(_syntax); + +var _toolbar = __webpack_require__(57); + +var _toolbar2 = _interopRequireDefault(_toolbar); + +var _icons = __webpack_require__(41); + +var _icons2 = _interopRequireDefault(_icons); + +var _picker = __webpack_require__(28); + +var _picker2 = _interopRequireDefault(_picker); + +var _colorPicker = __webpack_require__(59); + +var _colorPicker2 = _interopRequireDefault(_colorPicker); + +var _iconPicker = __webpack_require__(60); + +var _iconPicker2 = _interopRequireDefault(_iconPicker); + +var _tooltip = __webpack_require__(61); + +var _tooltip2 = _interopRequireDefault(_tooltip); + +var _bubble = __webpack_require__(108); + +var _bubble2 = _interopRequireDefault(_bubble); + +var _snow = __webpack_require__(62); + +var _snow2 = _interopRequireDefault(_snow); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_core2.default.register({ + 'attributors/attribute/direction': _direction.DirectionAttribute, + + 'attributors/class/align': _align.AlignClass, + 'attributors/class/background': _background.BackgroundClass, + 'attributors/class/color': _color.ColorClass, + 'attributors/class/direction': _direction.DirectionClass, + 'attributors/class/font': _font.FontClass, + 'attributors/class/size': _size.SizeClass, + + 'attributors/style/align': _align.AlignStyle, + 'attributors/style/background': _background.BackgroundStyle, + 'attributors/style/color': _color.ColorStyle, + 'attributors/style/direction': _direction.DirectionStyle, + 'attributors/style/font': _font.FontStyle, + 'attributors/style/size': _size.SizeStyle +}, true); + +_core2.default.register({ + 'formats/align': _align.AlignClass, + 'formats/direction': _direction.DirectionClass, + 'formats/indent': _indent.IndentClass, + + 'formats/background': _background.BackgroundStyle, + 'formats/color': _color.ColorStyle, + 'formats/font': _font.FontClass, + 'formats/size': _size.SizeClass, + + 'formats/blockquote': _blockquote2.default, + 'formats/code-block': _code2.default, + 'formats/header': _header2.default, + 'formats/list': _list2.default, + + 'formats/bold': _bold2.default, + 'formats/code': _code.Code, + 'formats/italic': _italic2.default, + 'formats/link': _link2.default, + 'formats/script': _script2.default, + 'formats/strike': _strike2.default, + 'formats/underline': _underline2.default, + + 'formats/image': _image2.default, + 'formats/video': _video2.default, + + 'formats/list/item': _list.ListItem, + + 'modules/formula': _formula2.default, + 'modules/syntax': _syntax2.default, + 'modules/toolbar': _toolbar2.default, + + 'themes/bubble': _bubble2.default, + 'themes/snow': _snow2.default, + + 'ui/icons': _icons2.default, + 'ui/picker': _picker2.default, + 'ui/icon-picker': _iconPicker2.default, + 'ui/color-picker': _colorPicker2.default, + 'ui/tooltip': _tooltip2.default +}, true); + +exports.default = _core2.default; + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.IndentClass = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var IdentAttributor = function (_Parchment$Attributor) { + _inherits(IdentAttributor, _Parchment$Attributor); + + function IdentAttributor() { + _classCallCheck(this, IdentAttributor); + + return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments)); + } + + _createClass(IdentAttributor, [{ + key: 'add', + value: function add(node, value) { + if (value === '+1' || value === '-1') { + var indent = this.value(node) || 0; + value = value === '+1' ? indent + 1 : indent - 1; + } + if (value === 0) { + this.remove(node); + return true; + } else { + return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value); + } + } + }, { + key: 'canAdd', + value: function canAdd(node, value) { + return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value)); + } + }, { + key: 'value', + value: function value(node) { + return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN + } + }]); + + return IdentAttributor; +}(_parchment2.default.Attributor.Class); + +var IndentClass = new IdentAttributor('indent', 'ql-indent', { + scope: _parchment2.default.Scope.BLOCK, + whitelist: [1, 2, 3, 4, 5, 6, 7, 8] +}); + +exports.IndentClass = IndentClass; + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Blockquote = function (_Block) { + _inherits(Blockquote, _Block); + + function Blockquote() { + _classCallCheck(this, Blockquote); + + return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments)); + } + + return Blockquote; +}(_block2.default); + +Blockquote.blotName = 'blockquote'; +Blockquote.tagName = 'blockquote'; + +exports.default = Blockquote; + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Header = function (_Block) { + _inherits(Header, _Block); + + function Header() { + _classCallCheck(this, Header); + + return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments)); + } + + _createClass(Header, null, [{ + key: 'formats', + value: function formats(domNode) { + return this.tagName.indexOf(domNode.tagName) + 1; + } + }]); + + return Header; +}(_block2.default); + +Header.blotName = 'header'; +Header.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6']; + +exports.default = Header; + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.ListItem = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _container = __webpack_require__(25); + +var _container2 = _interopRequireDefault(_container); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ListItem = function (_Block) { + _inherits(ListItem, _Block); + + function ListItem() { + _classCallCheck(this, ListItem); + + return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments)); + } + + _createClass(ListItem, [{ + key: 'format', + value: function format(name, value) { + if (name === List.blotName && !value) { + this.replaceWith(_parchment2.default.create(this.statics.scope)); + } else { + _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value); + } + } + }, { + key: 'remove', + value: function remove() { + if (this.prev == null && this.next == null) { + this.parent.remove(); + } else { + _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this); + } + } + }, { + key: 'replaceWith', + value: function replaceWith(name, value) { + this.parent.isolate(this.offset(this.parent), this.length()); + if (name === this.parent.statics.blotName) { + this.parent.replaceWith(name, value); + return this; + } else { + this.parent.unwrap(); + return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value); + } + } + }], [{ + key: 'formats', + value: function formats(domNode) { + return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode); + } + }]); + + return ListItem; +}(_block2.default); + +ListItem.blotName = 'list-item'; +ListItem.tagName = 'LI'; + +var List = function (_Container) { + _inherits(List, _Container); + + _createClass(List, null, [{ + key: 'create', + value: function create(value) { + var tagName = value === 'ordered' ? 'OL' : 'UL'; + var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName); + if (value === 'checked' || value === 'unchecked') { + node.setAttribute('data-checked', value === 'checked'); + } + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + if (domNode.tagName === 'OL') return 'ordered'; + if (domNode.tagName === 'UL') { + if (domNode.hasAttribute('data-checked')) { + return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked'; + } else { + return 'bullet'; + } + } + return undefined; + } + }]); + + function List(domNode) { + _classCallCheck(this, List); + + var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode)); + + var listEventHandler = function listEventHandler(e) { + if (e.target.parentNode !== domNode) return; + var format = _this2.statics.formats(domNode); + var blot = _parchment2.default.find(e.target); + if (format === 'checked') { + blot.format('list', 'unchecked'); + } else if (format === 'unchecked') { + blot.format('list', 'checked'); + } + }; + + domNode.addEventListener('touchstart', listEventHandler); + domNode.addEventListener('mousedown', listEventHandler); + return _this2; + } + + _createClass(List, [{ + key: 'format', + value: function format(name, value) { + if (this.children.length > 0) { + this.children.tail.format(name, value); + } + } + }, { + key: 'formats', + value: function formats() { + // We don't inherit from FormatBlot + return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode)); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot instanceof ListItem) { + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref); + } else { + var index = ref == null ? this.length() : ref.offset(this); + var after = this.split(index); + after.parent.insertBefore(blot, after); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) { + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + if (target.statics.blotName !== this.statics.blotName) { + var item = _parchment2.default.create(this.statics.defaultChild); + target.moveChildren(item); + this.appendChild(item); + } + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target); + } + }]); + + return List; +}(_container2.default); + +List.blotName = 'list'; +List.scope = _parchment2.default.Scope.BLOCK_BLOT; +List.tagName = ['OL', 'UL']; +List.defaultChild = 'list-item'; +List.allowedChildren = [ListItem]; + +exports.ListItem = ListItem; +exports.default = List; + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _bold = __webpack_require__(56); + +var _bold2 = _interopRequireDefault(_bold); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Italic = function (_Bold) { + _inherits(Italic, _Bold); + + function Italic() { + _classCallCheck(this, Italic); + + return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments)); + } + + return Italic; +}(_bold2.default); + +Italic.blotName = 'italic'; +Italic.tagName = ['EM', 'I']; + +exports.default = Italic; + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Script = function (_Inline) { + _inherits(Script, _Inline); + + function Script() { + _classCallCheck(this, Script); + + return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments)); + } + + _createClass(Script, null, [{ + key: 'create', + value: function create(value) { + if (value === 'super') { + return document.createElement('sup'); + } else if (value === 'sub') { + return document.createElement('sub'); + } else { + return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value); + } + } + }, { + key: 'formats', + value: function formats(domNode) { + if (domNode.tagName === 'SUB') return 'sub'; + if (domNode.tagName === 'SUP') return 'super'; + return undefined; + } + }]); + + return Script; +}(_inline2.default); + +Script.blotName = 'script'; +Script.tagName = ['SUB', 'SUP']; + +exports.default = Script; + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Strike = function (_Inline) { + _inherits(Strike, _Inline); + + function Strike() { + _classCallCheck(this, Strike); + + return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments)); + } + + return Strike; +}(_inline2.default); + +Strike.blotName = 'strike'; +Strike.tagName = 'S'; + +exports.default = Strike; + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Underline = function (_Inline) { + _inherits(Underline, _Inline); + + function Underline() { + _classCallCheck(this, Underline); + + return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments)); + } + + return Underline; +}(_inline2.default); + +Underline.blotName = 'underline'; +Underline.tagName = 'U'; + +exports.default = Underline; + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _link = __webpack_require__(27); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ATTRIBUTES = ['alt', 'height', 'width']; + +var Image = function (_Parchment$Embed) { + _inherits(Image, _Parchment$Embed); + + function Image() { + _classCallCheck(this, Image); + + return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments)); + } + + _createClass(Image, [{ + key: 'format', + value: function format(name, value) { + if (ATTRIBUTES.indexOf(name) > -1) { + if (value) { + this.domNode.setAttribute(name, value); + } else { + this.domNode.removeAttribute(name); + } + } else { + _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value); + } + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value); + if (typeof value === 'string') { + node.setAttribute('src', this.sanitize(value)); + } + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return ATTRIBUTES.reduce(function (formats, attribute) { + if (domNode.hasAttribute(attribute)) { + formats[attribute] = domNode.getAttribute(attribute); + } + return formats; + }, {}); + } + }, { + key: 'match', + value: function match(url) { + return (/\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url) + ); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0'; + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('src'); + } + }]); + + return Image; +}(_parchment2.default.Embed); + +Image.blotName = 'image'; +Image.tagName = 'IMG'; + +exports.default = Image; + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _block = __webpack_require__(4); + +var _link = __webpack_require__(27); + +var _link2 = _interopRequireDefault(_link); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ATTRIBUTES = ['height', 'width']; + +var Video = function (_BlockEmbed) { + _inherits(Video, _BlockEmbed); + + function Video() { + _classCallCheck(this, Video); + + return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments)); + } + + _createClass(Video, [{ + key: 'format', + value: function format(name, value) { + if (ATTRIBUTES.indexOf(name) > -1) { + if (value) { + this.domNode.setAttribute(name, value); + } else { + this.domNode.removeAttribute(name); + } + } else { + _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value); + } + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value); + node.setAttribute('frameborder', '0'); + node.setAttribute('allowfullscreen', true); + node.setAttribute('src', this.sanitize(value)); + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return ATTRIBUTES.reduce(function (formats, attribute) { + if (domNode.hasAttribute(attribute)) { + formats[attribute] = domNode.getAttribute(attribute); + } + return formats; + }, {}); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return _link2.default.sanitize(url); + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('src'); + } + }]); + + return Video; +}(_block.BlockEmbed); + +Video.blotName = 'video'; +Video.className = 'ql-video'; +Video.tagName = 'IFRAME'; + +exports.default = Video; + +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.FormulaBlot = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _embed = __webpack_require__(35); + +var _embed2 = _interopRequireDefault(_embed); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var FormulaBlot = function (_Embed) { + _inherits(FormulaBlot, _Embed); + + function FormulaBlot() { + _classCallCheck(this, FormulaBlot); + + return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments)); + } + + _createClass(FormulaBlot, null, [{ + key: 'create', + value: function create(value) { + var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value); + if (typeof value === 'string') { + window.katex.render(value, node, { + throwOnError: false, + errorColor: '#f00' + }); + node.setAttribute('data-value', value); + } + return node; + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('data-value'); + } + }]); + + return FormulaBlot; +}(_embed2.default); + +FormulaBlot.blotName = 'formula'; +FormulaBlot.className = 'ql-formula'; +FormulaBlot.tagName = 'SPAN'; + +var Formula = function (_Module) { + _inherits(Formula, _Module); + + _createClass(Formula, null, [{ + key: 'register', + value: function register() { + _quill2.default.register(FormulaBlot, true); + } + }]); + + function Formula() { + _classCallCheck(this, Formula); + + var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this)); + + if (window.katex == null) { + throw new Error('Formula module requires KaTeX.'); + } + return _this2; + } + + return Formula; +}(_module2.default); + +exports.FormulaBlot = FormulaBlot; +exports.default = Formula; + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.CodeToken = exports.CodeBlock = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var SyntaxCodeBlock = function (_CodeBlock) { + _inherits(SyntaxCodeBlock, _CodeBlock); + + function SyntaxCodeBlock() { + _classCallCheck(this, SyntaxCodeBlock); + + return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments)); + } + + _createClass(SyntaxCodeBlock, [{ + key: 'replaceWith', + value: function replaceWith(block) { + this.domNode.textContent = this.domNode.textContent; + this.attach(); + _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block); + } + }, { + key: 'highlight', + value: function highlight(_highlight) { + var text = this.domNode.textContent; + if (this.cachedText !== text) { + if (text.trim().length > 0 || this.cachedText == null) { + this.domNode.innerHTML = _highlight(text); + this.domNode.normalize(); + this.attach(); + } + this.cachedText = text; + } + } + }]); + + return SyntaxCodeBlock; +}(_code2.default); + +SyntaxCodeBlock.className = 'ql-syntax'; + +var CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', { + scope: _parchment2.default.Scope.INLINE +}); + +var Syntax = function (_Module) { + _inherits(Syntax, _Module); + + _createClass(Syntax, null, [{ + key: 'register', + value: function register() { + _quill2.default.register(CodeToken, true); + _quill2.default.register(SyntaxCodeBlock, true); + } + }]); + + function Syntax(quill, options) { + _classCallCheck(this, Syntax); + + var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options)); + + if (typeof _this2.options.highlight !== 'function') { + throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.'); + } + var timer = null; + _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { + clearTimeout(timer); + timer = setTimeout(function () { + _this2.highlight(); + timer = null; + }, _this2.options.interval); + }); + _this2.highlight(); + return _this2; + } + + _createClass(Syntax, [{ + key: 'highlight', + value: function highlight() { + var _this3 = this; + + if (this.quill.selection.composing) return; + this.quill.update(_quill2.default.sources.USER); + var range = this.quill.getSelection(); + this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) { + code.highlight(_this3.options.highlight); + }); + this.quill.update(_quill2.default.sources.SILENT); + if (range != null) { + this.quill.setSelection(range, _quill2.default.sources.SILENT); + } + } + }]); + + return Syntax; +}(_module2.default); + +Syntax.DEFAULTS = { + highlight: function () { + if (window.hljs == null) return null; + return function (text) { + var result = window.hljs.highlightAuto(text); + return result.value; + }; + }(), + interval: 1000 +}; + +exports.CodeBlock = SyntaxCodeBlock; +exports.CodeToken = CodeToken; +exports.default = Syntax; + +/***/ }), +/* 76 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 77 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 78 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 79 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 80 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 81 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 82 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 83 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 84 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 85 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 86 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 87 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 88 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 89 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 90 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 91 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 92 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 93 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 94 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 95 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 96 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 97 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 98 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 99 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 100 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 101 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 102 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 103 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 104 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 105 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 106 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 107 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BubbleTooltip = undefined; + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _base = __webpack_require__(43); + +var _base2 = _interopRequireDefault(_base); + +var _selection = __webpack_require__(15); + +var _icons = __webpack_require__(41); + +var _icons2 = _interopRequireDefault(_icons); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']]; + +var BubbleTheme = function (_BaseTheme) { + _inherits(BubbleTheme, _BaseTheme); + + function BubbleTheme(quill, options) { + _classCallCheck(this, BubbleTheme); + + if (options.modules.toolbar != null && options.modules.toolbar.container == null) { + options.modules.toolbar.container = TOOLBAR_CONFIG; + } + + var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options)); + + _this.quill.container.classList.add('ql-bubble'); + return _this; + } + + _createClass(BubbleTheme, [{ + key: 'extendToolbar', + value: function extendToolbar(toolbar) { + this.tooltip = new BubbleTooltip(this.quill, this.options.bounds); + this.tooltip.root.appendChild(toolbar.container); + this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); + this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); + } + }]); + + return BubbleTheme; +}(_base2.default); + +BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + link: function link(value) { + if (!value) { + this.quill.format('link', false); + } else { + this.quill.theme.tooltip.edit(); + } + } + } + } + } +}); + +var BubbleTooltip = function (_BaseTooltip) { + _inherits(BubbleTooltip, _BaseTooltip); + + function BubbleTooltip(quill, bounds) { + _classCallCheck(this, BubbleTooltip); + + var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds)); + + _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) { + if (type !== _emitter2.default.events.SELECTION_CHANGE) return; + if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) { + _this2.show(); + // Lock our width so we will expand beyond our offsetParent boundaries + _this2.root.style.left = '0px'; + _this2.root.style.width = ''; + _this2.root.style.width = _this2.root.offsetWidth + 'px'; + var lines = _this2.quill.getLines(range.index, range.length); + if (lines.length === 1) { + _this2.position(_this2.quill.getBounds(range)); + } else { + var lastLine = lines[lines.length - 1]; + var index = _this2.quill.getIndex(lastLine); + var length = Math.min(lastLine.length() - 1, range.index + range.length - index); + var _bounds = _this2.quill.getBounds(new _selection.Range(index, length)); + _this2.position(_bounds); + } + } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) { + _this2.hide(); + } + }); + return _this2; + } + + _createClass(BubbleTooltip, [{ + key: 'listen', + value: function listen() { + var _this3 = this; + + _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this); + this.root.querySelector('.ql-close').addEventListener('click', function () { + _this3.root.classList.remove('ql-editing'); + }); + this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () { + // Let selection be restored by toolbar handlers before repositioning + setTimeout(function () { + if (_this3.root.classList.contains('ql-hidden')) return; + var range = _this3.quill.getSelection(); + if (range != null) { + _this3.position(_this3.quill.getBounds(range)); + } + }, 1); + }); + } + }, { + key: 'cancel', + value: function cancel() { + this.show(); + } + }, { + key: 'position', + value: function position(reference) { + var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference); + var arrow = this.root.querySelector('.ql-tooltip-arrow'); + arrow.style.marginLeft = ''; + if (shift === 0) return shift; + arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px'; + } + }]); + + return BubbleTooltip; +}(_base.BaseTooltip); + +BubbleTooltip.TEMPLATE = ['', '
    ', '', '', '
    '].join(''); + +exports.BubbleTooltip = BubbleTooltip; +exports.default = BubbleTheme; + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(63); + + +/***/ }) +/******/ ])["default"]; +}); \ No newline at end of file diff -Nru bibledit-5.0.912/quill/1.3.6/quill.min.js bibledit-5.0.922/quill/1.3.6/quill.min.js --- bibledit-5.0.912/quill/1.3.6/quill.min.js 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.3.6/quill.min.js 2018-03-12 06:39:22.000000000 +0000 @@ -0,0 +1,8 @@ +/*! + * Quill Editor v1.3.6 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Quill=e():t.Quill=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=45)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17),o=n(18),i=n(19),l=n(48),a=n(49),s=n(50),u=n(51),c=n(52),f=n(11),h=n(29),p=n(30),d=n(28),y=n(1),v={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:r.default,Format:o.default,Leaf:i.default,Embed:u.default,Scroll:l.default,Block:s.default,Inline:a.default,Text:c.default,Attributor:{Attribute:f.default,Class:h.default,Style:p.default,Store:d.default}};e.default=v},function(t,e,n){"use strict";function r(t,e){var n=i(t);if(null==n)throw new s("Unable to create "+t+" blot");var r=n;return new r(t instanceof Node||t.nodeType===Node.TEXT_NODE?t:r.create(e),e)}function o(t,n){return void 0===n&&(n=!1),null==t?null:null!=t[e.DATA_KEY]?t[e.DATA_KEY].blot:n?o(t.parentNode,n):null}function i(t,e){void 0===e&&(e=p.ANY);var n;if("string"==typeof t)n=h[t]||u[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)n=h.text;else if("number"==typeof t)t&p.LEVEL&p.BLOCK?n=h.block:t&p.LEVEL&p.INLINE&&(n=h.inline);else if(t instanceof HTMLElement){var r=(t.getAttribute("class")||"").split(/\s+/);for(var o in r)if(n=c[r[o]])break;n=n||f[t.tagName]}return null==n?null:e&p.LEVEL&n.scope&&e&p.TYPE&n.scope?n:null}function l(){for(var t=[],e=0;e1)return t.map(function(t){return l(t)});var n=t[0];if("string"!=typeof n.blotName&&"string"!=typeof n.attrName)throw new s("Invalid definition");if("abstract"===n.blotName)throw new s("Cannot register abstract class");if(h[n.blotName||n.attrName]=n,"string"==typeof n.keyName)u[n.keyName]=n;else if(null!=n.className&&(c[n.className]=n),null!=n.tagName){Array.isArray(n.tagName)?n.tagName=n.tagName.map(function(t){return t.toUpperCase()}):n.tagName=n.tagName.toUpperCase();var r=Array.isArray(n.tagName)?n.tagName:[n.tagName];r.forEach(function(t){null!=f[t]&&null!=n.className||(f[t]=n)})}return n}var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){function e(e){var n=this;return e="[Parchment] "+e,n=t.call(this,e)||this,n.message=e,n.name=n.constructor.name,n}return a(e,t),e}(Error);e.ParchmentError=s;var u={},c={},f={},h={};e.DATA_KEY="__blot";var p;!function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(p=e.Scope||(e.Scope={})),e.create=r,e.find=o,e.query=i,e.register=l},function(t,e){"use strict";var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===r.call(t)},i=function(t){if(!t||"[object Object]"!==r.call(t))return!1;var e=n.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!e&&!o)return!1;var i;for(i in t);return void 0===i||n.call(t,i)};t.exports=function t(){var e,n,r,l,a,s,u=arguments[0],c=1,f=arguments.length,h=!1;for("boolean"==typeof u&&(h=u,u=arguments[1]||{},c=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});c1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=(0,f.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:a(t.parent,e))}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BlockEmbed=e.bubbleFormats=void 0;var s=function(){function t(t,e){for(var n=0;n0&&(t1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-1)){var r=this.clone();return 0===t?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"split",this).call(this,t,n);return this.cache={},o}}]),e}(y.default.Block);x.blotName="block",x.tagName="P",x.defaultChild="break",x.allowedChildren=[m.default,y.default.Embed,O.default],e.bubbleFormats=a,e.BlockEmbed=w,e.default=x},function(t,e,n){var r=n(54),o=n(12),i=n(2),l=n(20),a=String.fromCharCode(0),s=function(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]};s.prototype.insert=function(t,e){var n={};return 0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},s.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},s.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},s.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=i(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,"object"!=typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(o(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},s.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},s.prototype.filter=function(t){return this.ops.filter(t)},s.prototype.forEach=function(t){this.ops.forEach(t)},s.prototype.map=function(t){return this.ops.map(t)},s.prototype.partition=function(t){var e=[],n=[];return this.forEach(function(r){(t(r)?e:n).push(r)}),[e,n]},s.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},s.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+l.length(e):e.delete?t-e.delete:t},0)},s.prototype.length=function(){return this.reduce(function(t,e){return t+l.length(e)},0)},s.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var n=[],r=l.iterator(this.ops),o=0;o0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},s.prototype.diff=function(t,e){if(this.ops===t.ops)return new s;var n=[this,t].map(function(e){return e.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:a;var r=e===t?"on":"with";throw new Error("diff() called "+r+" non-document")}).join("")}),i=new s,u=r(n[0],n[1],e),c=l.iterator(this.ops),f=l.iterator(t.ops);return u.forEach(function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case r.INSERT:n=Math.min(f.peekLength(),e),i.push(f.next(n));break;case r.DELETE:n=Math.min(e,c.peekLength()),c.next(n),i.delete(n);break;case r.EQUAL:n=Math.min(c.peekLength(),f.peekLength(),e);var a=c.next(n),s=f.next(n);o(a.insert,s.insert)?i.retain(n,l.attributes.diff(a.attributes,s.attributes)):i.push(s).delete(n)}e-=n}}),i.chop()},s.prototype.eachLine=function(t,e){e=e||"\n";for(var n=l.iterator(this.ops),r=new s,o=0;n.hasNext();){if("insert"!==n.peekType())return;var i=n.peek(),a=l.length(i)-n.peekLength(),u="string"==typeof i.insert?i.insert.indexOf(e,a)-a:-1;if(u<0)r.push(n.next());else if(u>0)r.push(n.next(u));else{if(!1===t(r,n.next(1).attributes||{},o))return;o+=1,r=new s}}r.length()>0&&t(r,{},o)},s.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=l.iterator(this.ops),r=l.iterator(t.ops),o=new s;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())o.push(r.next());else{var i=Math.min(n.peekLength(),r.peekLength()),a=n.next(i),u=r.next(i);if(a.delete)continue;u.delete?o.push(u):o.retain(i,l.attributes.transform(a.attributes,u.attributes,e))}else o.retain(l.length(n.next()));return o.chop()},s.prototype.transformPosition=function(t,e){e=!!e;for(var n=l.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(t,n){var r=e.order.indexOf(t),o=e.order.indexOf(n);return r>=0||o>=0?r-o:t===n?0:t0){var a,s=[g.default.events.TEXT_CHANGE,l,i,e];if((a=this.emitter).emit.apply(a,[g.default.events.EDITOR_CHANGE].concat(s)),e!==g.default.sources.SILENT){var c;(c=this.emitter).emit.apply(c,s)}}return l}function s(t,e,n,r,o){var i={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(o=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(o=r,r=n,n=e,e=0),"object"===(void 0===n?"undefined":c(n))?(i=n,o=r):"string"==typeof n&&(null!=r?i[n]=r:o=n),o=o||g.default.sources.API,[t,e,i,o]}function u(t,e,n,r){if(null==t)return null;var o=void 0,i=void 0;if(e instanceof d.default){var l=[t.index,t.index+t.length].map(function(t){return e.transformPosition(t,r!==g.default.sources.USER)}),a=f(l,2);o=a[0],i=a[1]}else{var s=[t.index,t.index+t.length].map(function(t){return t=0?t+n:Math.max(e,t+n)}),u=f(s,2);o=u[0],i=u[1]}return new x.Range(o,i-o)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=void 0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(i(this,t),this.options=l(e,r),this.container=this.options.container,null==this.container)return P.error("Invalid Quill container",e);this.options.debug&&t.debug(this.options.debug);var o=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new g.default,this.scroll=w.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new v.default(this.scroll),this.selection=new k.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(g.default.events.EDITOR_CHANGE,function(t){t===g.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(g.default.events.SCROLL_UPDATE,function(t,e){var r=n.selection.lastRange,o=r&&0===r.length?r.index:void 0;a.call(n,function(){return n.editor.update(null,e,o)},t)});var s=this.clipboard.convert("
    "+o+"


    ");this.setContents(s),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return h(t,null,[{key:"debug",value:function(t){!0===t&&(t="log"),A.default.level(t)}},{key:"find",value:function(t){return t.__quill||w.default.find(t)}},{key:"import",value:function(t){return null==this.imports[t]&&P.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){var o=t.attrName||t.blotName;"string"==typeof o?this.register("formats/"+o,t,e):Object.keys(t).forEach(function(r){n.register(r,t[r],e)})}else null==this.imports[t]||r||P.warn("Overwriting "+t+" with",e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName?w.default.register(e):t.startsWith("modules")&&"function"==typeof e.register&&e.register()}}]),h(t,[{key:"addContainer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){var n=t;t=document.createElement("div"),t.classList.add(n)}return this.container.insertBefore(t,e),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,n){var r=this,o=s(t,e,n),i=f(o,4);return t=i[0],e=i[1],n=i[3],a.call(this,function(){return r.editor.deleteText(t,e)},n,t,-1*e)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}},{key:"focus",value:function(){var t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}},{key:"format",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g.default.sources.API;return a.call(this,function(){var r=n.getSelection(!0),i=new d.default;if(null==r)return i;if(w.default.query(t,w.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,o({},t,e));else{if(0===r.length)return n.selection.format(t,e),i;i=n.editor.formatText(r.index,r.length,o({},t,e))}return n.setSelection(r,g.default.sources.SILENT),i},r)}},{key:"formatLine",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,e,n,r,o),c=f(u,4);return t=c[0],e=c[1],l=c[2],o=c[3],a.call(this,function(){return i.editor.formatLine(t,e,l)},o,t,0)}},{key:"formatText",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,e,n,r,o),c=f(u,4);return t=c[0],e=c[1],l=c[2],o=c[3],a.call(this,function(){return i.editor.formatText(t,e,l)},o,t,0)}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=void 0;n="number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:"getContents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=s(t,e),r=f(n,2);return t=r[0],e=r[1],this.editor.getContents(t,e)}},{key:"getFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}},{key:"getIndex",value:function(t){return t.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(t){return this.scroll.leaf(t)}},{key:"getLine",value:function(t){return this.scroll.line(t)}},{key:"getLines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=s(t,e),r=f(n,2);return t=r[0],e=r[1],this.editor.getText(t,e)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.sources.API;return a.call(this,function(){return o.editor.insertEmbed(e,n,r)},i,e)}},{key:"insertText",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,0,n,r,o),c=f(u,4);return t=c[0],l=c[2],o=c[3],a.call(this,function(){return i.editor.insertText(t,e,l)},o,t,e.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}},{key:"removeFormat",value:function(t,e,n){var r=this,o=s(t,e,n),i=f(o,4);return t=i[0],e=i[1],n=i[3],a.call(this,function(){return r.editor.removeFormat(t,e)},n,t)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API;return a.call(this,function(){t=new d.default(t);var n=e.getLength(),r=e.editor.deleteText(0,n),o=e.editor.applyDelta(t),i=o.ops[o.ops.length-1];return null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(e.editor.deleteText(e.getLength()-1,1),o.delete(1)),r.compose(o)},n)}},{key:"setSelection",value:function(e,n,r){if(null==e)this.selection.setRange(null,n||t.sources.API);else{var o=s(e,n,r),i=f(o,4);e=i[0],n=i[1],r=i[3],this.selection.setRange(new x.Range(e,n),r),r!==g.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API,n=(new d.default).insert(t);return this.setContents(n,e)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.default.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}},{key:"updateContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API;return a.call(this,function(){return t=new d.default(t),e.editor.applyDelta(t,n)},n,!0)}}]),t}();S.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},S.events=g.default.events,S.sources=g.default.sources,S.version="1.3.6",S.imports={delta:d.default,parchment:w.default,"core/module":_.default,"core/theme":T.default},e.expandConfig=l,e.overload=s,e.default=S},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),this.quill=e,this.options=n};o.DEFAULTS={},e.default=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=n(0),a=function(t){return t&&t.__esModule?t:{default:t}}(l),s=function(t){function e(){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),e}(a.default.Text);e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n1?e-1:0),r=1;r1?n-1:0),o=1;o-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=o},function(t,e,n){function r(t){return null===t||void 0===t}function o(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function i(t,e,n){var i,c;if(r(t)||r(e))return!1;if(t.prototype!==e.prototype)return!1;if(s(t))return!!s(e)&&(t=l.call(t),e=l.call(e),u(t,e,n));if(o(t)){if(!o(e))return!1;if(t.length!==e.length)return!1;for(i=0;i=0;i--)if(f[i]!=h[i])return!1;for(i=f.length-1;i>=0;i--)if(c=f[i],!u(t[c],e[c],n))return!1;return typeof t==typeof e}var l=Array.prototype.slice,a=n(55),s=n(56),u=t.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:i(t,e,n))}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function t(t,e){for(var n=0;n=t+n)){var l=this.newlineIndex(t,!0)+1,a=i-l+1,s=this.isolate(l,a),u=s.next;s.format(r,o),u instanceof e&&u.formatAt(0,t-l+n-a,r,o)}}}},{key:"insertAt",value:function(t,e,n){if(null==n){var r=this.descendant(m.default,t),o=a(r,2),i=o[0],l=o[1];i.insertAt(l,e)}}},{key:"length",value:function(){var t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}},{key:"newlineIndex",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var e=this.domNode.textContent.slice(t).indexOf("\n");return e>-1?t+e:-1}},{key:"optimize",value:function(t){this.domNode.textContent.endsWith("\n")||this.appendChild(p.default.create("text","\n")),u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(t),n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(t){var e=p.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof p.default.Embed?e.remove():e.unwrap()})}}],[{key:"create",value:function(t){var n=u(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),e}(y.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",e.Code=_,e.default=O},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n-1}Object.defineProperty(e,"__esModule",{value:!0}),e.sanitize=e.default=void 0;var a=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(t!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":l(Event))){var r=document.createEvent("Event");r.initEvent("change",!0,!0),this.select.dispatchEvent(r)}this.close()}}},{key:"update",value:function(){var t=void 0;if(this.select.selectedIndex>-1){var e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);var n=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),t}();e.default=p},function(t,e,n){"use strict";function r(t){var e=a.find(t);if(null==e)try{e=a.create(t)}catch(n){e=a.create(a.Scope.INLINE),[].slice.call(t.childNodes).forEach(function(t){e.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(e.domNode,t),e.attach()}return e}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(47),l=n(27),a=n(1),s=function(t){function e(e){var n=t.call(this,e)||this;return n.build(),n}return o(e,t),e.prototype.appendChild=function(t){this.insertBefore(t)},e.prototype.attach=function(){t.prototype.attach.call(this),this.children.forEach(function(t){t.attach()})},e.prototype.build=function(){var t=this;this.children=new i.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(e){try{var n=r(e);t.insertBefore(n,t.children.head||void 0)}catch(t){if(t instanceof a.ParchmentError)return;throw t}})},e.prototype.deleteAt=function(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,function(t,e,n){t.deleteAt(e,n)})},e.prototype.descendant=function(t,n){var r=this.children.find(n),o=r[0],i=r[1];return null==t.blotName&&t(o)||null!=t.blotName&&o instanceof t?[o,i]:o instanceof e?o.descendant(t,i):[null,-1]},e.prototype.descendants=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE);var o=[],i=r;return this.children.forEachAt(n,r,function(n,r,l){(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&o.push(n),n instanceof e&&(o=o.concat(n.descendants(t,r,i))),i-=l}),o},e.prototype.detach=function(){this.children.forEach(function(t){t.detach()}),t.prototype.detach.call(this)},e.prototype.formatAt=function(t,e,n,r){this.children.forEachAt(t,e,function(t,e,o){t.formatAt(e,o,n,r)})},e.prototype.insertAt=function(t,e,n){var r=this.children.find(t),o=r[0],i=r[1];if(o)o.insertAt(i,e,n);else{var l=null==n?a.create("text",e):a.create(e,n);this.appendChild(l)}},e.prototype.insertBefore=function(t,e){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(e){return t instanceof e}))throw new a.ParchmentError("Cannot insert "+t.statics.blotName+" into "+this.statics.blotName);t.insertInto(this,e)},e.prototype.length=function(){return this.children.reduce(function(t,e){return t+e.length()},0)},e.prototype.moveChildren=function(t,e){this.children.forEach(function(n){t.insertBefore(n,e)})},e.prototype.optimize=function(e){if(t.prototype.optimize.call(this,e),0===this.children.length)if(null!=this.statics.defaultChild){var n=a.create(this.statics.defaultChild);this.appendChild(n),n.optimize(e)}else this.remove()},e.prototype.path=function(t,n){void 0===n&&(n=!1);var r=this.children.find(t,n),o=r[0],i=r[1],l=[[this,t]];return o instanceof e?l.concat(o.path(i,n)):(null!=o&&l.push([o,i]),l)},e.prototype.removeChild=function(t){this.children.remove(t)},e.prototype.replace=function(n){n instanceof e&&n.moveChildren(this),t.prototype.replace.call(this,n)},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(t,this.length(),function(t,r,o){t=t.split(r,e),n.appendChild(t)}),n},e.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},e.prototype.update=function(t,e){var n=this,o=[],i=[];t.forEach(function(t){t.target===n.domNode&&"childList"===t.type&&(o.push.apply(o,t.addedNodes),i.push.apply(i,t.removedNodes))}),i.forEach(function(t){if(!(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var e=a.find(t);null!=e&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==n.domNode||e.detach())}}),o.filter(function(t){return t.parentNode==n.domNode}).sort(function(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(t){var e=null;null!=t.nextSibling&&(e=a.find(t.nextSibling));var o=r(t);o.next==e&&null!=o.next||(null!=o.parent&&o.parent.removeChild(n),n.insertBefore(o,e||void 0))})},e}(l.default);e.default=s},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(11),i=n(28),l=n(17),a=n(1),s=function(t){function e(e){var n=t.call(this,e)||this;return n.attributes=new i.default(n.domNode),n}return r(e,t),e.formats=function(t){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)},e.prototype.format=function(t,e){var n=a.query(t);n instanceof o.default?this.attributes.attribute(n,e):e&&(null==n||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e))},e.prototype.formats=function(){var t=this.attributes.values(),e=this.statics.formats(this.domNode);return null!=e&&(t[this.statics.blotName]=e),t},e.prototype.replaceWith=function(e,n){var r=t.prototype.replaceWith.call(this,e,n);return this.attributes.copy(r),r},e.prototype.update=function(e,n){var r=this;t.prototype.update.call(this,e,n),e.some(function(t){return t.target===r.domNode&&"attributes"===t.type})&&this.attributes.build()},e.prototype.wrap=function(n,r){var o=t.prototype.wrap.call(this,n,r);return o instanceof e&&o.statics.scope===this.statics.scope&&this.attributes.move(o),o},e}(l.default);e.default=s},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(27),i=n(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.value=function(t){return!0},e.prototype.index=function(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1},e.prototype.position=function(t,e){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){return t={},t[this.statics.blotName]=this.statics.value(this.domNode)||!0,t;var t},e.scope=i.Scope.INLINE_BLOT,e}(o.default);e.default=l},function(t,e,n){function r(t){this.ops=t,this.index=0,this.offset=0}var o=n(12),i=n(2),l={attributes:{compose:function(t,e,n){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var r=i(!0,{},e);n||(r=Object.keys(r).reduce(function(t,e){return null!=r[e]&&(t[e]=r[e]),t},{}));for(var o in t)void 0!==t[o]&&void 0===e[o]&&(r[o]=t[o]);return Object.keys(r).length>0?r:void 0},diff:function(t,e){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce(function(n,r){return o(t[r],e[r])||(n[r]=void 0===e[r]?null:e[r]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce(function(n,r){return void 0===t[r]&&(n[r]=e[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(t){return new r(t)},length:function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}};r.prototype.hasNext=function(){return this.peekLength()<1/0},r.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=l.length(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(n,t):o.insert=e.insert,o}return{retain:1/0}},r.prototype.peek=function(){return this.ops[this.index]},r.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},r.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.exports=l},function(t,e){var n=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}function e(n,r,o,i,c){function f(n,o){if(null===n)return null;if(0===o)return n;var y,v;if("object"!=typeof n)return n;if(t(n,a))y=new a;else if(t(n,s))y=new s;else if(t(n,u))y=new u(function(t,e){n.then(function(e){t(f(e,o-1))},function(t){e(f(t,o-1))})});else if(e.__isArray(n))y=[];else if(e.__isRegExp(n))y=new RegExp(n.source,l(n)),n.lastIndex&&(y.lastIndex=n.lastIndex);else if(e.__isDate(n))y=new Date(n.getTime());else{if(d&&Buffer.isBuffer(n))return y=new Buffer(n.length),n.copy(y),y;t(n,Error)?y=Object.create(n):void 0===i?(v=Object.getPrototypeOf(n),y=Object.create(v)):(y=Object.create(i),v=i)}if(r){var b=h.indexOf(n);if(-1!=b)return p[b];h.push(n),p.push(y)}t(n,a)&&n.forEach(function(t,e){var n=f(e,o-1),r=f(t,o-1);y.set(n,r)}),t(n,s)&&n.forEach(function(t){var e=f(t,o-1);y.add(e)});for(var g in n){var m;v&&(m=Object.getOwnPropertyDescriptor(v,g)),m&&null==m.set||(y[g]=f(n[g],o-1))}if(Object.getOwnPropertySymbols)for(var _=Object.getOwnPropertySymbols(n),g=0;g<_.length;g++){var O=_[g],w=Object.getOwnPropertyDescriptor(n,O);(!w||w.enumerable||c)&&(y[O]=f(n[O],o-1),w.enumerable||Object.defineProperty(y,O,{enumerable:!1}))}if(c)for(var x=Object.getOwnPropertyNames(n),g=0;g1&&void 0!==arguments[1]?arguments[1]:0;i(this,t),this.index=e,this.length=n},O=function(){function t(e,n){var r=this;i(this,t),this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=c.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){r.mouseDown||setTimeout(r.update.bind(r,v.default.sources.USER),1)}),this.emitter.on(v.default.events.EDITOR_CHANGE,function(t,e){t===v.default.events.TEXT_CHANGE&&e.length()>0&&r.update(v.default.sources.SILENT)}),this.emitter.on(v.default.events.SCROLL_BEFORE_UPDATE,function(){if(r.hasFocus()){var t=r.getNativeRange();null!=t&&t.start.node!==r.cursor.textNode&&r.emitter.once(v.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(t){}})}}),this.emitter.on(v.default.events.SCROLL_OPTIMIZE,function(t,e){if(e.range){var n=e.range,o=n.startNode,i=n.startOffset,l=n.endNode,a=n.endOffset;r.setNativeRange(o,i,l,a)}}),this.update(v.default.sources.SILENT)}return s(t,[{key:"handleComposition",value:function(){var t=this;this.root.addEventListener("compositionstart",function(){t.composing=!0}),this.root.addEventListener("compositionend",function(){if(t.composing=!1,t.cursor.parent){var e=t.cursor.restore();if(!e)return;setTimeout(function(){t.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}},{key:"handleDragging",value:function(){var t=this;this.emitter.listenDOM("mousedown",document.body,function(){t.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){t.mouseDown=!1,t.update(v.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(t,e){if(null==this.scroll.whitelist||this.scroll.whitelist[t]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!c.default.query(t,c.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=c.default.find(n.start.node,!1);if(null==r)return;if(r instanceof c.default.Leaf){var o=r.split(n.start.offset);r.parent.insertBefore(this.cursor,o)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;var r=void 0,o=this.scroll.leaf(t),i=a(o,2),l=i[0],s=i[1];if(null==l)return null;var u=l.position(s,!0),c=a(u,2);r=c[0],s=c[1];var f=document.createRange();if(e>0){f.setStart(r,s);var h=this.scroll.leaf(t+e),p=a(h,2);if(l=p[0],s=p[1],null==l)return null;var d=l.position(s,!0),y=a(d,2);return r=y[0],s=y[1],f.setEnd(r,s),f.getBoundingClientRect()}var v="left",b=void 0;return r instanceof Text?(s0&&(v="right")),{bottom:b.top+b.height,height:b.height,left:b[v],right:b[v],top:b.top,width:0}}},{key:"getNativeRange",value:function(){var t=document.getSelection();if(null==t||t.rangeCount<=0)return null;var e=t.getRangeAt(0);if(null==e)return null;var n=this.normalizeNative(e);return m.info("getNativeRange",n),n}},{key:"getRange",value:function(){var t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(t){var e=this,n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);var r=n.map(function(t){var n=a(t,2),r=n[0],o=n[1],i=c.default.find(r,!0),l=i.offset(e.scroll);return 0===o?l:i instanceof c.default.Container?l+i.length():l+i.index(r,o)}),i=Math.min(Math.max.apply(Math,o(r)),this.scroll.length()-1),l=Math.min.apply(Math,[i].concat(o(r)));return new _(l,i-l)}},{key:"normalizeNative",value:function(t){if(!l(this.root,t.startContainer)||!t.collapsed&&!l(this.root,t.endContainer))return null;var e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(function(t){for(var e=t.node,n=t.offset;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;e=e.lastChild,n=e instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n}),e}},{key:"rangeToNative",value:function(t){var e=this,n=t.collapsed?[t.index]:[t.index,t.index+t.length],r=[],o=this.scroll.length();return n.forEach(function(t,n){t=Math.min(o-1,t);var i=void 0,l=e.scroll.leaf(t),s=a(l,2),u=s[0],c=s[1],f=u.position(c,0!==n),h=a(f,2);i=h[0],c=h[1],r.push(i,c)}),r.length<2&&(r=r.concat(r)),r}},{key:"scrollIntoView",value:function(t){var e=this.lastRange;if(null!=e){var n=this.getBounds(e.index,e.length);if(null!=n){var r=this.scroll.length()-1,o=this.scroll.line(Math.min(e.index,r)),i=a(o,1),l=i[0],s=l;if(e.length>0){var u=this.scroll.line(Math.min(e.index+e.length,r));s=a(u,1)[0]}if(null!=l&&null!=s){var c=t.getBoundingClientRect();n.topc.bottom&&(t.scrollTop+=n.bottom-c.bottom)}}}}},{key:"setNativeRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(m.info("setNativeRange",t,e,n,r),null==t||null!=this.root.parentNode&&null!=t.parentNode&&null!=n.parentNode){var i=document.getSelection();if(null!=i)if(null!=t){this.hasFocus()||this.root.focus();var l=(this.getNativeRange()||{}).native;if(null==l||o||t!==l.startContainer||e!==l.startOffset||n!==l.endContainer||r!==l.endOffset){"BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var a=document.createRange();a.setStart(t,e),a.setEnd(n,r),i.removeAllRanges(),i.addRange(a)}}else i.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v.default.sources.API;if("string"==typeof e&&(n=e,e=!1),m.info("setRange",t),null!=t){var r=this.rangeToNative(t);this.setNativeRange.apply(this,o(r).concat([e]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.default.sources.USER,e=this.lastRange,n=this.getRange(),r=a(n,2),o=r[0],i=r[1];if(this.lastRange=o,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,d.default)(e,this.lastRange)){var l;!this.composing&&null!=i&&i.native.collapsed&&i.start.node!==this.cursor.textNode&&this.cursor.restore();var s=[v.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(e),t];if((l=this.emitter).emit.apply(l,[v.default.events.EDITOR_CHANGE].concat(s)),t!==v.default.sources.SILENT){var u;(u=this.emitter).emit.apply(u,s)}}}}]),t}();e.Range=_,e.default=O},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=n(0),s=r(a),u=n(3),c=r(u),f=function(t){function e(){return o(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return l(e,t),e}(s.default.Container);f.allowedChildren=[c.default,u.BlockEmbed,f],e.default=f},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorStyle=e.ColorClass=e.ColorAttributor=void 0;var l=function(){function t(t,e){for(var n=0;n1){var u=o.formats(),c=this.quill.getFormat(t.index-1,1);i=A.default.attributes.diff(u,c)||{}}}var f=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-f,f,S.default.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(t.index-f,f,i,S.default.sources.USER),this.quill.focus()}}function c(t,e){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(!(t.index>=this.quill.getLength()-n)){var r={},o=0,i=this.quill.getLine(t.index),l=b(i,1),a=l[0];if(e.offset>=a.length()-1){var s=this.quill.getLine(t.index+1),u=b(s,1),c=u[0];if(c){var f=a.formats(),h=this.quill.getFormat(t.index,1);r=A.default.attributes.diff(f,h)||{},o=c.length()}}this.quill.deleteText(t.index,n,S.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index+o-1,n,r,S.default.sources.USER)}}function f(t){var e=this.quill.getLines(t),n={};if(e.length>1){var r=e[0].formats(),o=e[e.length-1].formats();n=A.default.attributes.diff(o,r)||{}}this.quill.deleteText(t,S.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index,1,n,S.default.sources.USER),this.quill.setSelection(t.index,S.default.sources.SILENT),this.quill.focus()}function h(t,e){var n=this;t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);var r=Object.keys(e.format).reduce(function(t,n){return T.default.query(n,T.default.Scope.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t},{});this.quill.insertText(t.index,"\n",r,S.default.sources.USER),this.quill.setSelection(t.index+1,S.default.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach(function(t){null==r[t]&&(Array.isArray(e.format[t])||"link"!==t&&n.quill.format(t,e.format[t],S.default.sources.USER))})}function p(t){return{key:D.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(e){var n=T.default.query("code-block"),r=e.index,o=e.length,i=this.quill.scroll.descendant(n,r),l=b(i,2),a=l[0],s=l[1];if(null!=a){var u=this.quill.getIndex(a),c=a.newlineIndex(s,!0)+1,f=a.newlineIndex(u+s+o),h=a.domNode.textContent.slice(c,f).split("\n");s=0,h.forEach(function(e,i){t?(a.insertAt(c+s,n.TAB),s+=n.TAB.length,0===i?r+=n.TAB.length:o+=n.TAB.length):e.startsWith(n.TAB)&&(a.deleteAt(c+s,n.TAB.length),s-=n.TAB.length,0===i?r-=n.TAB.length:o-=n.TAB.length),s+=e.length+1}),this.quill.update(S.default.sources.USER),this.quill.setSelection(r,o,S.default.sources.SILENT)}}}}function d(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],S.default.sources.USER)}}}function y(t){if("string"==typeof t||"number"==typeof t)return y({key:t});if("object"===(void 0===t?"undefined":v(t))&&(t=(0,_.default)(t,!1)),"string"==typeof t.key)if(null!=D.keys[t.key.toUpperCase()])t.key=D.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[B]=t.shortKey,delete t.shortKey),t}Object.defineProperty(e,"__esModule",{value:!0}),e.SHORTKEY=e.default=void 0;var v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),g=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=y(t);if(null==r||null==r.key)return I.warn("Attempted to add invalid keyboard binding",r);"function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),r=(0,k.default)(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var t=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var r=n.which||n.keyCode,o=(t.bindings[r]||[]).filter(function(t){return e.match(n,t)});if(0!==o.length){var i=t.quill.getSelection();if(null!=i&&t.quill.hasFocus()){var l=t.quill.getLine(i.index),a=b(l,2),s=a[0],u=a[1],c=t.quill.getLeaf(i.index),f=b(c,2),h=f[0],p=f[1],d=0===i.length?[h,p]:t.quill.getLeaf(i.index+i.length),y=b(d,2),g=y[0],m=y[1],_=h instanceof T.default.Text?h.value().slice(0,p):"",O=g instanceof T.default.Text?g.value().slice(m):"",x={collapsed:0===i.length,empty:0===i.length&&s.length()<=1,format:t.quill.getFormat(i),offset:u,prefix:_,suffix:O};o.some(function(e){if(null!=e.collapsed&&e.collapsed!==x.collapsed)return!1;if(null!=e.empty&&e.empty!==x.empty)return!1;if(null!=e.offset&&e.offset!==x.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(function(t){return null==x.format[t]}))return!1}else if("object"===v(e.format)&&!Object.keys(e.format).every(function(t){return!0===e.format[t]?null!=x.format[t]:!1===e.format[t]?null==x.format[t]:(0,w.default)(e.format[t],x.format[t])}))return!1;return!(null!=e.prefix&&!e.prefix.test(x.prefix))&&(!(null!=e.suffix&&!e.suffix.test(x.suffix))&&!0!==e.handler.call(t,i,x))})&&n.preventDefault()}}}})}}]),e}(R.default);D.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},D.DEFAULTS={bindings:{bold:d("bold"),italic:d("italic"),underline:d("underline"),indent:{key:D.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",S.default.sources.USER)}},outdent:{key:D.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","-1",S.default.sources.USER)}},"outdent backspace":{key:D.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",S.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,S.default.sources.USER)}},"indent code-block":p(!0),"outdent code-block":p(!1),"remove tab":{key:D.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,S.default.sources.USER)}},tab:{key:D.keys.TAB,handler:function(t){this.quill.history.cutoff();var e=(new N.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,S.default.sources.SILENT)}},"list empty enter":{key:D.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,S.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,S.default.sources.USER)}},"checklist enter":{key:D.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){var e=this.quill.getLine(t.index),n=b(e,2),r=n[0],o=n[1],i=(0,k.default)({},r.formats(),{list:"checked"}),l=(new N.default).retain(t.index).insert("\n",i).retain(r.length()-o-1).retain(1,{list:"unchecked"});this.quill.updateContents(l,S.default.sources.USER),this.quill.setSelection(t.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:D.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){var n=this.quill.getLine(t.index),r=b(n,2),o=r[0],i=r[1],l=(new N.default).retain(t.index).insert("\n",e.format).retain(o.length()-i-1).retain(1,{header:null});this.quill.updateContents(l,S.default.sources.USER),this.quill.setSelection(t.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){var n=e.prefix.length,r=this.quill.getLine(t.index),o=b(r,2),i=o[0],l=o[1];if(l>n)return!0;var a=void 0;switch(e.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(t.index," ",S.default.sources.USER),this.quill.history.cutoff();var s=(new N.default).retain(t.index-l).delete(n+1).retain(i.length()-2-l).retain(1,{list:a});this.quill.updateContents(s,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,S.default.sources.SILENT)}},"code exit":{key:D.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){var e=this.quill.getLine(t.index),n=b(e,2),r=n[0],o=n[1],i=(new N.default).retain(t.index+r.length()-o-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(i,S.default.sources.USER)}},"embed left":s(D.keys.LEFT,!1),"embed left shift":s(D.keys.LEFT,!0),"embed right":s(D.keys.RIGHT,!1),"embed right shift":s(D.keys.RIGHT,!0)}},e.default=D,e.SHORTKEY=B},function(t,e,n){"use strict";t.exports={align:{"":n(75),center:n(76),right:n(77),justify:n(78)},background:n(79),blockquote:n(80),bold:n(81),clean:n(82),code:n(40),"code-block":n(40),color:n(83),direction:{"":n(84),rtl:n(85)},float:{center:n(86),full:n(87),left:n(88),right:n(89)},formula:n(90),header:{1:n(91),2:n(92)},italic:n(93),image:n(94),indent:{"+1":n(95),"-1":n(96)},link:n(97),list:{ordered:n(98),bullet:n(99),check:n(100)},script:{sub:n(101),super:n(102)},strike:n(103),underline:n(104),video:n(105)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=function(){function t(t){this.domNode=t,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,o){var i=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&o)i.wrap(n,o);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var l=r.create(this.statics.scope);i.wrap(l),l.format(n,o)}},t.prototype.insertAt=function(t,e,n){var o=null==n?r.create("text",e):r.create(e,n),i=this.split(t);this.parent.insertBefore(o,i)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),o=n(29),i=n(30),l=n(1),a=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=o.default.keys(this.domNode),a=i.default.keys(this.domNode);e.concat(n).concat(a).forEach(function(e){var n=l.query(e,l.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)})},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach(function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)})},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach(function(t){e.attributes[t].remove(e.domNode)}),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce(function(e,n){return e[n]=t.attributes[n].value(t.domNode),e},{})},t}();e.default=a},function(t,e,n){"use strict";function r(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(function(t){return 0===t.indexOf(e+"-")})}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){r(t,this.keyName).forEach(function(e){t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=r(t,this.keyName)[0]||"",n=e.slice(this.keyName.length+1);return this.canAdd(t,n)?n:""},e}(i.default);e.default=l},function(t,e,n){"use strict";function r(t){var e=t.split("-"),n=e.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return e[0]+n}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map(function(t){return t.split(":")[0].trim()})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[r(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[r(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[r(this.keyName)];return this.canAdd(t,e)?e:""},e}(i.default);e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},u=function(){function t(t,e){for(var n=0;n '},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;nr.right&&(i=r.right-o.right,this.root.style.left=e+i+"px"),o.leftr.bottom){var l=o.bottom-o.top,a=t.bottom-t.top+l;this.root.style.top=n-a+"px",this.root.classList.add("ql-flip")}return i}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),t}();e.default=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?(e[1]||"https")+"://www.youtube.com/embed/"+e[2]+"?showinfo=0":(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(e[1]||"https")+"://player.vimeo.com/video/"+e[2]+"/":t}function s(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(function(e){var r=document.createElement("option");e===n?r.setAttribute("selected","selected"):r.setAttribute("value",e),t.appendChild(r)})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var u=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||""),this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function(){var t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,v.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,v.default.sources.USER)),this.quill.root.scrollTop=e;break;case"video":t=a(t);case"formula":if(!t)break;var n=this.quill.getSelection(!0);if(null!=n){var r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),t,v.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(r+1," ",v.default.sources.USER),this.quill.setSelection(r+2,v.default.sources.USER)}}this.textbox.value="",this.hide()}}]),e}(A.default);e.BaseTooltip=M,e.default=L},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(46),i=r(o),l=n(34),a=n(36),s=n(62),u=n(63),c=r(u),f=n(64),h=r(f),p=n(65),d=r(p),y=n(35),v=n(24),b=n(37),g=n(38),m=n(39),_=r(m),O=n(66),w=r(O),x=n(15),k=r(x),E=n(67),N=r(E),j=n(68),A=r(j),q=n(69),T=r(q),P=n(70),S=r(P),C=n(71),L=r(C),M=n(13),R=r(M),I=n(72),B=r(I),D=n(73),U=r(D),F=n(74),H=r(F),K=n(26),z=r(K),Z=n(16),V=r(Z),W=n(41),G=r(W),Y=n(42),X=r(Y),$=n(43),Q=r($),J=n(107),tt=r(J),et=n(108),nt=r(et);i.default.register({"attributors/attribute/direction":a.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":y.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":a.DirectionClass,"attributors/class/font":b.FontClass,"attributors/class/size":g.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":y.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":a.DirectionStyle,"attributors/style/font":b.FontStyle,"attributors/style/size":g.SizeStyle},!0),i.default.register({"formats/align":l.AlignClass,"formats/direction":a.DirectionClass,"formats/indent":s.IndentClass,"formats/background":y.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":b.FontClass,"formats/size":g.SizeClass,"formats/blockquote":c.default,"formats/code-block":R.default,"formats/header":h.default,"formats/list":d.default,"formats/bold":_.default,"formats/code":M.Code,"formats/italic":w.default,"formats/link":k.default,"formats/script":N.default,"formats/strike":A.default,"formats/underline":T.default,"formats/image":S.default,"formats/video":L.default,"formats/list/item":p.ListItem,"modules/formula":B.default,"modules/syntax":U.default,"modules/toolbar":H.default,"themes/bubble":tt.default,"themes/snow":nt.default,"ui/icons":z.default,"ui/picker":V.default,"ui/icon-picker":X.default,"ui/color-picker":G.default,"ui/tooltip":Q.default},!0),e.default=i.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=r(o),l=n(6),a=r(l),s=n(3),u=r(s),c=n(14),f=r(c),h=n(23),p=r(h),d=n(31),y=r(d),v=n(33),b=r(v),g=n(5),m=r(g),_=n(59),O=r(_),w=n(8),x=r(w),k=n(60),E=r(k),N=n(61),j=r(N),A=n(25),q=r(A);a.default.register({"blots/block":u.default,"blots/block/embed":s.BlockEmbed,"blots/break":f.default,"blots/container":p.default,"blots/cursor":y.default,"blots/embed":b.default,"blots/inline":m.default,"blots/scroll":O.default,"blots/text":x.default,"modules/clipboard":E.default,"modules/history":j.default,"modules/keyboard":q.default}),i.default.register(u.default,f.default,y.default,m.default,O.default,x.default),e.default=a.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var o=n.length();if(ta?n(r,t-a,Math.min(e,a+u-t)):n(r,0,Math.min(u,t+e-a)),a+=u}},t.prototype.map=function(t){return this.reduce(function(e,n){return e.push(t(n)),e},[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();e.default=r},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(17),i=n(1),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},a=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver(function(t){n.update(t)}),n.observer.observe(n.domNode,l),n.attach(),n}return r(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach(function(t){t.remove()}):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,o){this.update(),t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var l=[].slice.call(this.observer.takeRecords());l.length>0;)e.push(l.pop());for(var a=function(t,e){void 0===e&&(e=!0),null!=t&&t!==r&&null!=t.domNode.parentNode&&(null==t.domNode[i.DATA_KEY].mutations&&(t.domNode[i.DATA_KEY].mutations=[]),e&&a(t.parent))},s=function(t){null!=t.domNode[i.DATA_KEY]&&null!=t.domNode[i.DATA_KEY].mutations&&(t instanceof o.default&&t.children.forEach(s),t.optimize(n))},u=e,c=0;u.length>0;c+=1){if(c>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(function(t){var e=i.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(a(i.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,function(t){var e=i.find(t,!1);a(e,!1),e instanceof o.default&&e.children.forEach(function(t){a(t,!1)})})):"attributes"===t.type&&a(e.prev)),a(e))}),this.children.forEach(s),u=[].slice.call(this.observer.takeRecords()),l=u.slice();l.length>0;)e.push(l.pop())}},e.prototype.update=function(e,n){var r=this;void 0===n&&(n={}),e=e||this.observer.takeRecords(),e.map(function(t){var e=i.find(t.target,!0);return null==e?null:null==e.domNode[i.DATA_KEY].mutations?(e.domNode[i.DATA_KEY].mutations=[t],e):(e.domNode[i.DATA_KEY].mutations.push(t),null)}).forEach(function(t){null!=t&&t!==r&&null!=t.domNode[i.DATA_KEY]&&t.update(t.domNode[i.DATA_KEY].mutations||[],n)}),null!=this.domNode[i.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[i.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=i.Scope.BLOCK_BLOT,e.tagName="DIV",e}(o.default);e.default=a},function(t,e,n){"use strict";function r(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(18),l=n(1),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach(function(t){t instanceof i.default||(t=t.wrap(e.blotName,!0)),o.attributes.copy(t)}),this.unwrap())},e.prototype.formatAt=function(e,n,r,o){if(null!=this.formats()[r]||l.query(r,l.Scope.ATTRIBUTE)){this.isolate(e,n).format(r,o)}else t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var o=this.formats();if(0===Object.keys(o).length)return this.unwrap();var i=this.next;i instanceof e&&i.prev===this&&r(o,i.formats())&&(i.moveChildren(this),i.remove())},e.blotName="inline",e.scope=l.Scope.INLINE_BLOT,e.tagName="SPAN",e}(i.default);e.default=a},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(18),i=n(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(n){var r=i.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=i.query(n,i.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,o){null!=i.query(r,i.Scope.BLOCK)?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=i.query(n,i.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var o=this.split(e),l=i.create(n,r);o.parent.insertBefore(l,o)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=i.Scope.BLOCK_BLOT,e.tagName="P",e}(o.default);e.default=l},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(19),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,o){0===e&&n===this.length()?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(o.default);e.default=i},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(19),i=n(1),l=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return r(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=i.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some(function(t){return"characterData"===t.type&&t.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=i.Scope.INLINE_BLOT,e}(o.default);e.default=l},function(t,e,n){"use strict";var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return arguments.length>1&&!this.contains(t)==!e?e:o.call(this,t)}}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),r=n.length>>>0,o=arguments[1],i=0;ie.length?t:e,l=t.length>e.length?e:t,a=i.indexOf(l);if(-1!=a)return r=[[y,i.substring(0,a)],[v,l],[y,i.substring(a+l.length)]],t.length>e.length&&(r[0][0]=r[2][0]=d),r;if(1==l.length)return[[d,t],[y,e]];var u=s(t,e);if(u){var c=u[0],f=u[1],h=u[2],p=u[3],b=u[4],g=n(c,h),m=n(f,p);return g.concat([[v,b]],m)}return o(t,e)}function o(t,e){for(var n=t.length,r=e.length,o=Math.ceil((n+r)/2),l=o,a=2*o,s=new Array(a),u=new Array(a),c=0;cn)v+=2;else if(x>r)p+=2;else if(h){var k=l+f-_;if(k>=0&&k=E)return i(t,e,O,x)}}}for(var N=-m+b;N<=m-g;N+=2){var E,k=l+N;E=N==-m||N!=m&&u[k-1]n)g+=2;else if(j>r)b+=2;else if(!h){var w=l+f-N;if(w>=0&&w=E)return i(t,e,O,x)}}}}return[[d,t],[y,e]]}function i(t,e,r,o){var i=t.substring(0,r),l=e.substring(0,o),a=t.substring(r),s=e.substring(o),u=n(i,l),c=n(a,s);return u.concat(c)}function l(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),o=r,i=0;n=t.length?[r,o,i,s,f]:null}var r=t.length>e.length?t:e,o=t.length>e.length?e:t;if(r.length<4||2*o.lengthu[4].length?s:u:s;var c,f,h,p;return t.length>e.length?(c=i[0],f=i[1],h=i[2],p=i[3]):(h=i[0],p=i[1],c=i[2],f=i[3]),[c,f,h,p,i[4]]}function u(t){t.push([v,""]);for(var e,n=0,r=0,o=0,i="",s="";n1?(0!==r&&0!==o&&(e=l(s,i),0!==e&&(n-r-o>0&&t[n-r-o-1][0]==v?t[n-r-o-1][1]+=s.substring(0,e):(t.splice(0,0,[v,s.substring(0,e)]),n++),s=s.substring(e),i=i.substring(e)),0!==(e=a(s,i))&&(t[n][1]=s.substring(s.length-e)+t[n][1],s=s.substring(0,s.length-e),i=i.substring(0,i.length-e))),0===r?t.splice(n-o,r+o,[y,s]):0===o?t.splice(n-r,r+o,[d,i]):t.splice(n-r-o,r+o,[d,i],[y,s]),n=n-r-o+(r?1:0)+(o?1:0)+1):0!==n&&t[n-1][0]==v?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,o=0,r=0,i="",s=""}""===t[t.length-1][1]&&t.pop();var c=!1;for(n=1;n0&&r.splice(o+2,0,[l[0],a]),p(r,o,3)}return t}function h(t){for(var e=!1,n=function(t){return t.charCodeAt(0)>=56320&&t.charCodeAt(0)<=57343},r=2;r=55296&&t.charCodeAt(t.length-1)<=56319}(t[r-2][1])&&t[r-1][0]===d&&n(t[r-1][1])&&t[r][0]===y&&n(t[r][1])&&(e=!0,t[r-1][1]=t[r-2][1].slice(-1)+t[r-1][1],t[r][1]=t[r-2][1].slice(-1)+t[r][1],t[r-2][1]=t[r-2][1].slice(0,-1));if(!e)return t;for(var o=[],r=0;r0&&o.push(t[r]);return o}function p(t,e,n){for(var r=e+n-1;r>=0&&r>=e-1;r--)if(r+1=r&&!a.endsWith("\n")&&(n=!0),e.scroll.insertAt(t,a);var c=e.scroll.line(t),f=u(c,2),h=f[0],p=f[1],y=(0,T.default)({},(0,O.bubbleFormats)(h));if(h instanceof w.default){var b=h.descendant(v.default.Leaf,p),g=u(b,1),m=g[0];y=(0,T.default)(y,(0,O.bubbleFormats)(m))}l=d.default.attributes.diff(y,l)||{}}else if("object"===s(o.insert)){var _=Object.keys(o.insert)[0];if(null==_)return t;e.scroll.insertAt(t,_,o.insert[_])}r+=i}return Object.keys(l).forEach(function(n){e.scroll.formatAt(t,i,n,l[n])}),t+i},0),t.reduce(function(t,n){return"number"==typeof n.delete?(e.scroll.deleteAt(t,n.delete),t):t+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(t)}},{key:"deleteText",value:function(t,e){return this.scroll.deleteAt(t,e),this.update((new h.default).retain(t).delete(e))}},{key:"formatLine",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(o){if(null==n.scroll.whitelist||n.scroll.whitelist[o]){var i=n.scroll.lines(t,Math.max(e,1)),l=e;i.forEach(function(e){var i=e.length();if(e instanceof g.default){var a=t-e.offset(n.scroll),s=e.newlineIndex(a+l)-a+1;e.formatAt(a,s,o,r[o])}else e.format(o,r[o]);l-=i})}}),this.scroll.optimize(),this.update((new h.default).retain(t).retain(e,(0,N.default)(r)))}},{key:"formatText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e,o,r[o])}),this.update((new h.default).retain(t).retain(e,(0,N.default)(r)))}},{key:"getContents",value:function(t,e){return this.delta.slice(t,t+e)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(t,e){return t.concat(e.delta())},new h.default)}},{key:"getFormat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===e?this.scroll.path(t).forEach(function(t){var e=u(t,1),o=e[0];o instanceof w.default?n.push(o):o instanceof v.default.Leaf&&r.push(o)}):(n=this.scroll.lines(t,e),r=this.scroll.descendants(v.default.Leaf,t,e));var o=[n,r].map(function(t){if(0===t.length)return{};for(var e=(0,O.bubbleFormats)(t.shift());Object.keys(e).length>0;){var n=t.shift();if(null==n)return e;e=l((0,O.bubbleFormats)(n),e)}return e});return T.default.apply(T.default,o)}},{key:"getText",value:function(t,e){return this.getContents(t,e).filter(function(t){return"string"==typeof t.insert}).map(function(t){return t.insert}).join("")}},{key:"insertEmbed",value:function(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new h.default).retain(t).insert(o({},e,n)))}},{key:"insertText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e.length,o,r[o])}),this.update((new h.default).retain(t).insert(e,(0,N.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var t=this.scroll.children.head;return t.statics.blotName===w.default.blotName&&(!(t.children.length>1)&&t.children.head instanceof k.default)}},{key:"removeFormat",value:function(t,e){var n=this.getText(t,e),r=this.scroll.line(t+e),o=u(r,2),i=o[0],l=o[1],a=0,s=new h.default;null!=i&&(a=i instanceof g.default?i.newlineIndex(l)-l+1:i.length()-l,s=i.delta().slice(l,l+a-1).insert("\n"));var c=this.getContents(t,e+a),f=c.diff((new h.default).insert(n).concat(s)),p=(new h.default).retain(t).concat(f);return this.applyDelta(p)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(P)&&v.default.find(e[0].target)){var o=v.default.find(e[0].target),i=(0,O.bubbleFormats)(o),l=o.offset(this.scroll),a=e[0].oldValue.replace(_.default.CONTENTS,""),s=(new h.default).insert(a),u=(new h.default).insert(o.value());t=(new h.default).retain(l).concat(s.diff(u,n)).reduce(function(t,e){return e.insert?t.insert(e.insert,i):t.push(e)},new h.default),this.delta=r.compose(t)}else this.delta=this.getDelta(),t&&(0,A.default)(r.compose(t),this.delta)||(t=r.diff(this.delta,n));return t}}]),t}();e.default=S},function(t,e){"use strict";function n(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(){this._events=new n,this._eventsCount=0}var i=Object.prototype.hasOwnProperty,l="~";Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(l=!1)),o.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)i.call(t,e)&&n.push(l?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t,e){var n=l?l+t:t,r=this._events[n];if(e)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o0){if(i instanceof y.BlockEmbed||f instanceof y.BlockEmbed)return void this.optimize();if(i instanceof _.default){var h=i.newlineIndex(i.length(),!0);if(h>-1&&(i=i.split(h+1))===f)return void this.optimize()}else if(f instanceof _.default){var p=f.newlineIndex(0);p>-1&&f.split(p+1)}var d=f.children.head instanceof g.default?null:f.children.head;i.moveChildren(f,d),i.remove()}this.optimize()}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function(t,n,r,o){(null==this.whitelist||this.whitelist[r])&&(c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,r,o),this.optimize())}},{key:"insertAt",value:function(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==h.default.query(n,h.default.Scope.BLOCK)){var o=h.default.create(this.statics.defaultChild);this.appendChild(o),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),o.insertAt(0,n,r)}else{var i=h.default.create(n,r);this.appendChild(i)}else c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r);this.optimize()}}},{key:"insertBefore",value:function(t,n){if(t.statics.scope===h.default.Scope.INLINE_BLOT){var r=h.default.create(this.statics.defaultChild);r.appendChild(t),t=r}c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n)}},{key:"leaf",value:function(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function(t){return t===this.length()?this.line(t-1):this.descendant(a,t)}},{key:"lines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return function t(e,n,r){var o=[],i=r;return e.children.forEachAt(n,r,function(e,n,r){a(e)?o.push(e):e instanceof h.default.Container&&(o=o.concat(t(e,n,i))),i-=r}),o}(this,t,e)}},{key:"optimize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t,n),t.length>0&&this.emitter.emit(d.default.events.SCROLL_OPTIMIZE,t,n))}},{key:"path",value:function(t){return c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){if(!0!==this.batch){var n=d.default.sources.USER;"string"==typeof t&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(d.default.events.SCROLL_BEFORE_UPDATE,n,t),c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"update",this).call(this,t.concat([])),t.length>0&&this.emitter.emit(d.default.events.SCROLL_UPDATE,n,t)}}}]),e}(h.default.Scroll);x.blotName="scroll",x.className="ql-editor",x.tagName="DIV",x.defaultChild="block",x.allowedChildren=[v.default,y.BlockEmbed,w.default],e.default=x},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e,n){return"object"===(void 0===e?"undefined":x(e))?Object.keys(e).reduce(function(t,n){return s(t,n,e[n])},t):t.reduce(function(t,r){return r.attributes&&r.attributes[e]?t.push(r):t.insert(r.insert,(0,j.default)({},o({},e,n),r.attributes))},new q.default)}function u(t){if(t.nodeType!==Node.ELEMENT_NODE)return{};return t["__ql-computed-style"]||(t["__ql-computed-style"]=window.getComputedStyle(t))}function c(t,e){for(var n="",r=t.ops.length-1;r>=0&&n.length-1}function h(t,e,n){return t.nodeType===t.TEXT_NODE?n.reduce(function(e,n){return n(t,e)},new q.default):t.nodeType===t.ELEMENT_NODE?[].reduce.call(t.childNodes||[],function(r,o){var i=h(o,e,n);return o.nodeType===t.ELEMENT_NODE&&(i=e.reduce(function(t,e){return e(o,t)},i),i=(o[W]||[]).reduce(function(t,e){return e(o,t)},i)),r.concat(i)},new q.default):new q.default}function p(t,e,n){return s(n,t,!0)}function d(t,e){var n=P.default.Attributor.Attribute.keys(t),r=P.default.Attributor.Class.keys(t),o=P.default.Attributor.Style.keys(t),i={};return n.concat(r).concat(o).forEach(function(e){var n=P.default.query(e,P.default.Scope.ATTRIBUTE);null!=n&&(i[n.attrName]=n.value(t),i[n.attrName])||(n=Y[e],null==n||n.attrName!==e&&n.keyName!==e||(i[n.attrName]=n.value(t)||void 0),null==(n=X[e])||n.attrName!==e&&n.keyName!==e||(n=X[e],i[n.attrName]=n.value(t)||void 0))}),Object.keys(i).length>0&&(e=s(e,i)),e}function y(t,e){var n=P.default.query(t);if(null==n)return e;if(n.prototype instanceof P.default.Embed){var r={},o=n.value(t);null!=o&&(r[n.blotName]=o,e=(new q.default).insert(r,n.formats(t)))}else"function"==typeof n.formats&&(e=s(e,n.blotName,n.formats(t)));return e}function v(t,e){return c(e,"\n")||e.insert("\n"),e}function b(){return new q.default}function g(t,e){var n=P.default.query(t);if(null==n||"list-item"!==n.blotName||!c(e,"\n"))return e;for(var r=-1,o=t.parentNode;!o.classList.contains("ql-clipboard");)"list"===(P.default.query(o)||{}).blotName&&(r+=1),o=o.parentNode;return r<=0?e:e.compose((new q.default).retain(e.length()-1).retain(1,{indent:r}))}function m(t,e){return c(e,"\n")||(f(t)||e.length()>0&&t.nextSibling&&f(t.nextSibling))&&e.insert("\n"),e}function _(t,e){if(f(t)&&null!=t.nextElementSibling&&!c(e,"\n\n")){var n=t.offsetHeight+parseFloat(u(t).marginTop)+parseFloat(u(t).marginBottom);t.nextElementSibling.offsetTop>t.offsetTop+1.5*n&&e.insert("\n")}return e}function O(t,e){var n={},r=t.style||{};return r.fontStyle&&"italic"===u(t).fontStyle&&(n.italic=!0),r.fontWeight&&(u(t).fontWeight.startsWith("bold")||parseInt(u(t).fontWeight)>=700)&&(n.bold=!0),Object.keys(n).length>0&&(e=s(e,n)),parseFloat(r.textIndent||0)>0&&(e=(new q.default).insert("\t").concat(e)),e}function w(t,e){var n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard"))return e;if(!u(t.parentNode).whiteSpace.startsWith("pre")){var r=function(t,e){return e=e.replace(/[^\u00a0]/g,""),e.length<1&&t?" ":e};n=n.replace(/\r\n/g," ").replace(/\n/g," "),n=n.replace(/\s\s+/g,r.bind(r,!0)),(null==t.previousSibling&&f(t.parentNode)||null!=t.previousSibling&&f(t.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==t.nextSibling&&f(t.parentNode)||null!=t.nextSibling&&f(t.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return e.insert(n)}Object.defineProperty(e,"__esModule",{value:!0}),e.matchText=e.matchSpacing=e.matchNewline=e.matchBlot=e.matchAttributor=e.default=void 0;var x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),E=function(){function t(t,e){for(var n=0;n\r?\n +\<"),this.convert();var e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[F.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new q.default).insert(n,o({},F.default.blotName,e[F.default.blotName]))}var r=this.prepareMatching(),i=k(r,2),l=i[0],a=i[1],s=h(this.container,l,a);return c(s,"\n")&&null==s.ops[s.ops.length-1].attributes&&(s=s.compose((new q.default).retain(s.length()-1).delete(1))),V.log("convert",this.container.innerHTML,s),this.container.innerHTML="",s}},{key:"dangerouslyPasteHTML",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C.default.sources.API;if("string"==typeof t)this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,C.default.sources.SILENT);else{var r=this.convert(e);this.quill.updateContents((new q.default).retain(t).concat(r),n),this.quill.setSelection(t+r.length(),C.default.sources.SILENT)}}},{key:"onPaste",value:function(t){var e=this;if(!t.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=(new q.default).retain(n.index),o=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(C.default.sources.SILENT),setTimeout(function(){r=r.concat(e.convert()).delete(n.length),e.quill.updateContents(r,C.default.sources.USER),e.quill.setSelection(r.length()-n.length,C.default.sources.SILENT),e.quill.scrollingContainer.scrollTop=o,e.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var t=this,e=[],n=[];return this.matchers.forEach(function(r){var o=k(r,2),i=o[0],l=o[1];switch(i){case Node.TEXT_NODE:n.push(l);break;case Node.ELEMENT_NODE:e.push(l);break;default:[].forEach.call(t.container.querySelectorAll(i),function(t){t[W]=t[W]||[],t[W].push(l)})}}),[e,n]}}]),e}(I.default);$.DEFAULTS={matchers:[],matchVisual:!0},e.default=$,e.matchAttributor=d,e.matchBlot=y,e.matchNewline=m,e.matchSpacing=_,e.matchText=w},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e=t.ops[t.ops.length-1];return null!=e&&(null!=e.insert?"string"==typeof e.insert&&e.insert.endsWith("\n"):null!=e.attributes&&Object.keys(e.attributes).some(function(t){return null!=f.default.query(t,f.default.Scope.BLOCK)}))}function s(t){var e=t.reduce(function(t,e){return t+=e.delete||0},0),n=t.length()-e;return a(t)&&(n-=1),n}Object.defineProperty(e,"__esModule",{value:!0}),e.getLastChangeIndex=e.default=void 0;var u=function(){function t(t,e){for(var n=0;nr&&this.stack.undo.length>0){var o=this.stack.undo.pop();n=n.compose(o.undo),t=o.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(t){this.stack.undo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}),this.stack.redo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),e}(y.default);v.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=v,e.getLastChangeIndex=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var l=function(){function t(t,e){for(var n=0;n0&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return o({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(t,n){if(t instanceof v)u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n);else{var r=null==n?this.length():n.offset(this),o=this.split(r);o.parent.insertBefore(t,o)}}},{key:"optimize",value:function(t){u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){if(t.statics.blotName!==this.statics.blotName){var n=f.default.create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t)}}]),e}(y.default);b.blotName="list",b.scope=f.default.Scope.BLOCK_BLOT,b.tagName=["OL","UL"],b.defaultChild="list-item",b.allowedChildren=[v],e.ListItem=v,e.default=b},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=n(39),a=function(t){return t&&t.__esModule?t:{default:t}}(l),s=function(t){function e(){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),e}(a.default);s.blotName="italic",s.tagName=["EM","I"],e.default=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=a(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"==typeof t&&n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return f.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,c.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(u.default.Embed);h.blotName="image",h.tagName="IMG",e.default=h},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=a(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return f.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"sanitize",value:function(t){return c.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(s.BlockEmbed);h.blotName="video",h.className="ql-video",h.tagName="IFRAME",e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var a=function(){function t(t,e){for(var n=0;n0||null==this.cachedText)&&(this.domNode.innerHTML=t(e),this.domNode.normalize(),this.attach()),this.cachedText=e)}}]),e}(v.default);b.className="ql-syntax";var g=new c.default.Attributor.Class("token","hljs",{scope:c.default.Scope.INLINE}),m=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if("function"!=typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var l=null;return r.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(l),l=setTimeout(function(){r.highlight(),l=null},r.options.interval)}),r.highlight(),r}return l(e,t),a(e,null,[{key:"register",value:function(){h.default.register(g,!0),h.default.register(b,!0)}}]),a(e,[{key:"highlight",value:function(){var t=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var e=this.quill.getSelection();this.quill.scroll.descendants(b).forEach(function(e){e.highlight(t.options.highlight)}),this.quill.update(h.default.sources.SILENT),null!=e&&this.quill.setSelection(e,h.default.sources.SILENT)}}}]),e}(d.default);m.DEFAULTS={highlight:function(){return null==window.hljs?null:function(t){return window.hljs.highlightAuto(t).value}}(),interval:1e3},e.CodeBlock=b,e.CodeToken=g,e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e,n){var r=document.createElement("button");r.setAttribute("type","button"),r.classList.add("ql-"+e),null!=n&&(r.value=n),t.appendChild(r)}function u(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(function(e){var n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(function(t){if("string"==typeof t)s(n,t);else{var e=Object.keys(t)[0],r=t[e];Array.isArray(r)?c(n,e,r):s(n,e,r)}}),t.appendChild(n)})}function c(t,e,n){var r=document.createElement("select");r.classList.add("ql-"+e),n.forEach(function(t){var e=document.createElement("option");!1!==t?e.setAttribute("value",t):e.setAttribute("selected","selected"),r.appendChild(e)}),t.appendChild(r)}Object.defineProperty(e,"__esModule",{value:!0}),e.addControls=e.default=void 0;var f=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function t(t,e){for(var n=0;n '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BubbleTooltip=void 0;var a=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},s=function(){function t(t,e){for(var n=0;n0&&o===h.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var i=r.quill.getLines(e.index,e.length);if(1===i.length)r.position(r.quill.getBounds(e));else{var l=i[i.length-1],a=r.quill.getIndex(l),s=Math.min(l.length()-1,e.index+e.length-a),u=r.quill.getBounds(new y.Range(a,s));r.position(u)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}),r}return l(e,t),s(e,[{key:"listen",value:function(){var t=this;a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){t.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!t.root.classList.contains("ql-hidden")){var e=t.quill.getSelection();null!=e&&t.position(t.quill.getBounds(e))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var n=a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"position",this).call(this,t),r=this.root.querySelector(".ql-tooltip-arrow");if(r.style.marginLeft="",0===n)return n;r.style.marginLeft=-1*n-r.offsetWidth/2+"px"}}]),e}(p.BaseTooltip);_.TEMPLATE=['','
    ','','',"
    "].join(""),e.BubbleTooltip=_,e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},u=function(){function t(t,e){for(var n=0;n','','',''].join(""),e.default=w}]).default}); +//# sourceMappingURL=quill.min.js.map \ No newline at end of file diff -Nru bibledit-5.0.912/quill/1.3.6/quill.min.js.map bibledit-5.0.922/quill/1.3.6/quill.min.js.map --- bibledit-5.0.912/quill/1.3.6/quill.min.js.map 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.3.6/quill.min.js.map 2018-03-12 06:39:22.000000000 +0000 @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///quill.min.js","webpack:///webpack/bootstrap bc1e3bc04ac5f71cbeee","webpack:///./node_modules/parchment/src/parchment.ts","webpack:///./node_modules/parchment/src/registry.ts","webpack:///./node_modules/extend/index.js","webpack:///./blots/block.js","webpack:///./node_modules/quill-delta/lib/delta.js","webpack:///./blots/inline.js","webpack:///./core/quill.js","webpack:///./core/module.js","webpack:///./blots/text.js","webpack:///./core/emitter.js","webpack:///./core/logger.js","webpack:///./node_modules/parchment/src/attributor/attributor.ts","webpack:///./node_modules/deep-equal/index.js","webpack:///./formats/code.js","webpack:///./blots/break.js","webpack:///./formats/link.js","webpack:///./ui/picker.js","webpack:///./node_modules/parchment/src/blot/abstract/container.ts","webpack:///./node_modules/parchment/src/blot/abstract/format.ts","webpack:///./node_modules/parchment/src/blot/abstract/leaf.ts","webpack:///./node_modules/quill-delta/lib/op.js","webpack:///./node_modules/clone/clone.js","webpack:///./core/selection.js","webpack:///./blots/container.js","webpack:///./formats/color.js","webpack:///./modules/keyboard.js","webpack:///./ui/icons.js","webpack:///./node_modules/parchment/src/blot/abstract/shadow.ts","webpack:///./node_modules/parchment/src/attributor/store.ts","webpack:///./node_modules/parchment/src/attributor/class.ts","webpack:///./node_modules/parchment/src/attributor/style.ts","webpack:///./blots/cursor.js","webpack:///./core/theme.js","webpack:///./blots/embed.js","webpack:///./formats/align.js","webpack:///./formats/background.js","webpack:///./formats/direction.js","webpack:///./formats/font.js","webpack:///./formats/size.js","webpack:///./formats/bold.js","webpack:///./assets/icons/code.svg","webpack:///./ui/color-picker.js","webpack:///./ui/icon-picker.js","webpack:///./ui/tooltip.js","webpack:///./themes/base.js","webpack:///./quill.js","webpack:///./core.js","webpack:///./node_modules/parchment/src/collection/linked-list.ts","webpack:///./node_modules/parchment/src/blot/scroll.ts","webpack:///./node_modules/parchment/src/blot/inline.ts","webpack:///./node_modules/parchment/src/blot/block.ts","webpack:///./node_modules/parchment/src/blot/embed.ts","webpack:///./node_modules/parchment/src/blot/text.ts","webpack:///./core/polyfill.js","webpack:///./node_modules/fast-diff/diff.js","webpack:///./node_modules/deep-equal/lib/keys.js","webpack:///./node_modules/deep-equal/lib/is_arguments.js","webpack:///./core/editor.js","webpack:///./node_modules/eventemitter3/index.js","webpack:///./blots/scroll.js","webpack:///./modules/clipboard.js","webpack:///./modules/history.js","webpack:///./formats/indent.js","webpack:///./formats/blockquote.js","webpack:///./formats/header.js","webpack:///./formats/list.js","webpack:///./formats/italic.js","webpack:///./formats/script.js","webpack:///./formats/strike.js","webpack:///./formats/underline.js","webpack:///./formats/image.js","webpack:///./formats/video.js","webpack:///./modules/formula.js","webpack:///./modules/syntax.js","webpack:///./modules/toolbar.js","webpack:///./assets/icons/align-left.svg","webpack:///./assets/icons/align-center.svg","webpack:///./assets/icons/align-right.svg","webpack:///./assets/icons/align-justify.svg","webpack:///./assets/icons/background.svg","webpack:///./assets/icons/blockquote.svg","webpack:///./assets/icons/bold.svg","webpack:///./assets/icons/clean.svg","webpack:///./assets/icons/color.svg","webpack:///./assets/icons/direction-ltr.svg","webpack:///./assets/icons/direction-rtl.svg","webpack:///./assets/icons/float-center.svg","webpack:///./assets/icons/float-full.svg","webpack:///./assets/icons/float-left.svg","webpack:///./assets/icons/float-right.svg","webpack:///./assets/icons/formula.svg","webpack:///./assets/icons/header.svg","webpack:///./assets/icons/header-2.svg","webpack:///./assets/icons/italic.svg","webpack:///./assets/icons/image.svg","webpack:///./assets/icons/indent.svg","webpack:///./assets/icons/outdent.svg","webpack:///./assets/icons/link.svg","webpack:///./assets/icons/list-ordered.svg","webpack:///./assets/icons/list-bullet.svg","webpack:///./assets/icons/list-check.svg","webpack:///./assets/icons/subscript.svg","webpack:///./assets/icons/superscript.svg","webpack:///./assets/icons/strike.svg","webpack:///./assets/icons/underline.svg","webpack:///./assets/icons/video.svg","webpack:///./assets/icons/dropdown.svg","webpack:///./themes/bubble.js","webpack:///./themes/snow.js"],"names":["root","factory","exports","module","define","amd","self","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","value","container_1","format_1","leaf_1","scroll_1","inline_1","block_1","embed_1","text_1","attributor_1","class_1","style_1","store_1","Registry","Parchment","Scope","create","find","query","register","Container","default","Format","Leaf","Embed","Scroll","Block","Inline","Text","Attributor","Attribute","Class","Style","Store","input","match","ParchmentError","BlotClass","Node","TEXT_NODE","node","bubble","DATA_KEY","blot","parentNode","scope","ANY","types","attributes","LEVEL","BLOCK","INLINE","HTMLElement","names","getAttribute","split","classes","tags","tagName","TYPE","Definitions","_i","arguments","length","map","Definition","blotName","attrName","keyName","className","Array","isArray","toUpperCase","tagNames","forEach","tag","__extends","extendStatics","setPrototypeOf","__proto__","b","__","constructor","_super","message","_this","Error","hasOwn","toStr","toString","arr","isPlainObject","obj","hasOwnConstructor","hasIsPrototypeOf","key","extend","options","src","copy","copyIsArray","clone","target","deep","_interopRequireDefault","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","writable","bubbleFormats","formats","undefined","_extend2","parent","statics","BlockEmbed","_createClass","defineProperties","props","descriptor","protoProps","staticProps","_get","receiver","Function","desc","getOwnPropertyDescriptor","getPrototypeOf","_extend","_quillDelta","_quillDelta2","_parchment","_parchment2","_break","_break2","_inline","_inline2","_text","_text2","_Parchment$Embed","apply","domNode","insert","values","attribute","BLOCK_ATTRIBUTE","index","format","def","endsWith","block","insertBefore","next","insertAt","slice","BLOCK_BLOT","_Parchment$Block","_this2","cache","delta","descendants","reduce","leaf","Math","min","lines","text","shift","children","tail","line","ref","head","remove","context","child","force","defaultChild","allowedChildren","diff","equal","op","NULL_CHARACTER","String","fromCharCode","Delta","ops","newOp","keys","push","delete","retain","lastOp","unshift","splice","chop","pop","filter","predicate","partition","passed","failed","initial","changeLength","elem","start","end","Infinity","iter","iterator","hasNext","nextOp","compose","other","thisIter","otherIter","peekType","peekLength","thisOp","otherOp","concat","strings","prep","join","diffResult","component","opLength","INSERT","DELETE","EQUAL","eachLine","newline","peek","indexOf","transform","priority","transformPosition","offset","nextType","_Parchment$Inline","compare","BLOT","isolate","wrap","moveChildren","selfIndex","order","otherIndex","_defineProperty","expandConfig","container","userConfig","clipboard","keyboard","history","theme","Quill","DEFAULTS","import","_theme2","themeConfig","config","moduleNames","moduleConfig","moduleClass","debug","error","toolbar","document","querySelector","modify","modifier","source","strict","isEnabled","_emitter4","sources","USER","range","getSelection","oldDelta","editor","change","shiftRange","setSelection","SILENT","_emitter","args","events","TEXT_CHANGE","emitter","emit","EDITOR_CHANGE","_emitter2","overload","_typeof","API","_map","pos","_map2","_slicedToArray","_map3","max","_map4","_selection","Range","Symbol","sliceIterator","_arr","_n","_d","_e","_s","done","err","_editor","_editor2","_emitter3","_module","_module2","_selection2","_logger","_logger2","_theme","html","innerHTML","trim","classList","add","__quill","addContainer","setAttribute","scrollingContainer","scroll","whitelist","selection","addModule","init","on","type","toggle","isBlank","SCROLL_UPDATE","mutations","lastRange","update","contents","convert","setContents","clear","placeholder","readOnly","disable","limit","level","imports","path","overwrite","warn","startsWith","refNode","createElement","setRange","_this3","_overload","_overload2","deleteText","enable","enabled","scrollTop","focus","scrollIntoView","_this4","formatLine","formatText","_this5","_overload3","_overload4","_this6","_overload5","_overload6","bounds","getBounds","containerBounds","getBoundingClientRect","bottom","top","height","left","right","width","getLength","_overload7","_overload8","getContents","getFormat","Number","MAX_VALUE","getRange","_overload9","_overload10","getText","hasFocus","embed","_this7","insertEmbed","_this8","_overload11","_overload12","insertText","contains","off","once","dangerouslyPasteHTML","_this9","_overload13","_overload14","removeFormat","_this10","deleted","applied","applyDelta","_overload15","_overload16","_this11","version","parchment","core/module","core/theme","Module","quill","TextBlot","_Parchment$Text","_eventemitter","_eventemitter2","eventName","addEventListener","_len","_key","querySelectorAll","_node$__quill$emitter","handleDOM","Emitter","_EventEmitter","listeners","log","event","_len2","_key2","_ref","handler","SCROLL_BEFORE_UPDATE","SCROLL_OPTIMIZE","SELECTION_CHANGE","method","levels","_console","console","namespace","ns","logger","bind","newLevel","attributeBit","ATTRIBUTE","item","canAdd","replace","removeAttribute","isUndefinedOrNull","isBuffer","x","objEquiv","a","opts","isArguments","pSlice","deepEqual","ka","objectKeys","kb","e","sort","actual","expected","Date","getTime","Code","_block","_block2","_Inline","CodeBlock","_Block","textContent","frag","_descendant","descendant","_descendant2","deleteAt","nextNewline","newlineIndex","prevNewline","isolateLength","formatAt","_descendant3","_descendant4","searchIndex","lastIndexOf","appendChild","prev","optimize","removeChild","unwrap","TAB","Break","sanitize","url","protocols","anchor","href","protocol","Link","PROTOCOL_WHITELIST","SANITIZED_URL","toggleAriaAttribute","element","_keyboard","_keyboard2","_dropdown","_dropdown2","optionsCounter","Picker","select","buildPicker","style","display","label","togglePicker","keyCode","ENTER","ESCAPE","escape","preventDefault","option","tabIndex","hasAttribute","selectItem","id","buildItem","selected","buildLabel","buildOptions","close","setTimeout","trigger","selectedIndex","Event","dispatchEvent","createEvent","initEvent","isActive","makeBlot","childNodes","replaceChild","attach","linked_list_1","shadow_1","ContainerBlot","build","reverse","forEachAt","criteria","_a","lengthLeft","detach","childBlot","refBlot","some","insertInto","memo","targetParent","inclusive","position","after","addedNodes","removedNodes","mutation","body","compareDocumentPosition","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_FOLLOWING","nextSibling","FormatBlot","toLowerCase","replaceWith","replacement","wrapper","move","LeafBlot","INLINE_BLOT","Iterator","lib","keepNull","retOp","substr","_instanceof","circular","depth","includeNonEnumerable","_clone","proto","nativeMap","nativeSet","nativePromise","resolve","reject","then","__isArray","__isRegExp","RegExp","__getRegExpFlags","lastIndex","__isDate","useBuffer","Buffer","allParents","allChildren","keyChild","valueChild","set","entryChild","attrs","getOwnPropertySymbols","symbols","symbol","allPropertyNames","getOwnPropertyNames","propertyName","__objToStr","re","flags","global","ignoreCase","multiline","Map","_","Set","Promise","clonePrototype","_toConsumableArray","arr2","from","_clone2","_deepEqual","_deepEqual2","Selection","composing","mouseDown","cursor","savedRange","handleComposition","handleDragging","listenDOM","native","getNativeRange","textNode","setNativeRange","ignored","_context$range","startNode","startOffset","endNode","endOffset","restore","nativeRange","collapsed","data","scrollLength","_scroll$leaf","_scroll$leaf2","_leaf$position","_leaf$position2","createRange","setStart","_scroll$leaf3","_scroll$leaf4","_leaf$position3","_leaf$position4","setEnd","side","rect","rangeCount","getRangeAt","normalizeNative","info","normalized","normalizedToRange","activeElement","positions","indexes","_position","startContainer","endContainer","lastChild","_scroll$leaf5","_scroll$leaf6","_leaf$position5","_leaf$position6","_scroll$line","_scroll$line2","first","last","_scroll$line3","scrollBounds","removeAllRanges","addRange","blur","rangeToNative","oldRange","_getRange","_getRange2","_Parchment$Container","ColorStyle","ColorClass","ColorAttributor","_Parchment$Attributor","parseInt","makeEmbedArrowHandler","shiftKey","_ref3","where","Keyboard","LEFT","altKey","RIGHT","_quill$getLeaf3","getLeaf","_quill2","handleBackspace","_quill$getLine11","getLine","_quill$getLine12","_quill$getLine13","_quill$getLine14","curFormats","prevFormats","_op2","test","prefix","handleDelete","suffix","nextLength","_quill$getLine15","_quill$getLine16","_quill$getLine17","_quill$getLine18","nextFormats","handleDeleteRange","getLines","firstFormats","lastFormats","handleEnter","lineFormats","makeCodeBlockHandler","indent","code-block","_quill$scroll$descend","_quill$scroll$descend2","scrollIndex","getIndex","makeFormatHandler","shortKey","normalize","binding","charCodeAt","SHORTKEY","_op","_quill","navigator","platform","_Module","bindings","addBinding","metaKey","ctrlKey","userAgent","BACKSPACE","listen","evt","which","defaultPrevented","_quill$getLine","_quill$getLine2","_quill$getLeaf","_quill$getLeaf2","leafStart","offsetStart","_ref2","leafEnd","offsetEnd","prefixText","suffixText","curContext","empty","every","UP","DOWN","bold","italic","underline","outdent","outdent backspace","list","indent code-block","outdent code-block","remove tab","tab","cutoff","updateContents","list empty enter","checklist enter","_quill$getLine3","_quill$getLine4","header enter","_quill$getLine5","_quill$getLine6","header","list autofill","_quill$getLine7","_quill$getLine8","code exit","_quill$getLine9","_quill$getLine10","embed left","embed left shift","embed right","embed right shift","align","","center","justify","background","blockquote","clean","code","color","direction","rtl","float","full","formula","1","2","image","+1","-1","link","ordered","bullet","check","script","sub","super","strike","video","ShadowBlot","cloneNode","parentBlot","refDomNode","AttributorStore","styles","attr","ClassAttributor","result","camelize","parts","rest","part","StyleAttributor","Cursor","createTextNode","CONTENTS","_length","restoreText","Theme","themes","GUARD_TEXT","contentNode","childNode","leftGuard","rightGuard","prevLength","AlignStyle","AlignClass","AlignAttribute","BackgroundStyle","BackgroundClass","_color","DirectionStyle","DirectionClass","DirectionAttribute","FontClass","FontStyle","FontStyleAttributor","SizeStyle","SizeClass","Bold","_picker","_picker2","ColorPicker","_Picker","backgroundColor","colorLabel","stroke","fill","IconPicker","icons","defaultItem","Tooltip","boundsContainer","TEMPLATE","marginTop","hide","reference","offsetWidth","rootBounds","verticalShift","extractVideoUrl","fillSelect","defaultValue","BaseTooltip","_colorPicker","_colorPicker2","_iconPicker","_iconPicker2","_tooltip","_tooltip2","ALIGNS","COLORS","FONTS","HEADERS","SIZES","BaseTheme","_Theme","listener","removeEventListener","tooltip","textbox","pickers","picker","extendToolbar","buttons","button","selects","handlers","edit","fileInput","files","reader","FileReader","onload","readAsDataURL","click","_Tooltip","save","cancel","mode","preview","linkRange","restoreFocus","_core","_core2","_align","_direction","_indent","_blockquote","_blockquote2","_header","_header2","_list","_list2","_background","_font","_size","_bold","_bold2","_italic","_italic2","_link","_link2","_script","_script2","_strike","_strike2","_underline","_underline2","_image","_image2","_video","_video2","_code","_code2","_formula","_formula2","_syntax","_syntax2","_toolbar","_toolbar2","_icons","_icons2","_bubble","_bubble2","_snow","_snow2","attributors/attribute/direction","attributors/class/align","attributors/class/background","attributors/class/color","attributors/class/direction","attributors/class/font","attributors/class/size","attributors/style/align","attributors/style/background","attributors/style/color","attributors/style/direction","attributors/style/font","attributors/style/size","formats/align","formats/direction","formats/indent","IndentClass","formats/background","formats/color","formats/font","formats/size","formats/blockquote","formats/code-block","formats/header","formats/list","formats/bold","formats/code","formats/italic","formats/link","formats/script","formats/strike","formats/underline","formats/image","formats/video","formats/list/item","ListItem","modules/formula","modules/syntax","modules/toolbar","themes/bubble","themes/snow","ui/icons","ui/picker","ui/icon-picker","ui/color-picker","ui/tooltip","_container","_container2","_cursor","_cursor2","_embed","_embed2","_scroll","_scroll2","_clipboard","_clipboard2","_history","_history2","blots/block","blots/block/embed","blots/break","blots/container","blots/cursor","blots/embed","blots/inline","blots/scroll","blots/text","modules/clipboard","modules/history","modules/keyboard","LinkedList","append","nodes","cur","curNode","ret","callback","curIndex","curLength","OBSERVER_CONFIG","characterData","characterDataOldValue","childList","subtree","ScrollBlot","observer","MutationObserver","observe","disconnect","records","takeRecords","mark","markParent","remaining","previousSibling","grandChild","isEqual","obj1","obj2","prop","InlineBlot","BlockBlot","EmbedBlot","splitText","_toggle","DOMTokenList","token","searchString","subjectString","isFinite","floor","thisArg","execCommand","diff_main","text1","text2","cursor_pos","DIFF_EQUAL","commonlength","diff_commonPrefix","commonprefix","substring","diff_commonSuffix","commonsuffix","diffs","diff_compute_","diff_cleanupMerge","fix_cursor","fix_emoji","DIFF_INSERT","DIFF_DELETE","longtext","shorttext","hm","diff_halfMatch_","text1_a","text1_b","text2_a","text2_b","mid_common","diffs_a","diffs_b","diff_bisect_","text1_length","text2_length","max_d","ceil","v_offset","v_length","v1","v2","front","k1start","k1end","k2start","k2end","k1","x1","k1_offset","y1","charAt","k2_offset","x2","diff_bisectSplit_","k2","y2","y","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","pointerend","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","j","best_common","prefixLength","suffixLength","hm1","hm2","pointer","count_delete","count_insert","text_delete","text_insert","changes","cursor_normalize_diff","current_pos","next_pos","split_pos","d_left","d_right","norm","ndiffs","cursor_pointer","d_next","merge_tuples","compact","starts_with_pair_end","str","fixed_diffs","left_d","right_d","shim","supported","unsupported","propertyIsEnumerable","supportsArgumentsClass","combineFormats","combined","merged","normalizeDelta","ASCII","Editor","getDelta","consumeNextNewline","batchStart","_line$descendant","_line$descendant2","batchEnd","lengthRemaining","lineLength","codeIndex","codeLength","leaves","_path","formatsArr","blots","_scroll$line4","cursorIndex","textBlot","oldValue","oldText","newText","Events","EE","fn","EventEmitter","_events","_eventsCount","has","eventNames","exists","available","ee","a1","a2","a3","a4","a5","len","removeListener","removeAllListeners","addListener","setMaxListeners","prefixed","isLine","_Parchment$Scroll","batch","_line","_line2","_line3","_line4","applyFormat","_extend3","computeStyle","nodeType","ELEMENT_NODE","window","getComputedStyle","deltaEndsWith","endText","traverse","elementMatchers","textMatchers","matcher","childrenDelta","DOM_KEY","matchAlias","matchAttributor","ATTRIBUTE_ATTRIBUTORS","STYLE_ATTRIBUTORS","matchBlot","matchBreak","matchIgnore","matchIndent","matchNewline","matchSpacing","nextElementSibling","nodeHeight","offsetHeight","parseFloat","marginBottom","offsetTop","matchStyles","fontStyle","fontWeight","textIndent","matchText","whiteSpace","replacer","collapse","CLIPBOARD_CONFIG","Clipboard","onPaste","matchers","selector","matchVisual","addMatcher","innerText","_prepareMatching","prepareMatching","_prepareMatching2","paste","pair","_pair","endsWithNewlineChange","getLastChangeIndex","deleteLength","changeIndex","History","lastRecorded","ignoreChange","userOnly","record","undo","redo","dest","stack","changeDelta","undoDelta","timestamp","now","delay","maxStack","IdentAttributor","Blockquote","Header","List","_Container","listEventHandler","Italic","_Bold","Script","Strike","Underline","ATTRIBUTES","Image","Video","_BlockEmbed","FormulaBlot","_Embed","katex","render","throwOnError","errorColor","Formula","CodeToken","SyntaxCodeBlock","_CodeBlock","highlight","cachedText","Syntax","timer","clearTimeout","interval","hljs","highlightAuto","addButton","addControls","groups","controls","group","control","addSelect","Toolbar","_ret","addHandler","_this$quill$selection","_this$quill$selection2","_quill$selection$getR","_quill$selection$getR2","prompt","BubbleTooltip","_base","_base2","TOOLBAR_CONFIG","BubbleTheme","_BaseTheme","buildButtons","buildPickers","_BaseTooltip","show","lastLine","arrow","marginLeft","SnowTheme","SnowTooltip"],"mappings":";;;;;;CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,KACC,mBAAAK,WAAAC,KAAA,WACD,MCMgB,UAAUC,GCZ1B,QAAAC,GA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,GAAa,MAATM,EAAJ,CACA,GAAqB,IAAjBA,EAAM7N,QAAgBuN,IAAWqB,EAAAtR,QAAQqQ,QAAQC,KAAM,IAAAye,GACpCnZ,EAAKmE,MAAMjG,OAAOmK,WAAlB6e,EAAA98B,QAAuCuQ,EAAMpI,OADT6mB,EAAAnd,EAAAkd,EAAA,GACpD0F,EADoDzF,EAAA,GAC9ClhB,EAD8CkhB,EAAA,EAEzD,IAAY,MAARyF,EAAc,CAChB7e,EAAK6lB,UAAY,GAAAxpB,GAAAC,MAAU3B,EAAMpI,MAAQ2F,EAAQ2mB,EAAK/xB,SACtD,IAAI84B,GAAUsB,EAAA98B,QAAS+F,QAAQ0uB,EAAK3sB,QAKpC,OAJA8N,GAAK4lB,QAAQ1d,YAAc0d,EAC3B5lB,EAAK4lB,QAAQ5nB,aAAa,OAAQ4nB,GAClC5lB,EAAK4hC,WACL5hC,GAAK2N,SAAS3N,EAAKmE,MAAMhD,UAAUnB,EAAK6lB,wBAInC7lB,GAAK6lB,SAEd7lB,GAAK+iB,a9GmmWPj0B,IAAK,OACL/F,MAAO,W8G/lWPgI,EAAAkxC,EAAAt5C,UAAAmF,WAAA5F,OAAAkJ,eAAA6wC,EAAAt5C,WAAA,OAAAvB,MAAAO,KAAAP,MACAA,KAAKP,KAAK4f,gBAAgB,iB9GomWrBw7B,GACPb,EAAM7d,Y8GlmWR0e,GAAYpf,UACV,gEACA,mGACA,4BACA,6BACAzrB,KAAK,I9GimWPrQ,EAAQqD,Q8G9lWO43C,K9GimWM","file":"quill.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","/*!\n * Quill Editor v1.3.6\n * https://quilljs.com/\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 45);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = __webpack_require__(17);\nvar format_1 = __webpack_require__(18);\nvar leaf_1 = __webpack_require__(19);\nvar scroll_1 = __webpack_require__(48);\nvar inline_1 = __webpack_require__(49);\nvar block_1 = __webpack_require__(50);\nvar embed_1 = __webpack_require__(51);\nvar text_1 = __webpack_require__(52);\nvar attributor_1 = __webpack_require__(11);\nvar class_1 = __webpack_require__(29);\nvar style_1 = __webpack_require__(30);\nvar store_1 = __webpack_require__(28);\nvar Registry = __webpack_require__(1);\nvar Parchment = {\n Scope: Registry.Scope,\n create: Registry.create,\n find: Registry.find,\n query: Registry.query,\n register: Registry.register,\n Container: container_1.default,\n Format: format_1.default,\n Leaf: leaf_1.default,\n Embed: embed_1.default,\n Scroll: scroll_1.default,\n Block: block_1.default,\n Inline: inline_1.default,\n Text: text_1.default,\n Attributor: {\n Attribute: attributor_1.default,\n Class: class_1.default,\n Style: style_1.default,\n Store: store_1.default,\n },\n};\nexports.default = Parchment;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ParchmentError = /** @class */ (function (_super) {\n __extends(ParchmentError, _super);\n function ParchmentError(message) {\n var _this = this;\n message = '[Parchment] ' + message;\n _this = _super.call(this, message) || this;\n _this.message = message;\n _this.name = _this.constructor.name;\n return _this;\n }\n return ParchmentError;\n}(Error));\nexports.ParchmentError = ParchmentError;\nvar attributes = {};\nvar classes = {};\nvar tags = {};\nvar types = {};\nexports.DATA_KEY = '__blot';\nvar Scope;\n(function (Scope) {\n Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n})(Scope = exports.Scope || (exports.Scope = {}));\nfunction create(input, value) {\n var match = query(input);\n if (match == null) {\n throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n }\n var BlotClass = match;\n var node = \n // @ts-ignore\n input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value);\n return new BlotClass(node, value);\n}\nexports.create = create;\nfunction find(node, bubble) {\n if (bubble === void 0) { bubble = false; }\n if (node == null)\n return null;\n // @ts-ignore\n if (node[exports.DATA_KEY] != null)\n return node[exports.DATA_KEY].blot;\n if (bubble)\n return find(node.parentNode, bubble);\n return null;\n}\nexports.find = find;\nfunction query(query, scope) {\n if (scope === void 0) { scope = Scope.ANY; }\n var match;\n if (typeof query === 'string') {\n match = types[query] || attributes[query];\n // @ts-ignore\n }\n else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) {\n match = types['text'];\n }\n else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = types['block'];\n }\n else if (query & Scope.LEVEL & Scope.INLINE) {\n match = types['inline'];\n }\n }\n else if (query instanceof HTMLElement) {\n var names = (query.getAttribute('class') || '').split(/\\s+/);\n for (var i in names) {\n match = classes[names[i]];\n if (match)\n break;\n }\n match = match || tags[query.tagName];\n }\n if (match == null)\n return null;\n // @ts-ignore\n if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)\n return match;\n return null;\n}\nexports.query = query;\nfunction register() {\n var Definitions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n Definitions[_i] = arguments[_i];\n }\n if (Definitions.length > 1) {\n return Definitions.map(function (d) {\n return register(d);\n });\n }\n var Definition = Definitions[0];\n if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n throw new ParchmentError('Invalid definition');\n }\n else if (Definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n types[Definition.blotName || Definition.attrName] = Definition;\n if (typeof Definition.keyName === 'string') {\n attributes[Definition.keyName] = Definition;\n }\n else {\n if (Definition.className != null) {\n classes[Definition.className] = Definition;\n }\n if (Definition.tagName != null) {\n if (Array.isArray(Definition.tagName)) {\n Definition.tagName = Definition.tagName.map(function (tagName) {\n return tagName.toUpperCase();\n });\n }\n else {\n Definition.tagName = Definition.tagName.toUpperCase();\n }\n var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n tagNames.forEach(function (tag) {\n if (tags[tag] == null || Definition.className == null) {\n tags[tag] = Definition;\n }\n });\n }\n }\n return Definition;\n}\nexports.register = register;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = target[name];\n\t\t\t\tcopy = options[name];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\ttarget[name] = extend(deep, clone, copy);\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.BlockEmbed = exports.bubbleFormats = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _break = __webpack_require__(14);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar NEWLINE_LENGTH = 1;\n\nvar BlockEmbed = function (_Parchment$Embed) {\n _inherits(BlockEmbed, _Parchment$Embed);\n\n function BlockEmbed() {\n _classCallCheck(this, BlockEmbed);\n\n return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments));\n }\n\n _createClass(BlockEmbed, [{\n key: 'attach',\n value: function attach() {\n _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this);\n this.attributes = new _parchment2.default.Attributor.Store(this.domNode);\n }\n }, {\n key: 'delta',\n value: function delta() {\n return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values()));\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n this.format(name, value);\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n var block = _parchment2.default.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def);\n }\n }\n }]);\n\n return BlockEmbed;\n}(_parchment2.default.Embed);\n\nBlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\n\nvar Block = function (_Parchment$Block) {\n _inherits(Block, _Parchment$Block);\n\n function Block(domNode) {\n _classCallCheck(this, Block);\n\n var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode));\n\n _this2.cache = {};\n return _this2;\n }\n\n _createClass(Block, [{\n key: 'delta',\n value: function delta() {\n if (this.cache.delta == null) {\n this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) {\n if (leaf.length() === 0) {\n return delta;\n } else {\n return delta.insert(leaf.value(), bubbleFormats(leaf));\n }\n }, new _quillDelta2.default()).insert('\\n', bubbleFormats(this));\n }\n return this.cache.delta;\n }\n }, {\n key: 'deleteAt',\n value: function deleteAt(index, length) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length);\n this.cache = {};\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value);\n }\n this.cache = {};\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def);\n if (value.length === 0) return;\n var lines = value.split('\\n');\n var text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n var block = this;\n lines.reduce(function (index, line) {\n block = block.split(index, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n }, {\n key: 'insertBefore',\n value: function insertBefore(blot, ref) {\n var head = this.children.head;\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref);\n if (head instanceof _break2.default) {\n head.remove();\n }\n this.cache = {};\n }\n }, {\n key: 'length',\n value: function length() {\n if (this.cache.length == null) {\n this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n }, {\n key: 'moveChildren',\n value: function moveChildren(target, ref) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref);\n this.cache = {};\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context);\n this.cache = {};\n }\n }, {\n key: 'path',\n value: function path(index) {\n return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true);\n }\n }, {\n key: 'removeChild',\n value: function removeChild(child) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child);\n this.cache = {};\n }\n }, {\n key: 'split',\n value: function split(index) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n var clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n } else {\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n } else {\n var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force);\n this.cache = {};\n return next;\n }\n }\n }]);\n\n return Block;\n}(_parchment2.default.Block);\n\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = 'break';\nBlock.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default];\n\nfunction bubbleFormats(blot) {\n var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = (0, _extend2.default)(formats, blot.formats());\n }\n if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats);\n}\n\nexports.bubbleFormats = bubbleFormats;\nexports.BlockEmbed = BlockEmbed;\nexports.default = Block;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar diff = __webpack_require__(54);\nvar equal = __webpack_require__(12);\nvar extend = __webpack_require__(2);\nvar op = __webpack_require__(20);\n\n\nvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\n\nvar Delta = function (ops) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n};\n\n\nDelta.prototype.insert = function (text, attributes) {\n var newOp = {};\n if (text.length === 0) return this;\n newOp.insert = text;\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype['delete'] = function (length) {\n if (length <= 0) return this;\n return this.push({ 'delete': length });\n};\n\nDelta.prototype.retain = function (length, attributes) {\n if (length <= 0) return this;\n var newOp = { retain: length };\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype.push = function (newOp) {\n var index = this.ops.length;\n var lastOp = this.ops[index - 1];\n newOp = extend(true, {}, newOp);\n if (typeof lastOp === 'object') {\n if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {\n this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (equal(newOp.attributes, lastOp.attributes)) {\n if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n};\n\nDelta.prototype.chop = function () {\n var lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n};\n\nDelta.prototype.filter = function (predicate) {\n return this.ops.filter(predicate);\n};\n\nDelta.prototype.forEach = function (predicate) {\n this.ops.forEach(predicate);\n};\n\nDelta.prototype.map = function (predicate) {\n return this.ops.map(predicate);\n};\n\nDelta.prototype.partition = function (predicate) {\n var passed = [], failed = [];\n this.forEach(function(op) {\n var target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n};\n\nDelta.prototype.reduce = function (predicate, initial) {\n return this.ops.reduce(predicate, initial);\n};\n\nDelta.prototype.changeLength = function () {\n return this.reduce(function (length, elem) {\n if (elem.insert) {\n return length + op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n};\n\nDelta.prototype.length = function () {\n return this.reduce(function (length, elem) {\n return length + op.length(elem);\n }, 0);\n};\n\nDelta.prototype.slice = function (start, end) {\n start = start || 0;\n if (typeof end !== 'number') end = Infinity;\n var ops = [];\n var iter = op.iterator(this.ops);\n var index = 0;\n while (index < end && iter.hasNext()) {\n var nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += op.length(nextOp);\n }\n return new Delta(ops);\n};\n\n\nDelta.prototype.compose = function (other) {\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (typeof otherOp.retain === 'number') {\n var newOp = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length;\n } else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n if (attributes) newOp.attributes = attributes;\n delta.push(newOp);\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.concat = function (other) {\n var delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n};\n\nDelta.prototype.diff = function (other, index) {\n if (this.ops === other.ops) {\n return new Delta();\n }\n var strings = [this, other].map(function (delta) {\n return delta.map(function (op) {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n var prep = (delta === other) ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n }).join('');\n });\n var delta = new Delta();\n var diffResult = diff(strings[0], strings[1], index);\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n diffResult.forEach(function (component) {\n var length = component[1].length;\n while (length > 0) {\n var opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n delta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n delta['delete'](opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n var thisOp = thisIter.next(opLength);\n var otherOp = otherIter.next(opLength);\n if (equal(thisOp.insert, otherOp.insert)) {\n delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));\n } else {\n delta.push(otherOp)['delete'](opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return delta.chop();\n};\n\nDelta.prototype.eachLine = function (predicate, newline) {\n newline = newline || '\\n';\n var iter = op.iterator(this.ops);\n var line = new Delta();\n var i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') return;\n var thisOp = iter.peek();\n var start = op.length(thisOp) - iter.peekLength();\n var index = typeof thisOp.insert === 'string' ?\n thisOp.insert.indexOf(newline, start) - start : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n};\n\nDelta.prototype.transform = function (other, priority) {\n priority = !!priority;\n if (typeof other === 'number') {\n return this.transformPosition(other, priority);\n }\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {\n delta.retain(op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (thisOp['delete']) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp['delete']) {\n delta.push(otherOp);\n } else {\n // We retain either their retain or insert\n delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.transformPosition = function (index, priority) {\n priority = !!priority;\n var thisIter = op.iterator(this.ops);\n var offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n var length = thisIter.peekLength();\n var nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n};\n\n\nmodule.exports = Delta;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Inline = function (_Parchment$Inline) {\n _inherits(Inline, _Parchment$Inline);\n\n function Inline() {\n _classCallCheck(this, Inline);\n\n return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments));\n }\n\n _createClass(Inline, [{\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) {\n var blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value);\n }\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context);\n if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n var parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n }], [{\n key: 'compare',\n value: function compare(self, other) {\n var selfIndex = Inline.order.indexOf(self);\n var otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n } else if (self === other) {\n return 0;\n } else if (self < other) {\n return -1;\n } else {\n return 1;\n }\n }\n }]);\n\n return Inline;\n}(_parchment2.default.Inline);\n\nInline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = ['cursor', 'inline', // Must be lower\n'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher\n];\n\nexports.default = Inline;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.overload = exports.expandConfig = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\n__webpack_require__(53);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _editor = __webpack_require__(57);\n\nvar _editor2 = _interopRequireDefault(_editor);\n\nvar _emitter3 = __webpack_require__(9);\n\nvar _emitter4 = _interopRequireDefault(_emitter3);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _selection = __webpack_require__(22);\n\nvar _selection2 = _interopRequireDefault(_selection);\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _theme = __webpack_require__(32);\n\nvar _theme2 = _interopRequireDefault(_theme);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar debug = (0, _logger2.default)('quill');\n\nvar Quill = function () {\n _createClass(Quill, null, [{\n key: 'debug',\n value: function debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n _logger2.default.level(limit);\n }\n }, {\n key: 'find',\n value: function find(node) {\n return node.__quill || _parchment2.default.find(node);\n }\n }, {\n key: 'import',\n value: function _import(name) {\n if (this.imports[name] == null) {\n debug.error('Cannot import ' + name + '. Are you sure it was registered?');\n }\n return this.imports[name];\n }\n }, {\n key: 'register',\n value: function register(path, target) {\n var _this = this;\n\n var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof path !== 'string') {\n var name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register('formats/' + name, path, target);\n } else {\n Object.keys(path).forEach(function (key) {\n _this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn('Overwriting ' + path + ' with', target);\n }\n this.imports[path] = target;\n if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') {\n _parchment2.default.register(target);\n } else if (path.startsWith('modules') && typeof target.register === 'function') {\n target.register();\n }\n }\n }\n }]);\n\n function Quill(container) {\n var _this2 = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Quill);\n\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n var html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n this.container.__quill = this;\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new _emitter4.default();\n this.scroll = _parchment2.default.create(this.root, {\n emitter: this.emitter,\n whitelist: this.options.formats\n });\n this.editor = new _editor2.default(this.scroll);\n this.selection = new _selection2.default(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options);\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.theme.init();\n this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) {\n if (type === _emitter4.default.events.TEXT_CHANGE) {\n _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank());\n }\n });\n this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) {\n var range = _this2.selection.lastRange;\n var index = range && range.length === 0 ? range.index : undefined;\n modify.call(_this2, function () {\n return _this2.editor.update(null, mutations, index);\n }, source);\n });\n var contents = this.clipboard.convert('
    ' + html + '


    ');\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n }\n\n _createClass(Quill, [{\n key: 'addContainer',\n value: function addContainer(container) {\n var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (typeof container === 'string') {\n var className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n }, {\n key: 'blur',\n value: function blur() {\n this.selection.setRange(null);\n }\n }, {\n key: 'deleteText',\n value: function deleteText(index, length, source) {\n var _this3 = this;\n\n var _overload = overload(index, length, source);\n\n var _overload2 = _slicedToArray(_overload, 4);\n\n index = _overload2[0];\n length = _overload2[1];\n source = _overload2[3];\n\n return modify.call(this, function () {\n return _this3.editor.deleteText(index, length);\n }, source, index, -1 * length);\n }\n }, {\n key: 'disable',\n value: function disable() {\n this.enable(false);\n }\n }, {\n key: 'enable',\n value: function enable() {\n var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n }, {\n key: 'focus',\n value: function focus() {\n var scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n var _this4 = this;\n\n var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;\n\n return modify.call(this, function () {\n var range = _this4.getSelection(true);\n var change = new _quillDelta2.default();\n if (range == null) {\n return change;\n } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {\n change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value));\n } else if (range.length === 0) {\n _this4.selection.format(name, value);\n return change;\n } else {\n change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value));\n }\n _this4.setSelection(range, _emitter4.default.sources.SILENT);\n return change;\n }, source);\n }\n }, {\n key: 'formatLine',\n value: function formatLine(index, length, name, value, source) {\n var _this5 = this;\n\n var formats = void 0;\n\n var _overload3 = overload(index, length, name, value, source);\n\n var _overload4 = _slicedToArray(_overload3, 4);\n\n index = _overload4[0];\n length = _overload4[1];\n formats = _overload4[2];\n source = _overload4[3];\n\n return modify.call(this, function () {\n return _this5.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n }, {\n key: 'formatText',\n value: function formatText(index, length, name, value, source) {\n var _this6 = this;\n\n var formats = void 0;\n\n var _overload5 = overload(index, length, name, value, source);\n\n var _overload6 = _slicedToArray(_overload5, 4);\n\n index = _overload6[0];\n length = _overload6[1];\n formats = _overload6[2];\n source = _overload6[3];\n\n return modify.call(this, function () {\n return _this6.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n }, {\n key: 'getBounds',\n value: function getBounds(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var bounds = void 0;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n var containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n }, {\n key: 'getContents',\n value: function getContents() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload7 = overload(index, length);\n\n var _overload8 = _slicedToArray(_overload7, 2);\n\n index = _overload8[0];\n length = _overload8[1];\n\n return this.editor.getContents(index, length);\n }\n }, {\n key: 'getFormat',\n value: function getFormat() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n } else {\n return this.editor.getFormat(index.index, index.length);\n }\n }\n }, {\n key: 'getIndex',\n value: function getIndex(blot) {\n return blot.offset(this.scroll);\n }\n }, {\n key: 'getLength',\n value: function getLength() {\n return this.scroll.length();\n }\n }, {\n key: 'getLeaf',\n value: function getLeaf(index) {\n return this.scroll.leaf(index);\n }\n }, {\n key: 'getLine',\n value: function getLine(index) {\n return this.scroll.line(index);\n }\n }, {\n key: 'getLines',\n value: function getLines() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n } else {\n return this.scroll.lines(index, length);\n }\n }\n }, {\n key: 'getModule',\n value: function getModule(name) {\n return this.theme.modules[name];\n }\n }, {\n key: 'getSelection',\n value: function getSelection() {\n var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n }, {\n key: 'getText',\n value: function getText() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload9 = overload(index, length);\n\n var _overload10 = _slicedToArray(_overload9, 2);\n\n index = _overload10[0];\n length = _overload10[1];\n\n return this.editor.getText(index, length);\n }\n }, {\n key: 'hasFocus',\n value: function hasFocus() {\n return this.selection.hasFocus();\n }\n }, {\n key: 'insertEmbed',\n value: function insertEmbed(index, embed, value) {\n var _this7 = this;\n\n var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n\n return modify.call(this, function () {\n return _this7.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n }, {\n key: 'insertText',\n value: function insertText(index, text, name, value, source) {\n var _this8 = this;\n\n var formats = void 0;\n\n var _overload11 = overload(index, 0, name, value, source);\n\n var _overload12 = _slicedToArray(_overload11, 4);\n\n index = _overload12[0];\n formats = _overload12[2];\n source = _overload12[3];\n\n return modify.call(this, function () {\n return _this8.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n }, {\n key: 'isEnabled',\n value: function isEnabled() {\n return !this.container.classList.contains('ql-disabled');\n }\n }, {\n key: 'off',\n value: function off() {\n return this.emitter.off.apply(this.emitter, arguments);\n }\n }, {\n key: 'on',\n value: function on() {\n return this.emitter.on.apply(this.emitter, arguments);\n }\n }, {\n key: 'once',\n value: function once() {\n return this.emitter.once.apply(this.emitter, arguments);\n }\n }, {\n key: 'pasteHTML',\n value: function pasteHTML(index, html, source) {\n this.clipboard.dangerouslyPasteHTML(index, html, source);\n }\n }, {\n key: 'removeFormat',\n value: function removeFormat(index, length, source) {\n var _this9 = this;\n\n var _overload13 = overload(index, length, source);\n\n var _overload14 = _slicedToArray(_overload13, 4);\n\n index = _overload14[0];\n length = _overload14[1];\n source = _overload14[3];\n\n return modify.call(this, function () {\n return _this9.editor.removeFormat(index, length);\n }, source, index);\n }\n }, {\n key: 'scrollIntoView',\n value: function scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }, {\n key: 'setContents',\n value: function setContents(delta) {\n var _this10 = this;\n\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\n return modify.call(this, function () {\n delta = new _quillDelta2.default(delta);\n var length = _this10.getLength();\n var deleted = _this10.editor.deleteText(0, length);\n var applied = _this10.editor.applyDelta(delta);\n var lastOp = applied.ops[applied.ops.length - 1];\n if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\\n') {\n _this10.editor.deleteText(_this10.getLength() - 1, 1);\n applied.delete(1);\n }\n var ret = deleted.compose(applied);\n return ret;\n }, source);\n }\n }, {\n key: 'setSelection',\n value: function setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n var _overload15 = overload(index, length, source);\n\n var _overload16 = _slicedToArray(_overload15, 4);\n\n index = _overload16[0];\n length = _overload16[1];\n source = _overload16[3];\n\n this.selection.setRange(new _selection.Range(index, length), source);\n if (source !== _emitter4.default.sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n }, {\n key: 'setText',\n value: function setText(text) {\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\n var delta = new _quillDelta2.default().insert(text);\n return this.setContents(delta, source);\n }\n }, {\n key: 'update',\n value: function update() {\n var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;\n\n var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n return change;\n }\n }, {\n key: 'updateContents',\n value: function updateContents(delta) {\n var _this11 = this;\n\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\n return modify.call(this, function () {\n delta = new _quillDelta2.default(delta);\n return _this11.editor.applyDelta(delta, source);\n }, source, true);\n }\n }]);\n\n return Quill;\n}();\n\nQuill.DEFAULTS = {\n bounds: null,\n formats: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n scrollingContainer: null,\n strict: true,\n theme: 'default'\n};\nQuill.events = _emitter4.default.events;\nQuill.sources = _emitter4.default.sources;\n// eslint-disable-next-line no-undef\nQuill.version = false ? 'dev' : \"1.3.6\";\n\nQuill.imports = {\n 'delta': _quillDelta2.default,\n 'parchment': _parchment2.default,\n 'core/module': _module2.default,\n 'core/theme': _theme2.default\n};\n\nfunction expandConfig(container, userConfig) {\n userConfig = (0, _extend2.default)(true, {\n container: container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true\n }\n }, userConfig);\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = _theme2.default;\n } else {\n userConfig.theme = Quill.import('themes/' + userConfig.theme);\n if (userConfig.theme == null) {\n throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?');\n }\n }\n var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(function (config) {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(function (module) {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n var moduleConfig = moduleNames.reduce(function (config, name) {\n var moduleClass = Quill.import('modules/' + name);\n if (moduleClass == null) {\n debug.error('Cannot load ' + name + ' module. Are you sure you registered it?');\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(function (key) {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n }, {});\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n var formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value, value = name, name = length, length = index.length, index = index.index;\n } else {\n length = index.length, index = index.index;\n }\n } else if (typeof length !== 'number') {\n source = value, value = name, name = length, length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || _emitter4.default.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n var start = void 0,\n end = void 0;\n if (index instanceof _quillDelta2.default) {\n var _map = [range.index, range.index + range.length].map(function (pos) {\n return index.transformPosition(pos, source !== _emitter4.default.sources.USER);\n });\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n } else {\n var _map3 = [range.index, range.index + range.length].map(function (pos) {\n if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos;\n if (length >= 0) {\n return pos + length;\n } else {\n return Math.max(index, pos + length);\n }\n });\n\n var _map4 = _slicedToArray(_map3, 2);\n\n start = _map4[0];\n end = _map4[1];\n }\n return new _selection.Range(start, end - start);\n}\n\nexports.expandConfig = expandConfig;\nexports.overload = overload;\nexports.default = Quill;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Module = function Module(quill) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Module);\n\n this.quill = quill;\n this.options = options;\n};\n\nModule.DEFAULTS = {};\n\nexports.default = Module;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TextBlot = function (_Parchment$Text) {\n _inherits(TextBlot, _Parchment$Text);\n\n function TextBlot() {\n _classCallCheck(this, TextBlot);\n\n return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments));\n }\n\n return TextBlot;\n}(_parchment2.default.Text);\n\nexports.default = TextBlot;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _eventemitter = __webpack_require__(58);\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:events');\n\nvar EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach(function (eventName) {\n document.addEventListener(eventName, function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) {\n // TODO use WeakMap\n if (node.__quill && node.__quill.emitter) {\n var _node$__quill$emitter;\n\n (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args);\n }\n });\n });\n});\n\nvar Emitter = function (_EventEmitter) {\n _inherits(Emitter, _EventEmitter);\n\n function Emitter() {\n _classCallCheck(this, Emitter);\n\n var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this));\n\n _this.listeners = {};\n _this.on('error', debug.error);\n return _this;\n }\n\n _createClass(Emitter, [{\n key: 'emit',\n value: function emit() {\n debug.log.apply(debug, arguments);\n _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments);\n }\n }, {\n key: 'handleDOM',\n value: function handleDOM(event) {\n for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n (this.listeners[event.type] || []).forEach(function (_ref) {\n var node = _ref.node,\n handler = _ref.handler;\n\n if (event.target === node || node.contains(event.target)) {\n handler.apply(undefined, [event].concat(args));\n }\n });\n }\n }, {\n key: 'listenDOM',\n value: function listenDOM(eventName, node, handler) {\n if (!this.listeners[eventName]) {\n this.listeners[eventName] = [];\n }\n this.listeners[eventName].push({ node: node, handler: handler });\n }\n }]);\n\n return Emitter;\n}(_eventemitter2.default);\n\nEmitter.events = {\n EDITOR_CHANGE: 'editor-change',\n SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n SCROLL_OPTIMIZE: 'scroll-optimize',\n SCROLL_UPDATE: 'scroll-update',\n SELECTION_CHANGE: 'selection-change',\n TEXT_CHANGE: 'text-change'\n};\nEmitter.sources = {\n API: 'api',\n SILENT: 'silent',\n USER: 'user'\n};\n\nexports.default = Emitter;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar levels = ['error', 'warn', 'log', 'info'];\nvar level = 'warn';\n\nfunction debug(method) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n var _console;\n\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n (_console = console)[method].apply(_console, args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce(function (logger, method) {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\ndebug.level = namespace.level = function (newLevel) {\n level = newLevel;\n};\n\nexports.default = namespace;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = __webpack_require__(1);\nvar Attributor = /** @class */ (function () {\n function Attributor(attrName, keyName, options) {\n if (options === void 0) { options = {}; }\n this.attrName = attrName;\n this.keyName = keyName;\n var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n if (options.scope != null) {\n // Ignore type bits, force attribute bit\n this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n }\n else {\n this.scope = Registry.Scope.ATTRIBUTE;\n }\n if (options.whitelist != null)\n this.whitelist = options.whitelist;\n }\n Attributor.keys = function (node) {\n return [].map.call(node.attributes, function (item) {\n return item.name;\n });\n };\n Attributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.setAttribute(this.keyName, value);\n return true;\n };\n Attributor.prototype.canAdd = function (node, value) {\n var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n if (match == null)\n return false;\n if (this.whitelist == null)\n return true;\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n }\n else {\n return this.whitelist.indexOf(value) > -1;\n }\n };\n Attributor.prototype.remove = function (node) {\n node.removeAttribute(this.keyName);\n };\n Attributor.prototype.value = function (node) {\n var value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n };\n return Attributor;\n}());\nexports.default = Attributor;\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar pSlice = Array.prototype.slice;\nvar objectKeys = __webpack_require__(55);\nvar isArguments = __webpack_require__(56);\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n if (!opts) opts = {};\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected, opts);\n }\n}\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n}\n\nfunction objEquiv(a, b, opts) {\n var i, key;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n var ka = objectKeys(a),\n kb = objectKeys(b);\n } catch (e) {//happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) return false;\n }\n return typeof a === typeof b;\n}\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.Code = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Code = function (_Inline) {\n _inherits(Code, _Inline);\n\n function Code() {\n _classCallCheck(this, Code);\n\n return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments));\n }\n\n return Code;\n}(_inline2.default);\n\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\nvar CodeBlock = function (_Block) {\n _inherits(CodeBlock, _Block);\n\n function CodeBlock() {\n _classCallCheck(this, CodeBlock);\n\n return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments));\n }\n\n _createClass(CodeBlock, [{\n key: 'delta',\n value: function delta() {\n var _this3 = this;\n\n var text = this.domNode.textContent;\n if (text.endsWith('\\n')) {\n // Should always be true\n text = text.slice(0, -1);\n }\n return text.split('\\n').reduce(function (delta, frag) {\n return delta.insert(frag).insert('\\n', _this3.formats());\n }, new _quillDelta2.default());\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n if (name === this.statics.blotName && value) return;\n\n var _descendant = this.descendant(_text2.default, this.length() - 1),\n _descendant2 = _slicedToArray(_descendant, 1),\n text = _descendant2[0];\n\n if (text != null) {\n text.deleteAt(text.length() - 1, 1);\n }\n _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value);\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n if (length === 0) return;\n if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) {\n return;\n }\n var nextNewline = this.newlineIndex(index);\n if (nextNewline < 0 || nextNewline >= index + length) return;\n var prevNewline = this.newlineIndex(index, true) + 1;\n var isolateLength = nextNewline - prevNewline + 1;\n var blot = this.isolate(prevNewline, isolateLength);\n var next = blot.next;\n blot.format(name, value);\n if (next instanceof CodeBlock) {\n next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n }\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (def != null) return;\n\n var _descendant3 = this.descendant(_text2.default, index),\n _descendant4 = _slicedToArray(_descendant3, 2),\n text = _descendant4[0],\n offset = _descendant4[1];\n\n text.insertAt(offset, value);\n }\n }, {\n key: 'length',\n value: function length() {\n var length = this.domNode.textContent.length;\n if (!this.domNode.textContent.endsWith('\\n')) {\n return length + 1;\n }\n return length;\n }\n }, {\n key: 'newlineIndex',\n value: function newlineIndex(searchIndex) {\n var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!reverse) {\n var offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n return offset > -1 ? searchIndex + offset : -1;\n } else {\n return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n }\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n if (!this.domNode.textContent.endsWith('\\n')) {\n this.appendChild(_parchment2.default.create('text', '\\n'));\n }\n _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context);\n var next = this.next;\n if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n next.optimize(context);\n next.moveChildren(this);\n next.remove();\n }\n }\n }, {\n key: 'replace',\n value: function replace(target) {\n _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target);\n [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) {\n var blot = _parchment2.default.find(node);\n if (blot == null) {\n node.parentNode.removeChild(node);\n } else if (blot instanceof _parchment2.default.Embed) {\n blot.remove();\n } else {\n blot.unwrap();\n }\n });\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n }, {\n key: 'formats',\n value: function formats() {\n return true;\n }\n }]);\n\n return CodeBlock;\n}(_block2.default);\n\nCodeBlock.blotName = 'code-block';\nCodeBlock.tagName = 'PRE';\nCodeBlock.TAB = ' ';\n\nexports.Code = Code;\nexports.default = CodeBlock;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Break = function (_Parchment$Embed) {\n _inherits(Break, _Parchment$Embed);\n\n function Break() {\n _classCallCheck(this, Break);\n\n return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments));\n }\n\n _createClass(Break, [{\n key: 'insertInto',\n value: function insertInto(parent, ref) {\n if (parent.children.length === 0) {\n _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref);\n } else {\n this.remove();\n }\n }\n }, {\n key: 'length',\n value: function length() {\n return 0;\n }\n }, {\n key: 'value',\n value: function value() {\n return '';\n }\n }], [{\n key: 'value',\n value: function value() {\n return undefined;\n }\n }]);\n\n return Break;\n}(_parchment2.default.Embed);\n\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\nexports.default = Break;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.sanitize = exports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Link = function (_Inline) {\n _inherits(Link, _Inline);\n\n function Link() {\n _classCallCheck(this, Link);\n\n return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments));\n }\n\n _createClass(Link, [{\n key: 'format',\n value: function format(name, value) {\n if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value);\n value = this.constructor.sanitize(value);\n this.domNode.setAttribute('href', value);\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value);\n value = this.sanitize(value);\n node.setAttribute('href', value);\n node.setAttribute('target', '_blank');\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n return domNode.getAttribute('href');\n }\n }, {\n key: 'sanitize',\n value: function sanitize(url) {\n return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n }]);\n\n return Link;\n}(_inline2.default);\n\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\nLink.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];\n\nfunction _sanitize(url, protocols) {\n var anchor = document.createElement('a');\n anchor.href = url;\n var protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\nexports.default = Link;\nexports.sanitize = _sanitize;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _keyboard = __webpack_require__(25);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\n\nvar _dropdown = __webpack_require__(106);\n\nvar _dropdown2 = _interopRequireDefault(_dropdown);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar optionsCounter = 0;\n\nfunction toggleAriaAttribute(element, attribute) {\n element.setAttribute(attribute, !(element.getAttribute(attribute) === 'true'));\n}\n\nvar Picker = function () {\n function Picker(select) {\n var _this = this;\n\n _classCallCheck(this, Picker);\n\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n this.select.parentNode.insertBefore(this.container, this.select);\n\n this.label.addEventListener('mousedown', function () {\n _this.togglePicker();\n });\n this.label.addEventListener('keydown', function (event) {\n switch (event.keyCode) {\n // Allows the \"Enter\" key to open the picker\n case _keyboard2.default.keys.ENTER:\n _this.togglePicker();\n break;\n\n // Allows the \"Escape\" key to close the picker\n case _keyboard2.default.keys.ESCAPE:\n _this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n _createClass(Picker, [{\n key: 'togglePicker',\n value: function togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n }, {\n key: 'buildItem',\n value: function buildItem(option) {\n var _this2 = this;\n\n var item = document.createElement('span');\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n\n item.classList.add('ql-picker-item');\n if (option.hasAttribute('value')) {\n item.setAttribute('data-value', option.getAttribute('value'));\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', function () {\n _this2.selectItem(item, true);\n });\n item.addEventListener('keydown', function (event) {\n switch (event.keyCode) {\n // Allows the \"Enter\" key to select an item\n case _keyboard2.default.keys.ENTER:\n _this2.selectItem(item, true);\n event.preventDefault();\n break;\n\n // Allows the \"Escape\" key to close the picker\n case _keyboard2.default.keys.ESCAPE:\n _this2.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n\n return item;\n }\n }, {\n key: 'buildLabel',\n value: function buildLabel() {\n var label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = _dropdown2.default;\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n }, {\n key: 'buildOptions',\n value: function buildOptions() {\n var _this3 = this;\n\n var options = document.createElement('span');\n options.classList.add('ql-picker-options');\n\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n options.tabIndex = '-1';\n\n // Need a unique id for aria-controls\n options.id = 'ql-picker-options-' + optionsCounter;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n\n this.options = options;\n\n [].slice.call(this.select.options).forEach(function (option) {\n var item = _this3.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n _this3.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n }, {\n key: 'buildPicker',\n value: function buildPicker() {\n var _this4 = this;\n\n [].slice.call(this.select.attributes).forEach(function (item) {\n _this4.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n }, {\n key: 'escape',\n value: function escape() {\n var _this5 = this;\n\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(function () {\n return _this5.label.focus();\n }, 1);\n }\n }, {\n key: 'close',\n value: function close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n this.options.setAttribute('aria-hidden', 'true');\n }\n }, {\n key: 'selectItem',\n value: function selectItem(item) {\n var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);\n if (item.hasAttribute('data-value')) {\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n if (typeof Event === 'function') {\n this.select.dispatchEvent(new Event('change'));\n } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') {\n // IE11\n var event = document.createEvent('Event');\n event.initEvent('change', true, true);\n this.select.dispatchEvent(event);\n }\n this.close();\n }\n }\n }, {\n key: 'update',\n value: function update() {\n var option = void 0;\n if (this.select.selectedIndex > -1) {\n var item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex];\n option = this.select.options[this.select.selectedIndex];\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n var isActive = option != null && option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n }]);\n\n return Picker;\n}();\n\nexports.default = Picker;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar linked_list_1 = __webpack_require__(47);\nvar shadow_1 = __webpack_require__(27);\nvar Registry = __webpack_require__(1);\nvar ContainerBlot = /** @class */ (function (_super) {\n __extends(ContainerBlot, _super);\n function ContainerBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.build();\n return _this;\n }\n ContainerBlot.prototype.appendChild = function (other) {\n this.insertBefore(other);\n };\n ContainerBlot.prototype.attach = function () {\n _super.prototype.attach.call(this);\n this.children.forEach(function (child) {\n child.attach();\n });\n };\n ContainerBlot.prototype.build = function () {\n var _this = this;\n this.children = new linked_list_1.default();\n // Need to be reversed for if DOM nodes already in order\n [].slice\n .call(this.domNode.childNodes)\n .reverse()\n .forEach(function (node) {\n try {\n var child = makeBlot(node);\n _this.insertBefore(child, _this.children.head || undefined);\n }\n catch (err) {\n if (err instanceof Registry.ParchmentError)\n return;\n else\n throw err;\n }\n });\n };\n ContainerBlot.prototype.deleteAt = function (index, length) {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.deleteAt(offset, length);\n });\n };\n ContainerBlot.prototype.descendant = function (criteria, index) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n return [child, offset];\n }\n else if (child instanceof ContainerBlot) {\n return child.descendant(criteria, offset);\n }\n else {\n return [null, -1];\n }\n };\n ContainerBlot.prototype.descendants = function (criteria, index, length) {\n if (index === void 0) { index = 0; }\n if (length === void 0) { length = Number.MAX_VALUE; }\n var descendants = [];\n var lengthLeft = length;\n this.children.forEachAt(index, length, function (child, index, length) {\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n descendants.push(child);\n }\n if (child instanceof ContainerBlot) {\n descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return descendants;\n };\n ContainerBlot.prototype.detach = function () {\n this.children.forEach(function (child) {\n child.detach();\n });\n _super.prototype.detach.call(this);\n };\n ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.formatAt(offset, length, name, value);\n });\n };\n ContainerBlot.prototype.insertAt = function (index, value, def) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if (child) {\n child.insertAt(offset, value, def);\n }\n else {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n this.appendChild(blot);\n }\n };\n ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n if (this.statics.allowedChildren != null &&\n !this.statics.allowedChildren.some(function (child) {\n return childBlot instanceof child;\n })) {\n throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n }\n childBlot.insertInto(this, refBlot);\n };\n ContainerBlot.prototype.length = function () {\n return this.children.reduce(function (memo, child) {\n return memo + child.length();\n }, 0);\n };\n ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n this.children.forEach(function (child) {\n targetParent.insertBefore(child, refNode);\n });\n };\n ContainerBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n var child = Registry.create(this.statics.defaultChild);\n this.appendChild(child);\n child.optimize(context);\n }\n else {\n this.remove();\n }\n }\n };\n ContainerBlot.prototype.path = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n var position = [[this, index]];\n if (child instanceof ContainerBlot) {\n return position.concat(child.path(offset, inclusive));\n }\n else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n };\n ContainerBlot.prototype.removeChild = function (child) {\n this.children.remove(child);\n };\n ContainerBlot.prototype.replace = function (target) {\n if (target instanceof ContainerBlot) {\n target.moveChildren(this);\n }\n _super.prototype.replace.call(this, target);\n };\n ContainerBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = this.clone();\n this.parent.insertBefore(after, this.next);\n this.children.forEachAt(index, this.length(), function (child, offset, length) {\n child = child.split(offset, force);\n after.appendChild(child);\n });\n return after;\n };\n ContainerBlot.prototype.unwrap = function () {\n this.moveChildren(this.parent, this.next);\n this.remove();\n };\n ContainerBlot.prototype.update = function (mutations, context) {\n var _this = this;\n var addedNodes = [];\n var removedNodes = [];\n mutations.forEach(function (mutation) {\n if (mutation.target === _this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach(function (node) {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (node.parentNode != null &&\n // @ts-ignore\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return;\n }\n var blot = Registry.find(node);\n if (blot == null)\n return;\n if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n blot.detach();\n }\n });\n addedNodes\n .filter(function (node) {\n return node.parentNode == _this.domNode;\n })\n .sort(function (a, b) {\n if (a === b)\n return 0;\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach(function (node) {\n var refBlot = null;\n if (node.nextSibling != null) {\n refBlot = Registry.find(node.nextSibling);\n }\n var blot = makeBlot(node);\n if (blot.next != refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(_this);\n }\n _this.insertBefore(blot, refBlot || undefined);\n }\n });\n };\n return ContainerBlot;\n}(shadow_1.default));\nfunction makeBlot(node) {\n var blot = Registry.find(node);\n if (blot == null) {\n try {\n blot = Registry.create(node);\n }\n catch (e) {\n blot = Registry.create(Registry.Scope.INLINE);\n [].slice.call(node.childNodes).forEach(function (child) {\n // @ts-ignore\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n }\n }\n return blot;\n}\nexports.default = ContainerBlot;\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(11);\nvar store_1 = __webpack_require__(28);\nvar container_1 = __webpack_require__(17);\nvar Registry = __webpack_require__(1);\nvar FormatBlot = /** @class */ (function (_super) {\n __extends(FormatBlot, _super);\n function FormatBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.attributes = new store_1.default(_this.domNode);\n return _this;\n }\n FormatBlot.formats = function (domNode) {\n if (typeof this.tagName === 'string') {\n return true;\n }\n else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n };\n FormatBlot.prototype.format = function (name, value) {\n var format = Registry.query(name);\n if (format instanceof attributor_1.default) {\n this.attributes.attribute(format, value);\n }\n else if (value) {\n if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n this.replaceWith(name, value);\n }\n }\n };\n FormatBlot.prototype.formats = function () {\n var formats = this.attributes.values();\n var format = this.statics.formats(this.domNode);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n };\n FormatBlot.prototype.replaceWith = function (name, value) {\n var replacement = _super.prototype.replaceWith.call(this, name, value);\n this.attributes.copy(replacement);\n return replacement;\n };\n FormatBlot.prototype.update = function (mutations, context) {\n var _this = this;\n _super.prototype.update.call(this, mutations, context);\n if (mutations.some(function (mutation) {\n return mutation.target === _this.domNode && mutation.type === 'attributes';\n })) {\n this.attributes.build();\n }\n };\n FormatBlot.prototype.wrap = function (name, value) {\n var wrapper = _super.prototype.wrap.call(this, name, value);\n if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n };\n return FormatBlot;\n}(container_1.default));\nexports.default = FormatBlot;\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar shadow_1 = __webpack_require__(27);\nvar Registry = __webpack_require__(1);\nvar LeafBlot = /** @class */ (function (_super) {\n __extends(LeafBlot, _super);\n function LeafBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LeafBlot.value = function (domNode) {\n return true;\n };\n LeafBlot.prototype.index = function (node, offset) {\n if (this.domNode === node ||\n this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return Math.min(offset, 1);\n }\n return -1;\n };\n LeafBlot.prototype.position = function (index, inclusive) {\n var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n if (index > 0)\n offset += 1;\n return [this.parent.domNode, offset];\n };\n LeafBlot.prototype.value = function () {\n return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;\n var _a;\n };\n LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n return LeafBlot;\n}(shadow_1.default));\nexports.default = LeafBlot;\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar equal = __webpack_require__(12);\nvar extend = __webpack_require__(2);\n\n\nvar lib = {\n attributes: {\n compose: function (a, b, keepNull) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = extend(true, {}, b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce(function (copy, key) {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (var key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n diff: function(a, b) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {\n if (!equal(a[key], b[key])) {\n attributes[key] = b[key] === undefined ? null : b[key];\n }\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n transform: function (a, b, priority) {\n if (typeof a !== 'object') return b;\n if (typeof b !== 'object') return undefined;\n if (!priority) return b; // b simply overwrites us without priority\n var attributes = Object.keys(b).reduce(function (attributes, key) {\n if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n },\n\n iterator: function (ops) {\n return new Iterator(ops);\n },\n\n length: function (op) {\n if (typeof op['delete'] === 'number') {\n return op['delete'];\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n};\n\n\nfunction Iterator(ops) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n};\n\nIterator.prototype.hasNext = function () {\n return this.peekLength() < Infinity;\n};\n\nIterator.prototype.next = function (length) {\n if (!length) length = Infinity;\n var nextOp = this.ops[this.index];\n if (nextOp) {\n var offset = this.offset;\n var opLength = lib.length(nextOp)\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp['delete'] === 'number') {\n return { 'delete': length };\n } else {\n var retOp = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n};\n\nIterator.prototype.peek = function () {\n return this.ops[this.index];\n};\n\nIterator.prototype.peekLength = function () {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return lib.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n};\n\nIterator.prototype.peekType = function () {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index]['delete'] === 'number') {\n return 'delete';\n } else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n};\n\n\nmodule.exports = lib;\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\nvar clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.Range = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _clone = __webpack_require__(21);\n\nvar _clone2 = _interopRequireDefault(_clone);\n\nvar _deepEqual = __webpack_require__(12);\n\nvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\nvar _emitter3 = __webpack_require__(9);\n\nvar _emitter4 = _interopRequireDefault(_emitter3);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar debug = (0, _logger2.default)('quill:selection');\n\nvar Range = function Range(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n _classCallCheck(this, Range);\n\n this.index = index;\n this.length = length;\n};\n\nvar Selection = function () {\n function Selection(scroll, emitter) {\n var _this = this;\n\n _classCallCheck(this, Selection);\n\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n this.cursor = _parchment2.default.create('cursor', this);\n // savedRange is last non-null range\n this.lastRange = this.savedRange = new Range(0, 0);\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, function () {\n if (!_this.mouseDown) {\n setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1);\n }\n });\n this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) {\n if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) {\n _this.update(_emitter4.default.sources.SILENT);\n }\n });\n this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () {\n if (!_this.hasFocus()) return;\n var native = _this.getNativeRange();\n if (native == null) return;\n if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle\n // TODO unclear if this has negative side effects\n _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () {\n try {\n _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);\n } catch (ignored) {}\n });\n });\n this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) {\n if (context.range) {\n var _context$range = context.range,\n startNode = _context$range.startNode,\n startOffset = _context$range.startOffset,\n endNode = _context$range.endNode,\n endOffset = _context$range.endOffset;\n\n _this.setNativeRange(startNode, startOffset, endNode, endOffset);\n }\n });\n this.update(_emitter4.default.sources.SILENT);\n }\n\n _createClass(Selection, [{\n key: 'handleComposition',\n value: function handleComposition() {\n var _this2 = this;\n\n this.root.addEventListener('compositionstart', function () {\n _this2.composing = true;\n });\n this.root.addEventListener('compositionend', function () {\n _this2.composing = false;\n if (_this2.cursor.parent) {\n var range = _this2.cursor.restore();\n if (!range) return;\n setTimeout(function () {\n _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);\n }, 1);\n }\n });\n }\n }, {\n key: 'handleDragging',\n value: function handleDragging() {\n var _this3 = this;\n\n this.emitter.listenDOM('mousedown', document.body, function () {\n _this3.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, function () {\n _this3.mouseDown = false;\n _this3.update(_emitter4.default.sources.USER);\n });\n }\n }, {\n key: 'focus',\n value: function focus() {\n if (this.hasFocus()) return;\n this.root.focus();\n this.setRange(this.savedRange);\n }\n }, {\n key: 'format',\n value: function format(_format, value) {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return;\n this.scroll.update();\n var nativeRange = this.getNativeRange();\n if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n var blot = _parchment2.default.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof _parchment2.default.Leaf) {\n var after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(_format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n }, {\n key: 'getBounds',\n value: function getBounds(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n var node = void 0,\n _scroll$leaf = this.scroll.leaf(index),\n _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2),\n leaf = _scroll$leaf2[0],\n offset = _scroll$leaf2[1];\n if (leaf == null) return null;\n\n var _leaf$position = leaf.position(offset, true);\n\n var _leaf$position2 = _slicedToArray(_leaf$position, 2);\n\n node = _leaf$position2[0];\n offset = _leaf$position2[1];\n\n var range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n\n var _scroll$leaf3 = this.scroll.leaf(index + length);\n\n var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2);\n\n leaf = _scroll$leaf4[0];\n offset = _scroll$leaf4[1];\n\n if (leaf == null) return null;\n\n var _leaf$position3 = leaf.position(offset, true);\n\n var _leaf$position4 = _slicedToArray(_leaf$position3, 2);\n\n node = _leaf$position4[0];\n offset = _leaf$position4[1];\n\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n } else {\n var side = 'left';\n var rect = void 0;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0\n };\n }\n }\n }, {\n key: 'getNativeRange',\n value: function getNativeRange() {\n var selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n var nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n var range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n }, {\n key: 'getRange',\n value: function getRange() {\n var normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n var range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n }, {\n key: 'hasFocus',\n value: function hasFocus() {\n return document.activeElement === this.root;\n }\n }, {\n key: 'normalizedToRange',\n value: function normalizedToRange(range) {\n var _this4 = this;\n\n var positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n var indexes = positions.map(function (position) {\n var _position = _slicedToArray(position, 2),\n node = _position[0],\n offset = _position[1];\n\n var blot = _parchment2.default.find(node, true);\n var index = blot.offset(_this4.scroll);\n if (offset === 0) {\n return index;\n } else if (blot instanceof _parchment2.default.Container) {\n return index + blot.length();\n } else {\n return index + blot.index(node, offset);\n }\n });\n var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1);\n var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes)));\n return new Range(start, end - start);\n }\n }, {\n key: 'normalizeNative',\n value: function normalizeNative(nativeRange) {\n if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) {\n return null;\n }\n var range = {\n start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange\n };\n [range.start, range.end].forEach(function (position) {\n var node = position.node,\n offset = position.offset;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n } else {\n break;\n }\n }\n position.node = node, position.offset = offset;\n });\n return range;\n }\n }, {\n key: 'rangeToNative',\n value: function rangeToNative(range) {\n var _this5 = this;\n\n var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n var args = [];\n var scrollLength = this.scroll.length();\n indexes.forEach(function (index, i) {\n index = Math.min(scrollLength - 1, index);\n var node = void 0,\n _scroll$leaf5 = _this5.scroll.leaf(index),\n _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2),\n leaf = _scroll$leaf6[0],\n offset = _scroll$leaf6[1];\n var _leaf$position5 = leaf.position(offset, i !== 0);\n\n var _leaf$position6 = _slicedToArray(_leaf$position5, 2);\n\n node = _leaf$position6[0];\n offset = _leaf$position6[1];\n\n args.push(node, offset);\n });\n if (args.length < 2) {\n args = args.concat(args);\n }\n return args;\n }\n }, {\n key: 'scrollIntoView',\n value: function scrollIntoView(scrollingContainer) {\n var range = this.lastRange;\n if (range == null) return;\n var bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n var limit = this.scroll.length() - 1;\n\n var _scroll$line = this.scroll.line(Math.min(range.index, limit)),\n _scroll$line2 = _slicedToArray(_scroll$line, 1),\n first = _scroll$line2[0];\n\n var last = first;\n if (range.length > 0) {\n var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit));\n\n var _scroll$line4 = _slicedToArray(_scroll$line3, 1);\n\n last = _scroll$line4[0];\n }\n if (first == null || last == null) return;\n var scrollBounds = scrollingContainer.getBoundingClientRect();\n if (bounds.top < scrollBounds.top) {\n scrollingContainer.scrollTop -= scrollBounds.top - bounds.top;\n } else if (bounds.bottom > scrollBounds.bottom) {\n scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom;\n }\n }\n }, {\n key: 'setNativeRange',\n value: function setNativeRange(startNode, startOffset) {\n var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode;\n var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset;\n var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n return;\n }\n var selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n var native = (this.getNativeRange() || {}).native;\n if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) {\n\n if (startNode.tagName == \"BR\") {\n startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);\n startNode = startNode.parentNode;\n }\n if (endNode.tagName == \"BR\") {\n endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);\n endNode = endNode.parentNode;\n }\n var range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n }\n }\n }, {\n key: 'setRange',\n value: function setRange(range) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;\n\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n var args = this.rangeToNative(range);\n this.setNativeRange.apply(this, _toConsumableArray(args).concat([force]));\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n }, {\n key: 'update',\n value: function update() {\n var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;\n\n var oldRange = this.lastRange;\n\n var _getRange = this.getRange(),\n _getRange2 = _slicedToArray(_getRange, 2),\n lastRange = _getRange2[0],\n nativeRange = _getRange2[1];\n\n this.lastRange = lastRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) {\n var _emitter;\n\n if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n this.cursor.restore();\n }\n var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n }\n }]);\n\n return Selection;\n}();\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode;\n } catch (e) {\n return false;\n }\n // IE11 has bug with Text nodes\n // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n if (descendant instanceof Text) {\n descendant = descendant.parentNode;\n }\n return parent.contains(descendant);\n}\n\nexports.Range = Range;\nexports.default = Selection;\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Container = function (_Parchment$Container) {\n _inherits(Container, _Parchment$Container);\n\n function Container() {\n _classCallCheck(this, Container);\n\n return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments));\n }\n\n return Container;\n}(_parchment2.default.Container);\n\nContainer.allowedChildren = [_block2.default, _block.BlockEmbed, Container];\n\nexports.default = Container;\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ColorAttributor = function (_Parchment$Attributor) {\n _inherits(ColorAttributor, _Parchment$Attributor);\n\n function ColorAttributor() {\n _classCallCheck(this, ColorAttributor);\n\n return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments));\n }\n\n _createClass(ColorAttributor, [{\n key: 'value',\n value: function value(domNode) {\n var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n return '#' + value.split(',').map(function (component) {\n return ('00' + parseInt(component).toString(16)).slice(-2);\n }).join('');\n }\n }]);\n\n return ColorAttributor;\n}(_parchment2.default.Attributor.Style);\n\nvar ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', {\n scope: _parchment2.default.Scope.INLINE\n});\nvar ColorStyle = new ColorAttributor('color', 'color', {\n scope: _parchment2.default.Scope.INLINE\n});\n\nexports.ColorAttributor = ColorAttributor;\nexports.ColorClass = ColorClass;\nexports.ColorStyle = ColorStyle;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SHORTKEY = exports.default = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _clone = __webpack_require__(21);\n\nvar _clone2 = _interopRequireDefault(_clone);\n\nvar _deepEqual = __webpack_require__(12);\n\nvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _op = __webpack_require__(20);\n\nvar _op2 = _interopRequireDefault(_op);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:keyboard');\n\nvar SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\nvar Keyboard = function (_Module) {\n _inherits(Keyboard, _Module);\n\n _createClass(Keyboard, null, [{\n key: 'match',\n value: function match(evt, binding) {\n binding = normalize(binding);\n if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) {\n return !!binding[key] !== evt[key] && binding[key] !== null;\n })) {\n return false;\n }\n return binding.key === (evt.which || evt.keyCode);\n }\n }]);\n\n function Keyboard(quill, options) {\n _classCallCheck(this, Keyboard);\n\n var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options));\n\n _this.bindings = {};\n Object.keys(_this.options.bindings).forEach(function (name) {\n if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) {\n return;\n }\n if (_this.options.bindings[name]) {\n _this.addBinding(_this.options.bindings[name]);\n }\n });\n _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {});\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace);\n _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete);\n } else {\n _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);\n }\n _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace);\n _this.listen();\n return _this;\n }\n\n _createClass(Keyboard, [{\n key: 'addBinding',\n value: function addBinding(key) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var binding = normalize(key);\n if (binding == null || binding.key == null) {\n return debug.warn('Attempted to add invalid keyboard binding', binding);\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler: handler };\n }\n binding = (0, _extend2.default)(binding, context, handler);\n this.bindings[binding.key] = this.bindings[binding.key] || [];\n this.bindings[binding.key].push(binding);\n }\n }, {\n key: 'listen',\n value: function listen() {\n var _this2 = this;\n\n this.quill.root.addEventListener('keydown', function (evt) {\n if (evt.defaultPrevented) return;\n var which = evt.which || evt.keyCode;\n var bindings = (_this2.bindings[which] || []).filter(function (binding) {\n return Keyboard.match(evt, binding);\n });\n if (bindings.length === 0) return;\n var range = _this2.quill.getSelection();\n if (range == null || !_this2.quill.hasFocus()) return;\n\n var _quill$getLine = _this2.quill.getLine(range.index),\n _quill$getLine2 = _slicedToArray(_quill$getLine, 2),\n line = _quill$getLine2[0],\n offset = _quill$getLine2[1];\n\n var _quill$getLeaf = _this2.quill.getLeaf(range.index),\n _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2),\n leafStart = _quill$getLeaf2[0],\n offsetStart = _quill$getLeaf2[1];\n\n var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length),\n _ref2 = _slicedToArray(_ref, 2),\n leafEnd = _ref2[0],\n offsetEnd = _ref2[1];\n\n var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : '';\n var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : '';\n var curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: _this2.quill.getFormat(range),\n offset: offset,\n prefix: prefixText,\n suffix: suffixText\n };\n var prevented = bindings.some(function (binding) {\n if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n if (binding.empty != null && binding.empty !== curContext.empty) return false;\n if (binding.offset != null && binding.offset !== curContext.offset) return false;\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(function (name) {\n return curContext.format[name] == null;\n })) {\n return false;\n }\n } else if (_typeof(binding.format) === 'object') {\n // all formats must match\n if (!Object.keys(binding.format).every(function (name) {\n if (binding.format[name] === true) return curContext.format[name] != null;\n if (binding.format[name] === false) return curContext.format[name] == null;\n return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]);\n })) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n return binding.handler.call(_this2, range, curContext) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n }]);\n\n return Keyboard;\n}(_module2.default);\n\nKeyboard.keys = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n DELETE: 46\n};\n\nKeyboard.DEFAULTS = {\n bindings: {\n 'bold': makeFormatHandler('bold'),\n 'italic': makeFormatHandler('italic'),\n 'underline': makeFormatHandler('underline'),\n 'indent': {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: Keyboard.keys.TAB,\n format: ['blockquote', 'indent', 'list'],\n handler: function handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', _quill2.default.sources.USER);\n }\n },\n 'outdent': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler: function handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', _quill2.default.sources.USER);\n }\n },\n 'outdent backspace': {\n key: Keyboard.keys.BACKSPACE,\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler: function handler(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', _quill2.default.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, _quill2.default.sources.USER);\n }\n }\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler: function handler(range) {\n this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);\n }\n },\n 'tab': {\n key: Keyboard.keys.TAB,\n handler: function handler(range) {\n this.quill.history.cutoff();\n var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\\t');\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n }\n },\n 'list empty enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['list'],\n empty: true,\n handler: function handler(range, context) {\n this.quill.format('list', false, _quill2.default.sources.USER);\n if (context.format.indent) {\n this.quill.format('indent', false, _quill2.default.sources.USER);\n }\n }\n },\n 'checklist enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: { list: 'checked' },\n handler: function handler(range) {\n var _quill$getLine3 = this.quill.getLine(range.index),\n _quill$getLine4 = _slicedToArray(_quill$getLine3, 2),\n line = _quill$getLine4[0],\n offset = _quill$getLine4[1];\n\n var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' });\n var delta = new _quillDelta2.default().retain(range.index).insert('\\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'header enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler: function handler(range, context) {\n var _quill$getLine5 = this.quill.getLine(range.index),\n _quill$getLine6 = _slicedToArray(_quill$getLine5, 2),\n line = _quill$getLine6[0],\n offset = _quill$getLine6[1];\n\n var delta = new _quillDelta2.default().retain(range.index).insert('\\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null });\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'list autofill': {\n key: ' ',\n collapsed: true,\n format: { list: false },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler: function handler(range, context) {\n var length = context.prefix.length;\n\n var _quill$getLine7 = this.quill.getLine(range.index),\n _quill$getLine8 = _slicedToArray(_quill$getLine7, 2),\n line = _quill$getLine8[0],\n offset = _quill$getLine8[1];\n\n if (offset > length) return true;\n var value = void 0;\n switch (context.prefix.trim()) {\n case '[]':case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-':case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', _quill2.default.sources.USER);\n this.quill.history.cutoff();\n var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value });\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT);\n }\n },\n 'code exit': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['code-block'],\n prefix: /\\n\\n$/,\n suffix: /^\\s+$/,\n handler: function handler(range) {\n var _quill$getLine9 = this.quill.getLine(range.index),\n _quill$getLine10 = _slicedToArray(_quill$getLine9, 2),\n line = _quill$getLine10[0],\n offset = _quill$getLine10[1];\n\n var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1);\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n }\n },\n 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false),\n 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true),\n 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),\n 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)\n }\n};\n\nfunction makeEmbedArrowHandler(key, shiftKey) {\n var _ref3;\n\n var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix';\n return _ref3 = {\n key: key,\n shiftKey: shiftKey,\n altKey: null\n }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) {\n var index = range.index;\n if (key === Keyboard.keys.RIGHT) {\n index += range.length + 1;\n }\n\n var _quill$getLeaf3 = this.quill.getLeaf(index),\n _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1),\n leaf = _quill$getLeaf4[0];\n\n if (!(leaf instanceof _parchment2.default.Embed)) return true;\n if (key === Keyboard.keys.LEFT) {\n if (shiftKey) {\n this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER);\n } else {\n this.quill.setSelection(range.index - 1, _quill2.default.sources.USER);\n }\n } else {\n if (shiftKey) {\n this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER);\n } else {\n this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER);\n }\n }\n return false;\n }), _ref3;\n}\n\nfunction handleBackspace(range, context) {\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n\n var _quill$getLine11 = this.quill.getLine(range.index),\n _quill$getLine12 = _slicedToArray(_quill$getLine11, 1),\n line = _quill$getLine12[0];\n\n var formats = {};\n if (context.offset === 0) {\n var _quill$getLine13 = this.quill.getLine(range.index - 1),\n _quill$getLine14 = _slicedToArray(_quill$getLine13, 1),\n prev = _quill$getLine14[0];\n\n if (prev != null && prev.length() > 1) {\n var curFormats = line.formats();\n var prevFormats = this.quill.getFormat(range.index - 1, 1);\n formats = _op2.default.attributes.diff(curFormats, prevFormats) || {};\n }\n }\n // Check for astral symbols\n var length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix) ? 2 : 1;\n this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER);\n }\n this.quill.focus();\n}\n\nfunction handleDelete(range, context) {\n // Check for astral symbols\n var length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix) ? 2 : 1;\n if (range.index >= this.quill.getLength() - length) return;\n var formats = {},\n nextLength = 0;\n\n var _quill$getLine15 = this.quill.getLine(range.index),\n _quill$getLine16 = _slicedToArray(_quill$getLine15, 1),\n line = _quill$getLine16[0];\n\n if (context.offset >= line.length() - 1) {\n var _quill$getLine17 = this.quill.getLine(range.index + 1),\n _quill$getLine18 = _slicedToArray(_quill$getLine17, 1),\n next = _quill$getLine18[0];\n\n if (next) {\n var curFormats = line.formats();\n var nextFormats = this.quill.getFormat(range.index, 1);\n formats = _op2.default.attributes.diff(curFormats, nextFormats) || {};\n nextLength = next.length();\n }\n }\n this.quill.deleteText(range.index, length, _quill2.default.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER);\n }\n}\n\nfunction handleDeleteRange(range) {\n var lines = this.quill.getLines(range);\n var formats = {};\n if (lines.length > 1) {\n var firstFormats = lines[0].formats();\n var lastFormats = lines[lines.length - 1].formats();\n formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {};\n }\n this.quill.deleteText(range, _quill2.default.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER);\n }\n this.quill.setSelection(range.index, _quill2.default.sources.SILENT);\n this.quill.focus();\n}\n\nfunction handleEnter(range, context) {\n var _this3 = this;\n\n if (range.length > 0) {\n this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n }\n var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) {\n if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n lineFormats[format] = context.format[format];\n }\n return lineFormats;\n }, {});\n this.quill.insertText(range.index, '\\n', lineFormats, _quill2.default.sources.USER);\n // Earlier scroll.deleteAt might have messed up our selection,\n // so insertText's built in selection preservation is not reliable\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n this.quill.focus();\n Object.keys(context.format).forEach(function (name) {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'link') return;\n _this3.quill.format(name, context.format[name], _quill2.default.sources.USER);\n });\n}\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: Keyboard.keys.TAB,\n shiftKey: !indent,\n format: { 'code-block': true },\n handler: function handler(range) {\n var CodeBlock = _parchment2.default.query('code-block');\n var index = range.index,\n length = range.length;\n\n var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index),\n _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),\n block = _quill$scroll$descend2[0],\n offset = _quill$scroll$descend2[1];\n\n if (block == null) return;\n var scrollIndex = this.quill.getIndex(block);\n var start = block.newlineIndex(offset, true) + 1;\n var end = block.newlineIndex(scrollIndex + offset + length);\n var lines = block.domNode.textContent.slice(start, end).split('\\n');\n offset = 0;\n lines.forEach(function (line, i) {\n if (indent) {\n block.insertAt(start + offset, CodeBlock.TAB);\n offset += CodeBlock.TAB.length;\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.startsWith(CodeBlock.TAB)) {\n block.deleteAt(start + offset, CodeBlock.TAB.length);\n offset -= CodeBlock.TAB.length;\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n offset += line.length + 1;\n });\n this.quill.update(_quill2.default.sources.USER);\n this.quill.setSelection(index, length, _quill2.default.sources.SILENT);\n }\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0].toUpperCase(),\n shortKey: true,\n handler: function handler(range, context) {\n this.quill.format(format, !context.format[format], _quill2.default.sources.USER);\n }\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n return normalize({ key: binding });\n }\n if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') {\n binding = (0, _clone2.default)(binding, false);\n }\n if (typeof binding.key === 'string') {\n if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n binding.key = Keyboard.keys[binding.key.toUpperCase()];\n } else if (binding.key.length === 1) {\n binding.key = binding.key.toUpperCase().charCodeAt(0);\n } else {\n return null;\n }\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\nexports.default = Keyboard;\nexports.SHORTKEY = SHORTKEY;\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = {\n 'align': {\n '': __webpack_require__(75),\n 'center': __webpack_require__(76),\n 'right': __webpack_require__(77),\n 'justify': __webpack_require__(78)\n },\n 'background': __webpack_require__(79),\n 'blockquote': __webpack_require__(80),\n 'bold': __webpack_require__(81),\n 'clean': __webpack_require__(82),\n 'code': __webpack_require__(40),\n 'code-block': __webpack_require__(40),\n 'color': __webpack_require__(83),\n 'direction': {\n '': __webpack_require__(84),\n 'rtl': __webpack_require__(85)\n },\n 'float': {\n 'center': __webpack_require__(86),\n 'full': __webpack_require__(87),\n 'left': __webpack_require__(88),\n 'right': __webpack_require__(89)\n },\n 'formula': __webpack_require__(90),\n 'header': {\n '1': __webpack_require__(91),\n '2': __webpack_require__(92)\n },\n 'italic': __webpack_require__(93),\n 'image': __webpack_require__(94),\n 'indent': {\n '+1': __webpack_require__(95),\n '-1': __webpack_require__(96)\n },\n 'link': __webpack_require__(97),\n 'list': {\n 'ordered': __webpack_require__(98),\n 'bullet': __webpack_require__(99),\n 'check': __webpack_require__(100)\n },\n 'script': {\n 'sub': __webpack_require__(101),\n 'super': __webpack_require__(102)\n },\n 'strike': __webpack_require__(103),\n 'underline': __webpack_require__(104),\n 'video': __webpack_require__(105)\n};\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = __webpack_require__(1);\nvar ShadowBlot = /** @class */ (function () {\n function ShadowBlot(domNode) {\n this.domNode = domNode;\n // @ts-ignore\n this.domNode[Registry.DATA_KEY] = { blot: this };\n }\n Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n // Hack for accessing inherited static methods\n get: function () {\n return this.constructor;\n },\n enumerable: true,\n configurable: true\n });\n ShadowBlot.create = function (value) {\n if (this.tagName == null) {\n throw new Registry.ParchmentError('Blot definition missing tagName');\n }\n var node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value).toString() === value) {\n value = parseInt(value);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n }\n else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n }\n else {\n node = document.createElement(this.tagName[0]);\n }\n }\n else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n };\n ShadowBlot.prototype.attach = function () {\n if (this.parent != null) {\n this.scroll = this.parent.scroll;\n }\n };\n ShadowBlot.prototype.clone = function () {\n var domNode = this.domNode.cloneNode(false);\n return Registry.create(domNode);\n };\n ShadowBlot.prototype.detach = function () {\n if (this.parent != null)\n this.parent.removeChild(this);\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY];\n };\n ShadowBlot.prototype.deleteAt = function (index, length) {\n var blot = this.isolate(index, length);\n blot.remove();\n };\n ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n var blot = this.isolate(index, length);\n if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n }\n else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n var parent = Registry.create(this.statics.scope);\n blot.wrap(parent);\n parent.format(name, value);\n }\n };\n ShadowBlot.prototype.insertAt = function (index, value, def) {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n var ref = this.split(index);\n this.parent.insertBefore(blot, ref);\n };\n ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n if (refBlot === void 0) { refBlot = null; }\n if (this.parent != null) {\n this.parent.children.remove(this);\n }\n var refDomNode = null;\n parentBlot.children.insertBefore(this, refBlot);\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (this.domNode.parentNode != parentBlot.domNode ||\n this.domNode.nextSibling != refDomNode) {\n parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n }\n this.parent = parentBlot;\n this.attach();\n };\n ShadowBlot.prototype.isolate = function (index, length) {\n var target = this.split(index);\n target.split(length);\n return target;\n };\n ShadowBlot.prototype.length = function () {\n return 1;\n };\n ShadowBlot.prototype.offset = function (root) {\n if (root === void 0) { root = this.parent; }\n if (this.parent == null || this == root)\n return 0;\n return this.parent.children.offset(this) + this.parent.offset(root);\n };\n ShadowBlot.prototype.optimize = function (context) {\n // TODO clean up once we use WeakMap\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY] != null) {\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY].mutations;\n }\n };\n ShadowBlot.prototype.remove = function () {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n };\n ShadowBlot.prototype.replace = function (target) {\n if (target.parent == null)\n return;\n target.parent.insertBefore(this, target.next);\n target.remove();\n };\n ShadowBlot.prototype.replaceWith = function (name, value) {\n var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n replacement.replace(this);\n return replacement;\n };\n ShadowBlot.prototype.split = function (index, force) {\n return index === 0 ? this : this.next;\n };\n ShadowBlot.prototype.update = function (mutations, context) {\n // Nothing to do by default\n };\n ShadowBlot.prototype.wrap = function (name, value) {\n var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next);\n }\n wrapper.appendChild(this);\n return wrapper;\n };\n ShadowBlot.blotName = 'abstract';\n return ShadowBlot;\n}());\nexports.default = ShadowBlot;\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(11);\nvar class_1 = __webpack_require__(29);\nvar style_1 = __webpack_require__(30);\nvar Registry = __webpack_require__(1);\nvar AttributorStore = /** @class */ (function () {\n function AttributorStore(domNode) {\n this.attributes = {};\n this.domNode = domNode;\n this.build();\n }\n AttributorStore.prototype.attribute = function (attribute, value) {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n }\n else {\n delete this.attributes[attribute.attrName];\n }\n }\n }\n else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n };\n AttributorStore.prototype.build = function () {\n var _this = this;\n this.attributes = {};\n var attributes = attributor_1.default.keys(this.domNode);\n var classes = class_1.default.keys(this.domNode);\n var styles = style_1.default.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(function (name) {\n var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n if (attr instanceof attributor_1.default) {\n _this.attributes[attr.attrName] = attr;\n }\n });\n };\n AttributorStore.prototype.copy = function (target) {\n var _this = this;\n Object.keys(this.attributes).forEach(function (key) {\n var value = _this.attributes[key].value(_this.domNode);\n target.format(key, value);\n });\n };\n AttributorStore.prototype.move = function (target) {\n var _this = this;\n this.copy(target);\n Object.keys(this.attributes).forEach(function (key) {\n _this.attributes[key].remove(_this.domNode);\n });\n this.attributes = {};\n };\n AttributorStore.prototype.values = function () {\n var _this = this;\n return Object.keys(this.attributes).reduce(function (attributes, name) {\n attributes[name] = _this.attributes[name].value(_this.domNode);\n return attributes;\n }, {});\n };\n return AttributorStore;\n}());\nexports.default = AttributorStore;\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(11);\nfunction match(node, prefix) {\n var className = node.getAttribute('class') || '';\n return className.split(/\\s+/).filter(function (name) {\n return name.indexOf(prefix + \"-\") === 0;\n });\n}\nvar ClassAttributor = /** @class */ (function (_super) {\n __extends(ClassAttributor, _super);\n function ClassAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ClassAttributor.keys = function (node) {\n return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n return name\n .split('-')\n .slice(0, -1)\n .join('-');\n });\n };\n ClassAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n this.remove(node);\n node.classList.add(this.keyName + \"-\" + value);\n return true;\n };\n ClassAttributor.prototype.remove = function (node) {\n var matches = match(node, this.keyName);\n matches.forEach(function (name) {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n };\n ClassAttributor.prototype.value = function (node) {\n var result = match(node, this.keyName)[0] || '';\n var value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n };\n return ClassAttributor;\n}(attributor_1.default));\nexports.default = ClassAttributor;\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(11);\nfunction camelize(name) {\n var parts = name.split('-');\n var rest = parts\n .slice(1)\n .map(function (part) {\n return part[0].toUpperCase() + part.slice(1);\n })\n .join('');\n return parts[0] + rest;\n}\nvar StyleAttributor = /** @class */ (function (_super) {\n __extends(StyleAttributor, _super);\n function StyleAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StyleAttributor.keys = function (node) {\n return (node.getAttribute('style') || '').split(';').map(function (value) {\n var arr = value.split(':');\n return arr[0].trim();\n });\n };\n StyleAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n // @ts-ignore\n node.style[camelize(this.keyName)] = value;\n return true;\n };\n StyleAttributor.prototype.remove = function (node) {\n // @ts-ignore\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n };\n StyleAttributor.prototype.value = function (node) {\n // @ts-ignore\n var value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n };\n return StyleAttributor;\n}(attributor_1.default));\nexports.default = StyleAttributor;\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Cursor = function (_Parchment$Embed) {\n _inherits(Cursor, _Parchment$Embed);\n\n _createClass(Cursor, null, [{\n key: 'value',\n value: function value() {\n return undefined;\n }\n }]);\n\n function Cursor(domNode, selection) {\n _classCallCheck(this, Cursor);\n\n var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode));\n\n _this.selection = selection;\n _this.textNode = document.createTextNode(Cursor.CONTENTS);\n _this.domNode.appendChild(_this.textNode);\n _this._length = 0;\n return _this;\n }\n\n _createClass(Cursor, [{\n key: 'detach',\n value: function detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n if (this._length !== 0) {\n return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value);\n }\n var target = this,\n index = 0;\n while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this._length = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this._length = 0;\n }\n }\n }, {\n key: 'index',\n value: function index(node, offset) {\n if (node === this.textNode) return 0;\n return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset);\n }\n }, {\n key: 'length',\n value: function length() {\n return this._length;\n }\n }, {\n key: 'position',\n value: function position() {\n return [this.textNode, this.textNode.data.length];\n }\n }, {\n key: 'remove',\n value: function remove() {\n _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this);\n this.parent = null;\n }\n }, {\n key: 'restore',\n value: function restore() {\n if (this.selection.composing || this.parent == null) return;\n var textNode = this.textNode;\n var range = this.selection.getNativeRange();\n var restoreText = void 0,\n start = void 0,\n end = void 0;\n if (range != null && range.start.node === textNode && range.end.node === textNode) {\n var _ref = [textNode, range.start.offset, range.end.offset];\n restoreText = _ref[0];\n start = _ref[1];\n end = _ref[2];\n }\n // Link format will insert text outside of anchor tag\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n if (this.textNode.data !== Cursor.CONTENTS) {\n var text = this.textNode.data.split(Cursor.CONTENTS).join('');\n if (this.next instanceof _text2.default) {\n restoreText = this.next.domNode;\n this.next.insertAt(0, text);\n this.textNode.data = Cursor.CONTENTS;\n } else {\n this.textNode.data = text;\n this.parent.insertBefore(_parchment2.default.create(this.textNode), this);\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n }\n }\n this.remove();\n if (start != null) {\n var _map = [start, end].map(function (offset) {\n return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n });\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n\n return {\n startNode: restoreText,\n startOffset: start,\n endNode: restoreText,\n endOffset: end\n };\n }\n }\n }, {\n key: 'update',\n value: function update(mutations, context) {\n var _this2 = this;\n\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this2.textNode;\n })) {\n var range = this.restore();\n if (range) context.range = range;\n }\n }\n }, {\n key: 'value',\n value: function value() {\n return '';\n }\n }]);\n\n return Cursor;\n}(_parchment2.default.Embed);\n\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = '\\uFEFF'; // Zero width no break space\n\n\nexports.default = Cursor;\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Theme = function () {\n function Theme(quill, options) {\n _classCallCheck(this, Theme);\n\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n _createClass(Theme, [{\n key: 'init',\n value: function init() {\n var _this = this;\n\n Object.keys(this.options.modules).forEach(function (name) {\n if (_this.modules[name] == null) {\n _this.addModule(name);\n }\n });\n }\n }, {\n key: 'addModule',\n value: function addModule(name) {\n var moduleClass = this.quill.constructor.import('modules/' + name);\n this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n return this.modules[name];\n }\n }]);\n\n return Theme;\n}();\n\nTheme.DEFAULTS = {\n modules: {}\n};\nTheme.themes = {\n 'default': Theme\n};\n\nexports.default = Theme;\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar GUARD_TEXT = '\\uFEFF';\n\nvar Embed = function (_Parchment$Embed) {\n _inherits(Embed, _Parchment$Embed);\n\n function Embed(node) {\n _classCallCheck(this, Embed);\n\n var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node));\n\n _this.contentNode = document.createElement('span');\n _this.contentNode.setAttribute('contenteditable', false);\n [].slice.call(_this.domNode.childNodes).forEach(function (childNode) {\n _this.contentNode.appendChild(childNode);\n });\n _this.leftGuard = document.createTextNode(GUARD_TEXT);\n _this.rightGuard = document.createTextNode(GUARD_TEXT);\n _this.domNode.appendChild(_this.leftGuard);\n _this.domNode.appendChild(_this.contentNode);\n _this.domNode.appendChild(_this.rightGuard);\n return _this;\n }\n\n _createClass(Embed, [{\n key: 'index',\n value: function index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset);\n }\n }, {\n key: 'restore',\n value: function restore(node) {\n var range = void 0,\n textNode = void 0;\n var text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof _text2.default) {\n var prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(_parchment2.default.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof _text2.default) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(_parchment2.default.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n }, {\n key: 'update',\n value: function update(mutations, context) {\n var _this2 = this;\n\n mutations.forEach(function (mutation) {\n if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) {\n var range = _this2.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n }]);\n\n return Embed;\n}(_parchment2.default.Embed);\n\nexports.default = Embed;\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar config = {\n scope: _parchment2.default.Scope.BLOCK,\n whitelist: ['right', 'center', 'justify']\n};\n\nvar AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config);\nvar AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config);\nvar AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config);\n\nexports.AlignAttribute = AlignAttribute;\nexports.AlignClass = AlignClass;\nexports.AlignStyle = AlignStyle;\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.BackgroundStyle = exports.BackgroundClass = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _color = __webpack_require__(24);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', {\n scope: _parchment2.default.Scope.INLINE\n});\nvar BackgroundStyle = new _color.ColorAttributor('background', 'background-color', {\n scope: _parchment2.default.Scope.INLINE\n});\n\nexports.BackgroundClass = BackgroundClass;\nexports.BackgroundStyle = BackgroundStyle;\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar config = {\n scope: _parchment2.default.Scope.BLOCK,\n whitelist: ['rtl']\n};\n\nvar DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config);\nvar DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config);\nvar DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config);\n\nexports.DirectionAttribute = DirectionAttribute;\nexports.DirectionClass = DirectionClass;\nexports.DirectionStyle = DirectionStyle;\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.FontClass = exports.FontStyle = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar config = {\n scope: _parchment2.default.Scope.INLINE,\n whitelist: ['serif', 'monospace']\n};\n\nvar FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config);\n\nvar FontStyleAttributor = function (_Parchment$Attributor) {\n _inherits(FontStyleAttributor, _Parchment$Attributor);\n\n function FontStyleAttributor() {\n _classCallCheck(this, FontStyleAttributor);\n\n return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments));\n }\n\n _createClass(FontStyleAttributor, [{\n key: 'value',\n value: function value(node) {\n return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/[\"']/g, '');\n }\n }]);\n\n return FontStyleAttributor;\n}(_parchment2.default.Attributor.Style);\n\nvar FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexports.FontStyle = FontStyle;\nexports.FontClass = FontClass;\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SizeStyle = exports.SizeClass = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', {\n scope: _parchment2.default.Scope.INLINE,\n whitelist: ['small', 'large', 'huge']\n});\nvar SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', {\n scope: _parchment2.default.Scope.INLINE,\n whitelist: ['10px', '18px', '32px']\n});\n\nexports.SizeClass = SizeClass;\nexports.SizeStyle = SizeStyle;\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Bold = function (_Inline) {\n _inherits(Bold, _Inline);\n\n function Bold() {\n _classCallCheck(this, Bold);\n\n return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments));\n }\n\n _createClass(Bold, [{\n key: 'optimize',\n value: function optimize(context) {\n _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n }], [{\n key: 'create',\n value: function create() {\n return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this);\n }\n }, {\n key: 'formats',\n value: function formats() {\n return true;\n }\n }]);\n\n return Bold;\n}(_inline2.default);\n\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexports.default = Bold;\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _picker = __webpack_require__(16);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ColorPicker = function (_Picker) {\n _inherits(ColorPicker, _Picker);\n\n function ColorPicker(select, label) {\n _classCallCheck(this, ColorPicker);\n\n var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select));\n\n _this.label.innerHTML = label;\n _this.container.classList.add('ql-color-picker');\n [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) {\n item.classList.add('ql-primary');\n });\n return _this;\n }\n\n _createClass(ColorPicker, [{\n key: 'buildItem',\n value: function buildItem(option) {\n var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n }, {\n key: 'selectItem',\n value: function selectItem(item, trigger) {\n _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger);\n var colorLabel = this.label.querySelector('.ql-color-label');\n var value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n }]);\n\n return ColorPicker;\n}(_picker2.default);\n\nexports.default = ColorPicker;\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _picker = __webpack_require__(16);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar IconPicker = function (_Picker) {\n _inherits(IconPicker, _Picker);\n\n function IconPicker(select, icons) {\n _classCallCheck(this, IconPicker);\n\n var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select));\n\n _this.container.classList.add('ql-icon-picker');\n [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n });\n _this.defaultItem = _this.container.querySelector('.ql-selected');\n _this.selectItem(_this.defaultItem);\n return _this;\n }\n\n _createClass(IconPicker, [{\n key: 'selectItem',\n value: function selectItem(item, trigger) {\n _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger);\n item = item || this.defaultItem;\n this.label.innerHTML = item.innerHTML;\n }\n }]);\n\n return IconPicker;\n}(_picker2.default);\n\nexports.default = IconPicker;\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Tooltip = function () {\n function Tooltip(quill, boundsContainer) {\n var _this = this;\n\n _classCallCheck(this, Tooltip);\n\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (this.quill.root === this.quill.scrollingContainer) {\n this.quill.root.addEventListener('scroll', function () {\n _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px';\n });\n }\n this.hide();\n }\n\n _createClass(Tooltip, [{\n key: 'hide',\n value: function hide() {\n this.root.classList.add('ql-hidden');\n }\n }, {\n key: 'position',\n value: function position(reference) {\n var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n // root.scrollTop should be 0 if scrollContainer !== root\n var top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = left + 'px';\n this.root.style.top = top + 'px';\n this.root.classList.remove('ql-flip');\n var containerBounds = this.boundsContainer.getBoundingClientRect();\n var rootBounds = this.root.getBoundingClientRect();\n var shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = left + shift + 'px';\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = left + shift + 'px';\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n var height = rootBounds.bottom - rootBounds.top;\n var verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = top - verticalShift + 'px';\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n }, {\n key: 'show',\n value: function show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n }]);\n\n return Tooltip;\n}();\n\nexports.default = Tooltip;\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.BaseTooltip = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _emitter = __webpack_require__(9);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _keyboard = __webpack_require__(25);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\n\nvar _theme = __webpack_require__(32);\n\nvar _theme2 = _interopRequireDefault(_theme);\n\nvar _colorPicker = __webpack_require__(41);\n\nvar _colorPicker2 = _interopRequireDefault(_colorPicker);\n\nvar _iconPicker = __webpack_require__(42);\n\nvar _iconPicker2 = _interopRequireDefault(_iconPicker);\n\nvar _picker = __webpack_require__(16);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nvar _tooltip = __webpack_require__(43);\n\nvar _tooltip2 = _interopRequireDefault(_tooltip);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ALIGNS = [false, 'center', 'right', 'justify'];\n\nvar 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\"];\n\nvar FONTS = [false, 'serif', 'monospace'];\n\nvar HEADERS = ['1', '2', '3', false];\n\nvar SIZES = ['small', false, 'large', 'huge'];\n\nvar BaseTheme = function (_Theme) {\n _inherits(BaseTheme, _Theme);\n\n function BaseTheme(quill, options) {\n _classCallCheck(this, BaseTheme);\n\n var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options));\n\n var listener = function listener(e) {\n if (!document.body.contains(quill.root)) {\n return document.body.removeEventListener('click', listener);\n }\n if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) {\n _this.tooltip.hide();\n }\n if (_this.pickers != null) {\n _this.pickers.forEach(function (picker) {\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n return _this;\n }\n\n _createClass(BaseTheme, [{\n key: 'addModule',\n value: function addModule(name) {\n var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name);\n if (name === 'toolbar') {\n this.extendToolbar(module);\n }\n return module;\n }\n }, {\n key: 'buildButtons',\n value: function buildButtons(buttons, icons) {\n buttons.forEach(function (button) {\n var className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach(function (name) {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n button.innerHTML = icons[name][''] + icons[name]['rtl'];\n } else if (typeof icons[name] === 'string') {\n button.innerHTML = icons[name];\n } else {\n var value = button.value || '';\n if (value != null && icons[name][value]) {\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n }, {\n key: 'buildPickers',\n value: function buildPickers(selects, icons) {\n var _this2 = this;\n\n this.pickers = selects.map(function (select) {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n return new _iconPicker2.default(select, icons.align);\n } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {\n var format = select.classList.contains('ql-background') ? 'background' : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');\n }\n return new _colorPicker2.default(select, icons[format]);\n } else {\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new _picker2.default(select);\n }\n });\n var update = function update() {\n _this2.pickers.forEach(function (picker) {\n picker.update();\n });\n };\n this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update);\n }\n }]);\n\n return BaseTheme;\n}(_theme2.default);\n\nBaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula: function formula() {\n this.quill.theme.tooltip.edit('formula');\n },\n image: function image() {\n var _this3 = this;\n\n var fileInput = this.container.querySelector('input.ql-image[type=file]');\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon');\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', function () {\n if (fileInput.files != null && fileInput.files[0] != null) {\n var reader = new FileReader();\n reader.onload = function (e) {\n var range = _this3.quill.getSelection(true);\n _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER);\n _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT);\n fileInput.value = \"\";\n };\n reader.readAsDataURL(fileInput.files[0]);\n }\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video: function video() {\n this.quill.theme.tooltip.edit('video');\n }\n }\n }\n }\n});\n\nvar BaseTooltip = function (_Tooltip) {\n _inherits(BaseTooltip, _Tooltip);\n\n function BaseTooltip(quill, boundsContainer) {\n _classCallCheck(this, BaseTooltip);\n\n var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer));\n\n _this4.textbox = _this4.root.querySelector('input[type=\"text\"]');\n _this4.listen();\n return _this4;\n }\n\n _createClass(BaseTooltip, [{\n key: 'listen',\n value: function listen() {\n var _this5 = this;\n\n this.textbox.addEventListener('keydown', function (event) {\n if (_keyboard2.default.match(event, 'enter')) {\n _this5.save();\n event.preventDefault();\n } else if (_keyboard2.default.match(event, 'escape')) {\n _this5.cancel();\n event.preventDefault();\n }\n });\n }\n }, {\n key: 'cancel',\n value: function cancel() {\n this.hide();\n }\n }, {\n key: 'edit',\n value: function edit() {\n var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link';\n var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n this.position(this.quill.getBounds(this.quill.selection.savedRange));\n this.textbox.select();\n this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || '');\n this.root.setAttribute('data-mode', mode);\n }\n }, {\n key: 'restoreFocus',\n value: function restoreFocus() {\n var scrollTop = this.quill.scrollingContainer.scrollTop;\n this.quill.focus();\n this.quill.scrollingContainer.scrollTop = scrollTop;\n }\n }, {\n key: 'save',\n value: function save() {\n var value = this.textbox.value;\n switch (this.root.getAttribute('data-mode')) {\n case 'link':\n {\n var scrollTop = this.quill.root.scrollTop;\n if (this.linkRange) {\n this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER);\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, _emitter2.default.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video':\n {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula':\n {\n if (!value) break;\n var range = this.quill.getSelection(true);\n if (range != null) {\n var index = range.index + range.length;\n this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER);\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER);\n }\n this.quill.setSelection(index + 2, _emitter2.default.sources.USER);\n }\n break;\n }\n default:\n }\n this.textbox.value = '';\n this.hide();\n }\n }]);\n\n return BaseTooltip;\n}(_tooltip2.default);\n\nfunction extractVideoUrl(url) {\n var match = url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0';\n }\n if (match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/)) {\n // eslint-disable-line no-cond-assign\n return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/';\n }\n return url;\n}\n\nfunction fillSelect(select, values) {\n var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n values.forEach(function (value) {\n var option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', value);\n }\n select.appendChild(option);\n });\n}\n\nexports.BaseTooltip = BaseTooltip;\nexports.default = BaseTheme;\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _core = __webpack_require__(46);\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _align = __webpack_require__(34);\n\nvar _direction = __webpack_require__(36);\n\nvar _indent = __webpack_require__(62);\n\nvar _blockquote = __webpack_require__(63);\n\nvar _blockquote2 = _interopRequireDefault(_blockquote);\n\nvar _header = __webpack_require__(64);\n\nvar _header2 = _interopRequireDefault(_header);\n\nvar _list = __webpack_require__(65);\n\nvar _list2 = _interopRequireDefault(_list);\n\nvar _background = __webpack_require__(35);\n\nvar _color = __webpack_require__(24);\n\nvar _font = __webpack_require__(37);\n\nvar _size = __webpack_require__(38);\n\nvar _bold = __webpack_require__(39);\n\nvar _bold2 = _interopRequireDefault(_bold);\n\nvar _italic = __webpack_require__(66);\n\nvar _italic2 = _interopRequireDefault(_italic);\n\nvar _link = __webpack_require__(15);\n\nvar _link2 = _interopRequireDefault(_link);\n\nvar _script = __webpack_require__(67);\n\nvar _script2 = _interopRequireDefault(_script);\n\nvar _strike = __webpack_require__(68);\n\nvar _strike2 = _interopRequireDefault(_strike);\n\nvar _underline = __webpack_require__(69);\n\nvar _underline2 = _interopRequireDefault(_underline);\n\nvar _image = __webpack_require__(70);\n\nvar _image2 = _interopRequireDefault(_image);\n\nvar _video = __webpack_require__(71);\n\nvar _video2 = _interopRequireDefault(_video);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _formula = __webpack_require__(72);\n\nvar _formula2 = _interopRequireDefault(_formula);\n\nvar _syntax = __webpack_require__(73);\n\nvar _syntax2 = _interopRequireDefault(_syntax);\n\nvar _toolbar = __webpack_require__(74);\n\nvar _toolbar2 = _interopRequireDefault(_toolbar);\n\nvar _icons = __webpack_require__(26);\n\nvar _icons2 = _interopRequireDefault(_icons);\n\nvar _picker = __webpack_require__(16);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nvar _colorPicker = __webpack_require__(41);\n\nvar _colorPicker2 = _interopRequireDefault(_colorPicker);\n\nvar _iconPicker = __webpack_require__(42);\n\nvar _iconPicker2 = _interopRequireDefault(_iconPicker);\n\nvar _tooltip = __webpack_require__(43);\n\nvar _tooltip2 = _interopRequireDefault(_tooltip);\n\nvar _bubble = __webpack_require__(107);\n\nvar _bubble2 = _interopRequireDefault(_bubble);\n\nvar _snow = __webpack_require__(108);\n\nvar _snow2 = _interopRequireDefault(_snow);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_core2.default.register({\n 'attributors/attribute/direction': _direction.DirectionAttribute,\n\n 'attributors/class/align': _align.AlignClass,\n 'attributors/class/background': _background.BackgroundClass,\n 'attributors/class/color': _color.ColorClass,\n 'attributors/class/direction': _direction.DirectionClass,\n 'attributors/class/font': _font.FontClass,\n 'attributors/class/size': _size.SizeClass,\n\n 'attributors/style/align': _align.AlignStyle,\n 'attributors/style/background': _background.BackgroundStyle,\n 'attributors/style/color': _color.ColorStyle,\n 'attributors/style/direction': _direction.DirectionStyle,\n 'attributors/style/font': _font.FontStyle,\n 'attributors/style/size': _size.SizeStyle\n}, true);\n\n_core2.default.register({\n 'formats/align': _align.AlignClass,\n 'formats/direction': _direction.DirectionClass,\n 'formats/indent': _indent.IndentClass,\n\n 'formats/background': _background.BackgroundStyle,\n 'formats/color': _color.ColorStyle,\n 'formats/font': _font.FontClass,\n 'formats/size': _size.SizeClass,\n\n 'formats/blockquote': _blockquote2.default,\n 'formats/code-block': _code2.default,\n 'formats/header': _header2.default,\n 'formats/list': _list2.default,\n\n 'formats/bold': _bold2.default,\n 'formats/code': _code.Code,\n 'formats/italic': _italic2.default,\n 'formats/link': _link2.default,\n 'formats/script': _script2.default,\n 'formats/strike': _strike2.default,\n 'formats/underline': _underline2.default,\n\n 'formats/image': _image2.default,\n 'formats/video': _video2.default,\n\n 'formats/list/item': _list.ListItem,\n\n 'modules/formula': _formula2.default,\n 'modules/syntax': _syntax2.default,\n 'modules/toolbar': _toolbar2.default,\n\n 'themes/bubble': _bubble2.default,\n 'themes/snow': _snow2.default,\n\n 'ui/icons': _icons2.default,\n 'ui/picker': _picker2.default,\n 'ui/icon-picker': _iconPicker2.default,\n 'ui/color-picker': _colorPicker2.default,\n 'ui/tooltip': _tooltip2.default\n}, true);\n\nexports.default = _core2.default;\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _break = __webpack_require__(14);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _container = __webpack_require__(23);\n\nvar _container2 = _interopRequireDefault(_container);\n\nvar _cursor = __webpack_require__(31);\n\nvar _cursor2 = _interopRequireDefault(_cursor);\n\nvar _embed = __webpack_require__(33);\n\nvar _embed2 = _interopRequireDefault(_embed);\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nvar _scroll = __webpack_require__(59);\n\nvar _scroll2 = _interopRequireDefault(_scroll);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nvar _clipboard = __webpack_require__(60);\n\nvar _clipboard2 = _interopRequireDefault(_clipboard);\n\nvar _history = __webpack_require__(61);\n\nvar _history2 = _interopRequireDefault(_history);\n\nvar _keyboard = __webpack_require__(25);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_quill2.default.register({\n 'blots/block': _block2.default,\n 'blots/block/embed': _block.BlockEmbed,\n 'blots/break': _break2.default,\n 'blots/container': _container2.default,\n 'blots/cursor': _cursor2.default,\n 'blots/embed': _embed2.default,\n 'blots/inline': _inline2.default,\n 'blots/scroll': _scroll2.default,\n 'blots/text': _text2.default,\n\n 'modules/clipboard': _clipboard2.default,\n 'modules/history': _history2.default,\n 'modules/keyboard': _keyboard2.default\n});\n\n_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default);\n\nexports.default = _quill2.default;\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LinkedList = /** @class */ (function () {\n function LinkedList() {\n this.head = this.tail = null;\n this.length = 0;\n }\n LinkedList.prototype.append = function () {\n var nodes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodes[_i] = arguments[_i];\n }\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n };\n LinkedList.prototype.contains = function (node) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n if (cur === node)\n return true;\n }\n return false;\n };\n LinkedList.prototype.insertBefore = function (node, refNode) {\n if (!node)\n return;\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n }\n else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n }\n else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n };\n LinkedList.prototype.offset = function (target) {\n var index = 0, cur = this.head;\n while (cur != null) {\n if (cur === target)\n return index;\n index += cur.length();\n cur = cur.next;\n }\n return -1;\n };\n LinkedList.prototype.remove = function (node) {\n if (!this.contains(node))\n return;\n if (node.prev != null)\n node.prev.next = node.next;\n if (node.next != null)\n node.next.prev = node.prev;\n if (node === this.head)\n this.head = node.next;\n if (node === this.tail)\n this.tail = node.prev;\n this.length -= 1;\n };\n LinkedList.prototype.iterator = function (curNode) {\n if (curNode === void 0) { curNode = this.head; }\n // TODO use yield when we can\n return function () {\n var ret = curNode;\n if (curNode != null)\n curNode = curNode.next;\n return ret;\n };\n };\n LinkedList.prototype.find = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var cur, next = this.iterator();\n while ((cur = next())) {\n var length = cur.length();\n if (index < length ||\n (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) {\n return [cur, index];\n }\n index -= length;\n }\n return [null, 0];\n };\n LinkedList.prototype.forEach = function (callback) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n callback(cur);\n }\n };\n LinkedList.prototype.forEachAt = function (index, length, callback) {\n if (length <= 0)\n return;\n var _a = this.find(index), startNode = _a[0], offset = _a[1];\n var cur, curIndex = index - offset, next = this.iterator(startNode);\n while ((cur = next()) && curIndex < index + length) {\n var curLength = cur.length();\n if (index > curIndex) {\n callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n }\n else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n }\n };\n LinkedList.prototype.map = function (callback) {\n return this.reduce(function (memo, cur) {\n memo.push(callback(cur));\n return memo;\n }, []);\n };\n LinkedList.prototype.reduce = function (callback, memo) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n memo = callback(memo, cur);\n }\n return memo;\n };\n return LinkedList;\n}());\nexports.default = LinkedList;\n\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = __webpack_require__(17);\nvar Registry = __webpack_require__(1);\nvar OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\nvar MAX_OPTIMIZE_ITERATIONS = 100;\nvar ScrollBlot = /** @class */ (function (_super) {\n __extends(ScrollBlot, _super);\n function ScrollBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.scroll = _this;\n _this.observer = new MutationObserver(function (mutations) {\n _this.update(mutations);\n });\n _this.observer.observe(_this.domNode, OBSERVER_CONFIG);\n _this.attach();\n return _this;\n }\n ScrollBlot.prototype.detach = function () {\n _super.prototype.detach.call(this);\n this.observer.disconnect();\n };\n ScrollBlot.prototype.deleteAt = function (index, length) {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(function (child) {\n child.remove();\n });\n }\n else {\n _super.prototype.deleteAt.call(this, index, length);\n }\n };\n ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n this.update();\n _super.prototype.formatAt.call(this, index, length, name, value);\n };\n ScrollBlot.prototype.insertAt = function (index, value, def) {\n this.update();\n _super.prototype.insertAt.call(this, index, value, def);\n };\n ScrollBlot.prototype.optimize = function (mutations, context) {\n var _this = this;\n if (mutations === void 0) { mutations = []; }\n if (context === void 0) { context = {}; }\n _super.prototype.optimize.call(this, context);\n // We must modify mutations directly, cannot make copy and then modify\n var records = [].slice.call(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0)\n mutations.push(records.pop());\n // TODO use WeakMap\n var mark = function (blot, markParent) {\n if (markParent === void 0) { markParent = true; }\n if (blot == null || blot === _this)\n return;\n if (blot.domNode.parentNode == null)\n return;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [];\n }\n if (markParent)\n mark(blot.parent);\n };\n var optimize = function (blot) {\n // Post-order traversal\n if (\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY] == null ||\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations == null) {\n return;\n }\n if (blot instanceof container_1.default) {\n blot.children.forEach(optimize);\n }\n blot.optimize(context);\n };\n var remaining = mutations;\n for (var i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(Registry.find(mutation.previousSibling, false));\n [].forEach.call(mutation.addedNodes, function (node) {\n var child = Registry.find(node, false);\n mark(child, false);\n if (child instanceof container_1.default) {\n child.children.forEach(function (grandChild) {\n mark(grandChild, false);\n });\n }\n });\n }\n else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = [].slice.call(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0)\n mutations.push(records.pop());\n }\n };\n ScrollBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (context === void 0) { context = {}; }\n mutations = mutations || this.observer.takeRecords();\n // TODO use WeakMap\n mutations\n .map(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return null;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n return blot;\n }\n else {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n return null;\n }\n })\n .forEach(function (blot) {\n if (blot == null ||\n blot === _this ||\n //@ts-ignore\n blot.domNode[Registry.DATA_KEY] == null)\n return;\n // @ts-ignore\n blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);\n });\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY].mutations != null) {\n // @ts-ignore\n _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);\n }\n this.optimize(mutations, context);\n };\n ScrollBlot.blotName = 'scroll';\n ScrollBlot.defaultChild = 'block';\n ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n ScrollBlot.tagName = 'DIV';\n return ScrollBlot;\n}(container_1.default));\nexports.default = ScrollBlot;\n\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = __webpack_require__(18);\nvar Registry = __webpack_require__(1);\n// Shallow object comparison\nfunction isEqual(obj1, obj2) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length)\n return false;\n // @ts-ignore\n for (var prop in obj1) {\n // @ts-ignore\n if (obj1[prop] !== obj2[prop])\n return false;\n }\n return true;\n}\nvar InlineBlot = /** @class */ (function (_super) {\n __extends(InlineBlot, _super);\n function InlineBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n InlineBlot.formats = function (domNode) {\n if (domNode.tagName === InlineBlot.tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n InlineBlot.prototype.format = function (name, value) {\n var _this = this;\n if (name === this.statics.blotName && !value) {\n this.children.forEach(function (child) {\n if (!(child instanceof format_1.default)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n _this.attributes.copy(child);\n });\n this.unwrap();\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n InlineBlot.prototype.formatAt = function (index, length, name, value) {\n if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n var blot = this.isolate(index, length);\n blot.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n InlineBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n var formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n var next = this.next;\n if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n next.moveChildren(this);\n next.remove();\n }\n };\n InlineBlot.blotName = 'inline';\n InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n InlineBlot.tagName = 'SPAN';\n return InlineBlot;\n}(format_1.default));\nexports.default = InlineBlot;\n\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = __webpack_require__(18);\nvar Registry = __webpack_require__(1);\nvar BlockBlot = /** @class */ (function (_super) {\n __extends(BlockBlot, _super);\n function BlockBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BlockBlot.formats = function (domNode) {\n var tagName = Registry.query(BlockBlot.blotName).tagName;\n if (domNode.tagName === tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n BlockBlot.prototype.format = function (name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n return;\n }\n else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n BlockBlot.prototype.formatAt = function (index, length, name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n BlockBlot.prototype.insertAt = function (index, value, def) {\n if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n // Insert text or inline\n _super.prototype.insertAt.call(this, index, value, def);\n }\n else {\n var after = this.split(index);\n var blot = Registry.create(value, def);\n after.parent.insertBefore(blot, after);\n }\n };\n BlockBlot.prototype.update = function (mutations, context) {\n if (navigator.userAgent.match(/Trident/)) {\n this.build();\n }\n else {\n _super.prototype.update.call(this, mutations, context);\n }\n };\n BlockBlot.blotName = 'block';\n BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n BlockBlot.tagName = 'P';\n return BlockBlot;\n}(format_1.default));\nexports.default = BlockBlot;\n\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = __webpack_require__(19);\nvar EmbedBlot = /** @class */ (function (_super) {\n __extends(EmbedBlot, _super);\n function EmbedBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EmbedBlot.formats = function (domNode) {\n return undefined;\n };\n EmbedBlot.prototype.format = function (name, value) {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n };\n EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n EmbedBlot.prototype.formats = function () {\n return this.statics.formats(this.domNode);\n };\n return EmbedBlot;\n}(leaf_1.default));\nexports.default = EmbedBlot;\n\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = __webpack_require__(19);\nvar Registry = __webpack_require__(1);\nvar TextBlot = /** @class */ (function (_super) {\n __extends(TextBlot, _super);\n function TextBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.text = _this.statics.value(_this.domNode);\n return _this;\n }\n TextBlot.create = function (value) {\n return document.createTextNode(value);\n };\n TextBlot.value = function (domNode) {\n var text = domNode.data;\n // @ts-ignore\n if (text['normalize'])\n text = text['normalize']();\n return text;\n };\n TextBlot.prototype.deleteAt = function (index, length) {\n this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n };\n TextBlot.prototype.index = function (node, offset) {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n };\n TextBlot.prototype.insertAt = function (index, value, def) {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n }\n else {\n _super.prototype.insertAt.call(this, index, value, def);\n }\n };\n TextBlot.prototype.length = function () {\n return this.text.length;\n };\n TextBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n }\n else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), this.next.value());\n this.next.remove();\n }\n };\n TextBlot.prototype.position = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return [this.domNode, index];\n };\n TextBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = Registry.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next);\n this.text = this.statics.value(this.domNode);\n return after;\n };\n TextBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this.domNode;\n })) {\n this.text = this.statics.value(this.domNode);\n }\n };\n TextBlot.prototype.value = function () {\n return this.text;\n };\n TextBlot.blotName = 'text';\n TextBlot.scope = Registry.Scope.INLINE_BLOT;\n return TextBlot;\n}(leaf_1.default));\nexports.default = TextBlot;\n\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar elem = document.createElement('div');\nelem.classList.toggle('test-class', false);\nif (elem.classList.contains('test-class')) {\n var _toggle = DOMTokenList.prototype.toggle;\n DOMTokenList.prototype.toggle = function (token, force) {\n if (arguments.length > 1 && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n}\n\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function (searchString, position) {\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function (searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n}\n\nif (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, \"find\", {\n value: function value(predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n }\n });\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n // Disable resizing in Firefox\n document.execCommand(\"enableObjectResizing\", false, false);\n // Disable automatic linkifying in IE11\n document.execCommand(\"autoUrlDetect\", false, false);\n});\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports) {\n\n/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int} cursor_pos Expected edit position in text1 (optional)\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos) {\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n // Check cursor_pos within bounds\n if (cursor_pos < 0 || text1.length < cursor_pos) {\n cursor_pos = null;\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs);\n if (cursor_pos != null) {\n diffs = fix_cursor(diffs, cursor_pos);\n }\n diffs = fix_emoji(diffs);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [[DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n */\nfunction diff_cleanupMerge(diffs) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL,\n text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n if (count_delete === 0) {\n diffs.splice(pointer - count_insert,\n count_delete + count_insert, [DIFF_INSERT, text_insert]);\n } else if (count_insert === 0) {\n diffs.splice(pointer - count_delete,\n count_delete + count_insert, [DIFF_DELETE, text_delete]);\n } else {\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert, [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]);\n }\n pointer = pointer - count_delete - count_insert +\n (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n};\n\n\nvar diff = diff_main;\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n\n/*\n * Modify a diff such that the cursor position points to the start of a change:\n * E.g.\n * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)\n * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]\n * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)\n * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} A tuple [cursor location in the modified diff, modified diff]\n */\nfunction cursor_normalize_diff (diffs, cursor_pos) {\n if (cursor_pos === 0) {\n return [DIFF_EQUAL, diffs];\n }\n for (var current_pos = 0, i = 0; i < diffs.length; i++) {\n var d = diffs[i];\n if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {\n var next_pos = current_pos + d[1].length;\n if (cursor_pos === next_pos) {\n return [i + 1, diffs];\n } else if (cursor_pos < next_pos) {\n // copy to prevent side effects\n diffs = diffs.slice();\n // split d into two diff changes\n var split_pos = cursor_pos - current_pos;\n var d_left = [d[0], d[1].slice(0, split_pos)];\n var d_right = [d[0], d[1].slice(split_pos)];\n diffs.splice(i, 1, d_left, d_right);\n return [i + 1, diffs];\n } else {\n current_pos = next_pos;\n }\n }\n }\n throw new Error('cursor_pos is out of bounds!')\n}\n\n/*\n * Modify a diff such that the edit position is \"shifted\" to the proposed edit location (cursor_position).\n *\n * Case 1)\n * Check if a naive shift is possible:\n * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)\n * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result\n * Case 2)\n * Check if the following shifts are possible:\n * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']\n * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']\n * ^ ^\n * d d_next\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} Array of diff tuples\n */\nfunction fix_cursor (diffs, cursor_pos) {\n var norm = cursor_normalize_diff(diffs, cursor_pos);\n var ndiffs = norm[1];\n var cursor_pointer = norm[0];\n var d = ndiffs[cursor_pointer];\n var d_next = ndiffs[cursor_pointer + 1];\n\n if (d == null) {\n // Text was deleted from end of original string,\n // cursor is now out of bounds in new string\n return diffs;\n } else if (d[0] !== DIFF_EQUAL) {\n // A modification happened at the cursor location.\n // This is the expected outcome, so we can return the original diff.\n return diffs;\n } else {\n if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {\n // Case 1)\n // It is possible to perform a naive shift\n ndiffs.splice(cursor_pointer, 2, d_next, d)\n return merge_tuples(ndiffs, cursor_pointer, 2)\n } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {\n // Case 2)\n // d[1] is a prefix of d_next[1]\n // We can assume that d_next[0] !== 0, since d[0] === 0\n // Shift edit locations..\n ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);\n var suffix = d_next[1].slice(d[1].length);\n if (suffix.length > 0) {\n ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);\n }\n return merge_tuples(ndiffs, cursor_pointer, 3)\n } else {\n // Not possible to perform any modification\n return diffs;\n }\n }\n}\n\n/*\n * Check diff did not split surrogate pairs.\n * Ex. [0, '\\uD83D'], [-1, '\\uDC36'], [1, '\\uDC2F'] -> [-1, '\\uD83D\\uDC36'], [1, '\\uD83D\\uDC2F']\n * '\\uD83D\\uDC36' === '🐶', '\\uD83D\\uDC2F' === '🐯'\n *\n * @param {Array} diffs Array of diff tuples\n * @return {Array} Array of diff tuples\n */\nfunction fix_emoji (diffs) {\n var compact = false;\n var starts_with_pair_end = function(str) {\n return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF;\n }\n var ends_with_pair_start = function(str) {\n return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF;\n }\n for (var i = 2; i < diffs.length; i += 1) {\n if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) &&\n diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) &&\n diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) {\n compact = true;\n\n diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1];\n diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1];\n\n diffs[i-2][1] = diffs[i-2][1].slice(0, -1);\n }\n }\n if (!compact) {\n return diffs;\n }\n var fixed_diffs = [];\n for (var i = 0; i < diffs.length; i += 1) {\n if (diffs[i][1].length > 0) {\n fixed_diffs.push(diffs[i]);\n }\n }\n return fixed_diffs;\n}\n\n/*\n * Try to merge tuples with their neigbors in a given range.\n * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']\n *\n * @param {Array} diffs Array of diff tuples.\n * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).\n * @param {Int} length Number of consecutive elements to check.\n * @return {Array} Array of merged diff tuples.\n */\nfunction merge_tuples (diffs, start, length) {\n // Check from (start-1) to (start+length).\n for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {\n if (i + 1 < diffs.length) {\n var left_d = diffs[i];\n var right_d = diffs[i+1];\n if (left_d[0] === right_d[1]) {\n diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);\n }\n }\n }\n return diffs;\n}\n\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports) {\n\nexports = module.exports = typeof Object.keys === 'function'\n ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}\n\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports) {\n\nvar supportsArgumentsClass = (function(){\n return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n return object &&\n typeof object == 'object' &&\n typeof object.length == 'number' &&\n Object.prototype.hasOwnProperty.call(object, 'callee') &&\n !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n false;\n};\n\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _op = __webpack_require__(20);\n\nvar _op2 = _interopRequireDefault(_op);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _cursor = __webpack_require__(31);\n\nvar _cursor2 = _interopRequireDefault(_cursor);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _break = __webpack_require__(14);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _clone = __webpack_require__(21);\n\nvar _clone2 = _interopRequireDefault(_clone);\n\nvar _deepEqual = __webpack_require__(12);\n\nvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ASCII = /^[ -~]*$/;\n\nvar Editor = function () {\n function Editor(scroll) {\n _classCallCheck(this, Editor);\n\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n _createClass(Editor, [{\n key: 'applyDelta',\n value: function applyDelta(delta) {\n var _this = this;\n\n var consumeNextNewline = false;\n this.scroll.update();\n var scrollLength = this.scroll.length();\n this.scroll.batchStart();\n delta = normalizeDelta(delta);\n delta.reduce(function (index, op) {\n var length = op.retain || op.delete || op.insert.length || 1;\n var attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n var text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (index >= scrollLength && !text.endsWith('\\n')) {\n consumeNextNewline = true;\n }\n _this.scroll.insertAt(index, text);\n\n var _scroll$line = _this.scroll.line(index),\n _scroll$line2 = _slicedToArray(_scroll$line, 2),\n line = _scroll$line2[0],\n offset = _scroll$line2[1];\n\n var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line));\n if (line instanceof _block2.default) {\n var _line$descendant = line.descendant(_parchment2.default.Leaf, offset),\n _line$descendant2 = _slicedToArray(_line$descendant, 1),\n leaf = _line$descendant2[0];\n\n formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf));\n }\n attributes = _op2.default.attributes.diff(formats, attributes) || {};\n } else if (_typeof(op.insert) === 'object') {\n var key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n _this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach(function (name) {\n _this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n delta.reduce(function (index, op) {\n if (typeof op.delete === 'number') {\n _this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batchEnd();\n return this.update(delta);\n }\n }, {\n key: 'deleteText',\n value: function deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new _quillDelta2.default().retain(index).delete(length));\n }\n }, {\n key: 'formatLine',\n value: function formatLine(index, length) {\n var _this2 = this;\n\n var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n this.scroll.update();\n Object.keys(formats).forEach(function (format) {\n if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return;\n var lines = _this2.scroll.lines(index, Math.max(length, 1));\n var lengthRemaining = length;\n lines.forEach(function (line) {\n var lineLength = line.length();\n if (!(line instanceof _code2.default)) {\n line.format(format, formats[format]);\n } else {\n var codeIndex = index - line.offset(_this2.scroll);\n var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n line.formatAt(codeIndex, codeLength, format, formats[format]);\n }\n lengthRemaining -= lineLength;\n });\n });\n this.scroll.optimize();\n return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));\n }\n }, {\n key: 'formatText',\n value: function formatText(index, length) {\n var _this3 = this;\n\n var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n Object.keys(formats).forEach(function (format) {\n _this3.scroll.formatAt(index, length, format, formats[format]);\n });\n return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));\n }\n }, {\n key: 'getContents',\n value: function getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n }, {\n key: 'getDelta',\n value: function getDelta() {\n return this.scroll.lines().reduce(function (delta, line) {\n return delta.concat(line.delta());\n }, new _quillDelta2.default());\n }\n }, {\n key: 'getFormat',\n value: function getFormat(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var lines = [],\n leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(function (path) {\n var _path = _slicedToArray(path, 1),\n blot = _path[0];\n\n if (blot instanceof _block2.default) {\n lines.push(blot);\n } else if (blot instanceof _parchment2.default.Leaf) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length);\n }\n var formatsArr = [lines, leaves].map(function (blots) {\n if (blots.length === 0) return {};\n var formats = (0, _block.bubbleFormats)(blots.shift());\n while (Object.keys(formats).length > 0) {\n var blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats((0, _block.bubbleFormats)(blot), formats);\n }\n return formats;\n });\n return _extend2.default.apply(_extend2.default, formatsArr);\n }\n }, {\n key: 'getText',\n value: function getText(index, length) {\n return this.getContents(index, length).filter(function (op) {\n return typeof op.insert === 'string';\n }).map(function (op) {\n return op.insert;\n }).join('');\n }\n }, {\n key: 'insertEmbed',\n value: function insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value)));\n }\n }, {\n key: 'insertText',\n value: function insertText(index, text) {\n var _this4 = this;\n\n var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach(function (format) {\n _this4.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats)));\n }\n }, {\n key: 'isBlank',\n value: function isBlank() {\n if (this.scroll.children.length == 0) return true;\n if (this.scroll.children.length > 1) return false;\n var block = this.scroll.children.head;\n if (block.statics.blotName !== _block2.default.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof _break2.default;\n }\n }, {\n key: 'removeFormat',\n value: function removeFormat(index, length) {\n var text = this.getText(index, length);\n\n var _scroll$line3 = this.scroll.line(index + length),\n _scroll$line4 = _slicedToArray(_scroll$line3, 2),\n line = _scroll$line4[0],\n offset = _scroll$line4[1];\n\n var suffixLength = 0,\n suffix = new _quillDelta2.default();\n if (line != null) {\n if (!(line instanceof _code2.default)) {\n suffixLength = line.length() - offset;\n } else {\n suffixLength = line.newlineIndex(offset) - offset + 1;\n }\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n var contents = this.getContents(index, length + suffixLength);\n var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix));\n var delta = new _quillDelta2.default().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n }, {\n key: 'update',\n value: function update(change) {\n var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n\n var oldDelta = this.delta;\n if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) {\n // Optimization for character changes\n var textBlot = _parchment2.default.find(mutations[0].target);\n var formats = (0, _block.bubbleFormats)(textBlot);\n var index = textBlot.offset(this.scroll);\n var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, '');\n var oldText = new _quillDelta2.default().insert(oldValue);\n var newText = new _quillDelta2.default().insert(textBlot.value());\n var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex));\n change = diffDelta.reduce(function (delta, op) {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n } else {\n return delta.push(op);\n }\n }, new _quillDelta2.default());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, cursorIndex);\n }\n }\n return change;\n }\n }]);\n\n return Editor;\n}();\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce(function (merged, name) {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce(function (delta, op) {\n if (op.insert === 1) {\n var attributes = (0, _clone2.default)(op.attributes);\n delete attributes['image'];\n return delta.insert({ image: op.attributes.image }, attributes);\n }\n if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n op = (0, _clone2.default)(op);\n if (op.attributes.list) {\n op.attributes.list = 'ordered';\n } else {\n op.attributes.list = 'bullet';\n delete op.attributes.bullet;\n }\n }\n if (typeof op.insert === 'string') {\n var text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return delta.insert(text, op.attributes);\n }\n return delta.push(op);\n }, new _quillDelta2.default());\n}\n\nexports.default = Editor;\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports) {\n\n'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _emitter = __webpack_require__(9);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _break = __webpack_require__(14);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _container = __webpack_require__(23);\n\nvar _container2 = _interopRequireDefault(_container);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction isLine(blot) {\n return blot instanceof _block2.default || blot instanceof _block.BlockEmbed;\n}\n\nvar Scroll = function (_Parchment$Scroll) {\n _inherits(Scroll, _Parchment$Scroll);\n\n function Scroll(domNode, config) {\n _classCallCheck(this, Scroll);\n\n var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode));\n\n _this.emitter = config.emitter;\n if (Array.isArray(config.whitelist)) {\n _this.whitelist = config.whitelist.reduce(function (whitelist, format) {\n whitelist[format] = true;\n return whitelist;\n }, {});\n }\n // Some reason fixes composition issues with character languages in Windows/Chrome, Safari\n _this.domNode.addEventListener('DOMNodeInserted', function () {});\n _this.optimize();\n _this.enable();\n return _this;\n }\n\n _createClass(Scroll, [{\n key: 'batchStart',\n value: function batchStart() {\n this.batch = true;\n }\n }, {\n key: 'batchEnd',\n value: function batchEnd() {\n this.batch = false;\n this.optimize();\n }\n }, {\n key: 'deleteAt',\n value: function deleteAt(index, length) {\n var _line = this.line(index),\n _line2 = _slicedToArray(_line, 2),\n first = _line2[0],\n offset = _line2[1];\n\n var _line3 = this.line(index + length),\n _line4 = _slicedToArray(_line3, 1),\n last = _line4[0];\n\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) {\n this.optimize();\n return;\n }\n if (first instanceof _code2.default) {\n var newlineIndex = first.newlineIndex(first.length(), true);\n if (newlineIndex > -1) {\n first = first.split(newlineIndex + 1);\n if (first === last) {\n this.optimize();\n return;\n }\n }\n } else if (last instanceof _code2.default) {\n var _newlineIndex = last.newlineIndex(0);\n if (_newlineIndex > -1) {\n last.split(_newlineIndex + 1);\n }\n }\n var ref = last.children.head instanceof _break2.default ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n }, {\n key: 'enable',\n value: function enable() {\n var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n this.domNode.setAttribute('contenteditable', enabled);\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, format, value) {\n if (this.whitelist != null && !this.whitelist[format]) return;\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value);\n this.optimize();\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n if (index >= this.length()) {\n if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) {\n var blot = _parchment2.default.create(this.statics.defaultChild);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n value = value.slice(0, -1);\n }\n blot.insertAt(0, value, def);\n } else {\n var embed = _parchment2.default.create(value, def);\n this.appendChild(embed);\n }\n } else {\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def);\n }\n this.optimize();\n }\n }, {\n key: 'insertBefore',\n value: function insertBefore(blot, ref) {\n if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) {\n var wrapper = _parchment2.default.create(this.statics.defaultChild);\n wrapper.appendChild(blot);\n blot = wrapper;\n }\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref);\n }\n }, {\n key: 'leaf',\n value: function leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n }, {\n key: 'line',\n value: function line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n }, {\n key: 'lines',\n value: function lines() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n var getLines = function getLines(blot, index, length) {\n var lines = [],\n lengthLeft = length;\n blot.children.forEachAt(index, length, function (child, index, length) {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof _parchment2.default.Container) {\n lines = lines.concat(getLines(child, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return lines;\n };\n return getLines(this, index, length);\n }\n }, {\n key: 'optimize',\n value: function optimize() {\n var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (this.batch === true) return;\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n }, {\n key: 'path',\n value: function path(index) {\n return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self\n }\n }, {\n key: 'update',\n value: function update(mutations) {\n if (this.batch === true) return;\n var source = _emitter2.default.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations);\n }\n }\n }]);\n\n return Scroll;\n}(_parchment2.default.Scroll);\n\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = 'block';\nScroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default];\n\nexports.default = Scroll;\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extend2 = __webpack_require__(2);\n\nvar _extend3 = _interopRequireDefault(_extend2);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nvar _align = __webpack_require__(34);\n\nvar _background = __webpack_require__(35);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _color = __webpack_require__(24);\n\nvar _direction = __webpack_require__(36);\n\nvar _font = __webpack_require__(37);\n\nvar _size = __webpack_require__(38);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:clipboard');\n\nvar DOM_KEY = '__ql-matcher';\n\nvar CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]];\n\nvar ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nvar STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nvar Clipboard = function (_Module) {\n _inherits(Clipboard, _Module);\n\n function Clipboard(quill, options) {\n _classCallCheck(this, Clipboard);\n\n var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options));\n\n _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this));\n _this.container = _this.quill.addContainer('ql-clipboard');\n _this.container.setAttribute('contenteditable', true);\n _this.container.setAttribute('tabindex', -1);\n _this.matchers = [];\n CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n selector = _ref2[0],\n matcher = _ref2[1];\n\n if (!options.matchVisual && matcher === matchSpacing) return;\n _this.addMatcher(selector, matcher);\n });\n return _this;\n }\n\n _createClass(Clipboard, [{\n key: 'addMatcher',\n value: function addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n }, {\n key: 'convert',\n value: function convert(html) {\n if (typeof html === 'string') {\n this.container.innerHTML = html.replace(/\\>\\r?\\n +\\<'); // Remove spaces between tags\n return this.convert();\n }\n var formats = this.quill.getFormat(this.quill.selection.savedRange.index);\n if (formats[_code2.default.blotName]) {\n var text = this.container.innerText;\n this.container.innerHTML = '';\n return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName]));\n }\n\n var _prepareMatching = this.prepareMatching(),\n _prepareMatching2 = _slicedToArray(_prepareMatching, 2),\n elementMatchers = _prepareMatching2[0],\n textMatchers = _prepareMatching2[1];\n\n var delta = traverse(this.container, elementMatchers, textMatchers);\n // Remove trailing newline\n if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1));\n }\n debug.log('convert', this.container.innerHTML, delta);\n this.container.innerHTML = '';\n return delta;\n }\n }, {\n key: 'dangerouslyPasteHTML',\n value: function dangerouslyPasteHTML(index, html) {\n var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API;\n\n if (typeof index === 'string') {\n this.quill.setContents(this.convert(index), html);\n this.quill.setSelection(0, _quill2.default.sources.SILENT);\n } else {\n var paste = this.convert(html);\n this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source);\n this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT);\n }\n }\n }, {\n key: 'onPaste',\n value: function onPaste(e) {\n var _this2 = this;\n\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n var range = this.quill.getSelection();\n var delta = new _quillDelta2.default().retain(range.index);\n var scrollTop = this.quill.scrollingContainer.scrollTop;\n this.container.focus();\n this.quill.selection.update(_quill2.default.sources.SILENT);\n setTimeout(function () {\n delta = delta.concat(_this2.convert()).delete(range.length);\n _this2.quill.updateContents(delta, _quill2.default.sources.USER);\n // range.length contributes to delta.length()\n _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);\n _this2.quill.scrollingContainer.scrollTop = scrollTop;\n _this2.quill.focus();\n }, 1);\n }\n }, {\n key: 'prepareMatching',\n value: function prepareMatching() {\n var _this3 = this;\n\n var elementMatchers = [],\n textMatchers = [];\n this.matchers.forEach(function (pair) {\n var _pair = _slicedToArray(pair, 2),\n selector = _pair[0],\n matcher = _pair[1];\n\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n [].forEach.call(_this3.container.querySelectorAll(selector), function (node) {\n // TODO use weakmap\n node[DOM_KEY] = node[DOM_KEY] || [];\n node[DOM_KEY].push(matcher);\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n }]);\n\n return Clipboard;\n}(_module2.default);\n\nClipboard.DEFAULTS = {\n matchers: [],\n matchVisual: true\n};\n\nfunction applyFormat(delta, format, value) {\n if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') {\n return Object.keys(format).reduce(function (delta, key) {\n return applyFormat(delta, key, format[key]);\n }, delta);\n } else {\n return delta.reduce(function (delta, op) {\n if (op.attributes && op.attributes[format]) {\n return delta.push(op);\n } else {\n return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes));\n }\n }, new _quillDelta2.default());\n }\n}\n\nfunction computeStyle(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) return {};\n var DOM_KEY = '__ql-computed-style';\n return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n}\n\nfunction deltaEndsWith(delta, text) {\n var endText = \"\";\n for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n var op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1 * text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n var style = computeStyle(node);\n return ['block', 'list-item'].indexOf(style.display) > -1;\n}\n\nfunction traverse(node, elementMatchers, textMatchers) {\n // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce(function (delta, matcher) {\n return matcher(node, delta);\n }, new _quillDelta2.default());\n } else if (node.nodeType === node.ELEMENT_NODE) {\n return [].reduce.call(node.childNodes || [], function (delta, childNode) {\n var childrenDelta = traverse(childNode, elementMatchers, textMatchers);\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n }\n return delta.concat(childrenDelta);\n }, new _quillDelta2.default());\n } else {\n return new _quillDelta2.default();\n }\n}\n\nfunction matchAlias(format, node, delta) {\n return applyFormat(delta, format, true);\n}\n\nfunction matchAttributor(node, delta) {\n var attributes = _parchment2.default.Attributor.Attribute.keys(node);\n var classes = _parchment2.default.Attributor.Class.keys(node);\n var styles = _parchment2.default.Attributor.Style.keys(node);\n var formats = {};\n attributes.concat(classes).concat(styles).forEach(function (name) {\n var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n return delta;\n}\n\nfunction matchBlot(node, delta) {\n var match = _parchment2.default.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof _parchment2.default.Embed) {\n var embed = {};\n var value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n delta = new _quillDelta2.default().insert(embed, match.formats(node));\n }\n } else if (typeof match.formats === 'function') {\n delta = applyFormat(delta, match.blotName, match.formats(node));\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchIgnore() {\n return new _quillDelta2.default();\n}\n\nfunction matchIndent(node, delta) {\n var match = _parchment2.default.query(node);\n if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\\n')) {\n return delta;\n }\n var indent = -1,\n parent = node.parentNode;\n while (!parent.classList.contains('ql-clipboard')) {\n if ((_parchment2.default.query(parent) || {}).blotName === 'list') {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent }));\n}\n\nfunction matchNewline(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchSpacing(node, delta) {\n if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\\n\\n')) {\n var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);\n if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n var formats = {};\n var style = node.style || {};\n if (style.fontStyle && computeStyle(node).fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n if (parseFloat(style.textIndent || 0) > 0) {\n // Could be 0.5in\n delta = new _quillDelta2.default().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchText(node, delta) {\n var text = node.data;\n // Word represents empty line with  \n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) {\n return delta;\n }\n if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n // eslint-disable-next-line func-style\n var replacer = function replacer(collapse, match) {\n match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return match.length < 1 && collapse ? ' ' : match;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\nexports.default = Clipboard;\nexports.matchAttributor = matchAttributor;\nexports.matchBlot = matchBlot;\nexports.matchNewline = matchNewline;\nexports.matchSpacing = matchSpacing;\nexports.matchText = matchText;\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getLastChangeIndex = exports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar History = function (_Module) {\n _inherits(History, _Module);\n\n function History(quill, options) {\n _classCallCheck(this, History);\n\n var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options));\n\n _this.lastRecorded = 0;\n _this.ignoreChange = false;\n _this.clear();\n _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) {\n if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return;\n if (!_this.options.userOnly || source === _quill2.default.sources.USER) {\n _this.record(delta, oldDelta);\n } else {\n _this.transform(delta);\n }\n });\n _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this));\n _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this));\n if (/Win/i.test(navigator.platform)) {\n _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this));\n }\n return _this;\n }\n\n _createClass(History, [{\n key: 'change',\n value: function change(source, dest) {\n if (this.stack[source].length === 0) return;\n var delta = this.stack[source].pop();\n this.stack[dest].push(delta);\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta[source], _quill2.default.sources.USER);\n this.ignoreChange = false;\n var index = getLastChangeIndex(delta[source]);\n this.quill.setSelection(index);\n }\n }, {\n key: 'clear',\n value: function clear() {\n this.stack = { undo: [], redo: [] };\n }\n }, {\n key: 'cutoff',\n value: function cutoff() {\n this.lastRecorded = 0;\n }\n }, {\n key: 'record',\n value: function record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n var undoDelta = this.quill.getContents().diff(oldDelta);\n var timestamp = Date.now();\n if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n var delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta.undo);\n changeDelta = delta.redo.compose(changeDelta);\n } else {\n this.lastRecorded = timestamp;\n }\n this.stack.undo.push({\n redo: changeDelta,\n undo: undoDelta\n });\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n }, {\n key: 'redo',\n value: function redo() {\n this.change('redo', 'undo');\n }\n }, {\n key: 'transform',\n value: function transform(delta) {\n this.stack.undo.forEach(function (change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n this.stack.redo.forEach(function (change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n }\n }, {\n key: 'undo',\n value: function undo() {\n this.change('undo', 'redo');\n }\n }]);\n\n return History;\n}(_module2.default);\n\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false\n};\n\nfunction endsWithNewlineChange(delta) {\n var lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(function (attr) {\n return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(delta) {\n var deleteLength = delta.reduce(function (length, op) {\n length += op.delete || 0;\n return length;\n }, 0);\n var changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\nexports.default = History;\nexports.getLastChangeIndex = getLastChangeIndex;\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.IndentClass = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar IdentAttributor = function (_Parchment$Attributor) {\n _inherits(IdentAttributor, _Parchment$Attributor);\n\n function IdentAttributor() {\n _classCallCheck(this, IdentAttributor);\n\n return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments));\n }\n\n _createClass(IdentAttributor, [{\n key: 'add',\n value: function add(node, value) {\n if (value === '+1' || value === '-1') {\n var indent = this.value(node) || 0;\n value = value === '+1' ? indent + 1 : indent - 1;\n }\n if (value === 0) {\n this.remove(node);\n return true;\n } else {\n return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value);\n }\n }\n }, {\n key: 'canAdd',\n value: function canAdd(node, value) {\n return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value));\n }\n }, {\n key: 'value',\n value: function value(node) {\n return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN\n }\n }]);\n\n return IdentAttributor;\n}(_parchment2.default.Attributor.Class);\n\nvar IndentClass = new IdentAttributor('indent', 'ql-indent', {\n scope: _parchment2.default.Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n});\n\nexports.IndentClass = IndentClass;\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Blockquote = function (_Block) {\n _inherits(Blockquote, _Block);\n\n function Blockquote() {\n _classCallCheck(this, Blockquote);\n\n return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments));\n }\n\n return Blockquote;\n}(_block2.default);\n\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\nexports.default = Blockquote;\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Header = function (_Block) {\n _inherits(Header, _Block);\n\n function Header() {\n _classCallCheck(this, Header);\n\n return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments));\n }\n\n _createClass(Header, null, [{\n key: 'formats',\n value: function formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n }]);\n\n return Header;\n}(_block2.default);\n\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\nexports.default = Header;\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.ListItem = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _container = __webpack_require__(23);\n\nvar _container2 = _interopRequireDefault(_container);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ListItem = function (_Block) {\n _inherits(ListItem, _Block);\n\n function ListItem() {\n _classCallCheck(this, ListItem);\n\n return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments));\n }\n\n _createClass(ListItem, [{\n key: 'format',\n value: function format(name, value) {\n if (name === List.blotName && !value) {\n this.replaceWith(_parchment2.default.create(this.statics.scope));\n } else {\n _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value);\n }\n }\n }, {\n key: 'remove',\n value: function remove() {\n if (this.prev == null && this.next == null) {\n this.parent.remove();\n } else {\n _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this);\n }\n }\n }, {\n key: 'replaceWith',\n value: function replaceWith(name, value) {\n this.parent.isolate(this.offset(this.parent), this.length());\n if (name === this.parent.statics.blotName) {\n this.parent.replaceWith(name, value);\n return this;\n } else {\n this.parent.unwrap();\n return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value);\n }\n }\n }], [{\n key: 'formats',\n value: function formats(domNode) {\n return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode);\n }\n }]);\n\n return ListItem;\n}(_block2.default);\n\nListItem.blotName = 'list-item';\nListItem.tagName = 'LI';\n\nvar List = function (_Container) {\n _inherits(List, _Container);\n\n _createClass(List, null, [{\n key: 'create',\n value: function create(value) {\n var tagName = value === 'ordered' ? 'OL' : 'UL';\n var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName);\n if (value === 'checked' || value === 'unchecked') {\n node.setAttribute('data-checked', value === 'checked');\n }\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n if (domNode.tagName === 'OL') return 'ordered';\n if (domNode.tagName === 'UL') {\n if (domNode.hasAttribute('data-checked')) {\n return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked';\n } else {\n return 'bullet';\n }\n }\n return undefined;\n }\n }]);\n\n function List(domNode) {\n _classCallCheck(this, List);\n\n var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode));\n\n var listEventHandler = function listEventHandler(e) {\n if (e.target.parentNode !== domNode) return;\n var format = _this2.statics.formats(domNode);\n var blot = _parchment2.default.find(e.target);\n if (format === 'checked') {\n blot.format('list', 'unchecked');\n } else if (format === 'unchecked') {\n blot.format('list', 'checked');\n }\n };\n\n domNode.addEventListener('touchstart', listEventHandler);\n domNode.addEventListener('mousedown', listEventHandler);\n return _this2;\n }\n\n _createClass(List, [{\n key: 'format',\n value: function format(name, value) {\n if (this.children.length > 0) {\n this.children.tail.format(name, value);\n }\n }\n }, {\n key: 'formats',\n value: function formats() {\n // We don't inherit from FormatBlot\n return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode));\n }\n }, {\n key: 'insertBefore',\n value: function insertBefore(blot, ref) {\n if (blot instanceof ListItem) {\n _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref);\n } else {\n var index = ref == null ? this.length() : ref.offset(this);\n var after = this.split(index);\n after.parent.insertBefore(blot, after);\n }\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context);\n var next = this.next;\n if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) {\n next.moveChildren(this);\n next.remove();\n }\n }\n }, {\n key: 'replace',\n value: function replace(target) {\n if (target.statics.blotName !== this.statics.blotName) {\n var item = _parchment2.default.create(this.statics.defaultChild);\n target.moveChildren(item);\n this.appendChild(item);\n }\n _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target);\n }\n }]);\n\n return List;\n}(_container2.default);\n\nList.blotName = 'list';\nList.scope = _parchment2.default.Scope.BLOCK_BLOT;\nList.tagName = ['OL', 'UL'];\nList.defaultChild = 'list-item';\nList.allowedChildren = [ListItem];\n\nexports.ListItem = ListItem;\nexports.default = List;\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _bold = __webpack_require__(39);\n\nvar _bold2 = _interopRequireDefault(_bold);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Italic = function (_Bold) {\n _inherits(Italic, _Bold);\n\n function Italic() {\n _classCallCheck(this, Italic);\n\n return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments));\n }\n\n return Italic;\n}(_bold2.default);\n\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexports.default = Italic;\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Script = function (_Inline) {\n _inherits(Script, _Inline);\n\n function Script() {\n _classCallCheck(this, Script);\n\n return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments));\n }\n\n _createClass(Script, null, [{\n key: 'create',\n value: function create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n } else if (value === 'sub') {\n return document.createElement('sub');\n } else {\n return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value);\n }\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n }]);\n\n return Script;\n}(_inline2.default);\n\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexports.default = Script;\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Strike = function (_Inline) {\n _inherits(Strike, _Inline);\n\n function Strike() {\n _classCallCheck(this, Strike);\n\n return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments));\n }\n\n return Strike;\n}(_inline2.default);\n\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexports.default = Strike;\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Underline = function (_Inline) {\n _inherits(Underline, _Inline);\n\n function Underline() {\n _classCallCheck(this, Underline);\n\n return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments));\n }\n\n return Underline;\n}(_inline2.default);\n\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexports.default = Underline;\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _link = __webpack_require__(15);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ATTRIBUTES = ['alt', 'height', 'width'];\n\nvar Image = function (_Parchment$Embed) {\n _inherits(Image, _Parchment$Embed);\n\n function Image() {\n _classCallCheck(this, Image);\n\n return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments));\n }\n\n _createClass(Image, [{\n key: 'format',\n value: function format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value);\n }\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n return ATTRIBUTES.reduce(function (formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n }, {\n key: 'match',\n value: function match(url) {\n return (/\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url)\n );\n }\n }, {\n key: 'sanitize',\n value: function sanitize(url) {\n return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n }, {\n key: 'value',\n value: function value(domNode) {\n return domNode.getAttribute('src');\n }\n }]);\n\n return Image;\n}(_parchment2.default.Embed);\n\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\nexports.default = Image;\n\n/***/ }),\n/* 71 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _block = __webpack_require__(3);\n\nvar _link = __webpack_require__(15);\n\nvar _link2 = _interopRequireDefault(_link);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ATTRIBUTES = ['height', 'width'];\n\nvar Video = function (_BlockEmbed) {\n _inherits(Video, _BlockEmbed);\n\n function Video() {\n _classCallCheck(this, Video);\n\n return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments));\n }\n\n _createClass(Video, [{\n key: 'format',\n value: function format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value);\n }\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n return ATTRIBUTES.reduce(function (formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n }, {\n key: 'sanitize',\n value: function sanitize(url) {\n return _link2.default.sanitize(url);\n }\n }, {\n key: 'value',\n value: function value(domNode) {\n return domNode.getAttribute('src');\n }\n }]);\n\n return Video;\n}(_block.BlockEmbed);\n\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\nexports.default = Video;\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.FormulaBlot = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _embed = __webpack_require__(33);\n\nvar _embed2 = _interopRequireDefault(_embed);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar FormulaBlot = function (_Embed) {\n _inherits(FormulaBlot, _Embed);\n\n function FormulaBlot() {\n _classCallCheck(this, FormulaBlot);\n\n return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments));\n }\n\n _createClass(FormulaBlot, null, [{\n key: 'create',\n value: function create(value) {\n var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value);\n if (typeof value === 'string') {\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00'\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n }, {\n key: 'value',\n value: function value(domNode) {\n return domNode.getAttribute('data-value');\n }\n }]);\n\n return FormulaBlot;\n}(_embed2.default);\n\nFormulaBlot.blotName = 'formula';\nFormulaBlot.className = 'ql-formula';\nFormulaBlot.tagName = 'SPAN';\n\nvar Formula = function (_Module) {\n _inherits(Formula, _Module);\n\n _createClass(Formula, null, [{\n key: 'register',\n value: function register() {\n _quill2.default.register(FormulaBlot, true);\n }\n }]);\n\n function Formula() {\n _classCallCheck(this, Formula);\n\n var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this));\n\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n return _this2;\n }\n\n return Formula;\n}(_module2.default);\n\nexports.FormulaBlot = FormulaBlot;\nexports.default = Formula;\n\n/***/ }),\n/* 73 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.CodeToken = exports.CodeBlock = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar SyntaxCodeBlock = function (_CodeBlock) {\n _inherits(SyntaxCodeBlock, _CodeBlock);\n\n function SyntaxCodeBlock() {\n _classCallCheck(this, SyntaxCodeBlock);\n\n return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments));\n }\n\n _createClass(SyntaxCodeBlock, [{\n key: 'replaceWith',\n value: function replaceWith(block) {\n this.domNode.textContent = this.domNode.textContent;\n this.attach();\n _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block);\n }\n }, {\n key: 'highlight',\n value: function highlight(_highlight) {\n var text = this.domNode.textContent;\n if (this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n this.domNode.innerHTML = _highlight(text);\n this.domNode.normalize();\n this.attach();\n }\n this.cachedText = text;\n }\n }\n }]);\n\n return SyntaxCodeBlock;\n}(_code2.default);\n\nSyntaxCodeBlock.className = 'ql-syntax';\n\nvar CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', {\n scope: _parchment2.default.Scope.INLINE\n});\n\nvar Syntax = function (_Module) {\n _inherits(Syntax, _Module);\n\n _createClass(Syntax, null, [{\n key: 'register',\n value: function register() {\n _quill2.default.register(CodeToken, true);\n _quill2.default.register(SyntaxCodeBlock, true);\n }\n }]);\n\n function Syntax(quill, options) {\n _classCallCheck(this, Syntax);\n\n var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options));\n\n if (typeof _this2.options.highlight !== 'function') {\n throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');\n }\n var timer = null;\n _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {\n clearTimeout(timer);\n timer = setTimeout(function () {\n _this2.highlight();\n timer = null;\n }, _this2.options.interval);\n });\n _this2.highlight();\n return _this2;\n }\n\n _createClass(Syntax, [{\n key: 'highlight',\n value: function highlight() {\n var _this3 = this;\n\n if (this.quill.selection.composing) return;\n this.quill.update(_quill2.default.sources.USER);\n var range = this.quill.getSelection();\n this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) {\n code.highlight(_this3.options.highlight);\n });\n this.quill.update(_quill2.default.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, _quill2.default.sources.SILENT);\n }\n }\n }]);\n\n return Syntax;\n}(_module2.default);\n\nSyntax.DEFAULTS = {\n highlight: function () {\n if (window.hljs == null) return null;\n return function (text) {\n var result = window.hljs.highlightAuto(text);\n return result.value;\n };\n }(),\n interval: 1000\n};\n\nexports.CodeBlock = SyntaxCodeBlock;\nexports.CodeToken = CodeToken;\nexports.default = Syntax;\n\n/***/ }),\n/* 74 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addControls = exports.default = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:toolbar');\n\nvar Toolbar = function (_Module) {\n _inherits(Toolbar, _Module);\n\n function Toolbar(quill, options) {\n _classCallCheck(this, Toolbar);\n\n var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options));\n\n if (Array.isArray(_this.options.container)) {\n var container = document.createElement('div');\n addControls(container, _this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n _this.container = container;\n } else if (typeof _this.options.container === 'string') {\n _this.container = document.querySelector(_this.options.container);\n } else {\n _this.container = _this.options.container;\n }\n if (!(_this.container instanceof HTMLElement)) {\n var _ret;\n\n return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret);\n }\n _this.container.classList.add('ql-toolbar');\n _this.controls = [];\n _this.handlers = {};\n Object.keys(_this.options.handlers).forEach(function (format) {\n _this.addHandler(format, _this.options.handlers[format]);\n });\n [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) {\n _this.attach(input);\n });\n _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) {\n if (type === _quill2.default.events.SELECTION_CHANGE) {\n _this.update(range);\n }\n });\n _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {\n var _this$quill$selection = _this.quill.selection.getRange(),\n _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1),\n range = _this$quill$selection2[0]; // quill.getSelection triggers update\n\n\n _this.update(range);\n });\n return _this;\n }\n\n _createClass(Toolbar, [{\n key: 'addHandler',\n value: function addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n }, {\n key: 'attach',\n value: function attach(input) {\n var _this2 = this;\n\n var format = [].find.call(input.classList, function (className) {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (this.handlers[format] == null) {\n if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n debug.warn('ignoring attaching to disabled format', format, input);\n return;\n }\n if (_parchment2.default.query(format) == null) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n }\n var eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, function (e) {\n var value = void 0;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n var selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n _this2.quill.focus();\n\n var _quill$selection$getR = _this2.quill.selection.getRange(),\n _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1),\n range = _quill$selection$getR2[0];\n\n if (_this2.handlers[format] != null) {\n _this2.handlers[format].call(_this2, value);\n } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) {\n value = prompt('Enter ' + format);\n if (!value) return;\n _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER);\n } else {\n _this2.quill.format(format, value, _quill2.default.sources.USER);\n }\n _this2.update(range);\n });\n // TODO use weakmap\n this.controls.push([format, input]);\n }\n }, {\n key: 'update',\n value: function update(range) {\n var formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(function (pair) {\n var _pair = _slicedToArray(pair, 2),\n format = _pair[0],\n input = _pair[1];\n\n if (input.tagName === 'SELECT') {\n var option = void 0;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n var value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\\\"/g, '\\\\\"');\n }\n option = input.querySelector('option[value=\"' + value + '\"]');\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else {\n if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value');\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n }\n });\n }\n }]);\n\n return Toolbar;\n}(_module2.default);\n\nToolbar.DEFAULTS = {};\n\nfunction addButton(container, format, value) {\n var input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add('ql-' + format);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(function (controls) {\n var group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(function (control) {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n var format = Object.keys(control)[0];\n var value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n var input = document.createElement('select');\n input.classList.add('ql-' + format);\n values.forEach(function (value) {\n var option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean: function clean() {\n var _this3 = this;\n\n var range = this.quill.getSelection();\n if (range == null) return;\n if (range.length == 0) {\n var formats = this.quill.getFormat();\n Object.keys(formats).forEach(function (name) {\n // Clean functionality in existing apps only clean inline formats\n if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) {\n _this3.quill.format(name, false);\n }\n });\n } else {\n this.quill.removeFormat(range, _quill2.default.sources.USER);\n }\n },\n direction: function direction(value) {\n var align = this.quill.getFormat()['align'];\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', _quill2.default.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, _quill2.default.sources.USER);\n }\n this.quill.format('direction', value, _quill2.default.sources.USER);\n },\n indent: function indent(value) {\n var range = this.quill.getSelection();\n var formats = this.quill.getFormat(range);\n var indent = parseInt(formats.indent || 0);\n if (value === '+1' || value === '-1') {\n var modifier = value === '+1' ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, _quill2.default.sources.USER);\n }\n },\n link: function link(value) {\n if (value === true) {\n value = prompt('Enter link URL:');\n }\n this.quill.format('link', value, _quill2.default.sources.USER);\n },\n list: function list(value) {\n var range = this.quill.getSelection();\n var formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats['list'] === 'checked' || formats['list'] === 'unchecked') {\n this.quill.format('list', false, _quill2.default.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', _quill2.default.sources.USER);\n }\n } else {\n this.quill.format('list', value, _quill2.default.sources.USER);\n }\n }\n }\n};\n\nexports.default = Toolbar;\nexports.addControls = addControls;\n\n/***/ }),\n/* 75 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 76 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 77 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 78 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 79 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 80 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 81 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 82 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 83 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 84 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 85 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 86 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 87 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 88 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 89 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 90 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 91 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 92 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 93 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 94 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 95 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 96 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 97 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 98 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 99 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 100 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 101 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 102 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 103 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 104 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 105 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 106 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 107 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.BubbleTooltip = undefined;\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _emitter = __webpack_require__(9);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _base = __webpack_require__(44);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _selection = __webpack_require__(22);\n\nvar _icons = __webpack_require__(26);\n\nvar _icons2 = _interopRequireDefault(_icons);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']];\n\nvar BubbleTheme = function (_BaseTheme) {\n _inherits(BubbleTheme, _BaseTheme);\n\n function BubbleTheme(quill, options) {\n _classCallCheck(this, BubbleTheme);\n\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n\n var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options));\n\n _this.quill.container.classList.add('ql-bubble');\n return _this;\n }\n\n _createClass(BubbleTheme, [{\n key: 'extendToolbar',\n value: function extendToolbar(toolbar) {\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);\n }\n }]);\n\n return BubbleTheme;\n}(_base2.default);\n\nBubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function link(value) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n }\n }\n }\n }\n});\n\nvar BubbleTooltip = function (_BaseTooltip) {\n _inherits(BubbleTooltip, _BaseTooltip);\n\n function BubbleTooltip(quill, bounds) {\n _classCallCheck(this, BubbleTooltip);\n\n var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds));\n\n _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) {\n if (type !== _emitter2.default.events.SELECTION_CHANGE) return;\n if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) {\n _this2.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n _this2.root.style.left = '0px';\n _this2.root.style.width = '';\n _this2.root.style.width = _this2.root.offsetWidth + 'px';\n var lines = _this2.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n _this2.position(_this2.quill.getBounds(range));\n } else {\n var lastLine = lines[lines.length - 1];\n var index = _this2.quill.getIndex(lastLine);\n var length = Math.min(lastLine.length() - 1, range.index + range.length - index);\n var _bounds = _this2.quill.getBounds(new _selection.Range(index, length));\n _this2.position(_bounds);\n }\n } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) {\n _this2.hide();\n }\n });\n return _this2;\n }\n\n _createClass(BubbleTooltip, [{\n key: 'listen',\n value: function listen() {\n var _this3 = this;\n\n _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this);\n this.root.querySelector('.ql-close').addEventListener('click', function () {\n _this3.root.classList.remove('ql-editing');\n });\n this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(function () {\n if (_this3.root.classList.contains('ql-hidden')) return;\n var range = _this3.quill.getSelection();\n if (range != null) {\n _this3.position(_this3.quill.getBounds(range));\n }\n }, 1);\n });\n }\n }, {\n key: 'cancel',\n value: function cancel() {\n this.show();\n }\n }, {\n key: 'position',\n value: function position(reference) {\n var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference);\n var arrow = this.root.querySelector('.ql-tooltip-arrow');\n arrow.style.marginLeft = '';\n if (shift === 0) return shift;\n arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px';\n }\n }]);\n\n return BubbleTooltip;\n}(_base.BaseTooltip);\n\nBubbleTooltip.TEMPLATE = ['', '
    ', '', '', '
    '].join('');\n\nexports.BubbleTooltip = BubbleTooltip;\nexports.default = BubbleTheme;\n\n/***/ }),\n/* 108 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _emitter = __webpack_require__(9);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _base = __webpack_require__(44);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _link = __webpack_require__(15);\n\nvar _link2 = _interopRequireDefault(_link);\n\nvar _selection = __webpack_require__(22);\n\nvar _icons = __webpack_require__(26);\n\nvar _icons2 = _interopRequireDefault(_icons);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']];\n\nvar SnowTheme = function (_BaseTheme) {\n _inherits(SnowTheme, _BaseTheme);\n\n function SnowTheme(quill, options) {\n _classCallCheck(this, SnowTheme);\n\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n\n var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options));\n\n _this.quill.container.classList.add('ql-snow');\n return _this;\n }\n\n _createClass(SnowTheme, [{\n key: 'extendToolbar',\n value: function extendToolbar(toolbar) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) {\n toolbar.handlers['link'].call(toolbar, !context.format.link);\n });\n }\n }\n }]);\n\n return SnowTheme;\n}(_base2.default);\n\nSnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function link(value) {\n if (value) {\n var range = this.quill.getSelection();\n if (range == null || range.length == 0) return;\n var preview = this.quill.getText(range);\n if (/^\\S+@\\S+\\.\\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {\n preview = 'mailto:' + preview;\n }\n var tooltip = this.quill.theme.tooltip;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n }\n }\n }\n }\n});\n\nvar SnowTooltip = function (_BaseTooltip) {\n _inherits(SnowTooltip, _BaseTooltip);\n\n function SnowTooltip(quill, bounds) {\n _classCallCheck(this, SnowTooltip);\n\n var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds));\n\n _this2.preview = _this2.root.querySelector('a.ql-preview');\n return _this2;\n }\n\n _createClass(SnowTooltip, [{\n key: 'listen',\n value: function listen() {\n var _this3 = this;\n\n _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this);\n this.root.querySelector('a.ql-action').addEventListener('click', function (event) {\n if (_this3.root.classList.contains('ql-editing')) {\n _this3.save();\n } else {\n _this3.edit('link', _this3.preview.textContent);\n }\n event.preventDefault();\n });\n this.root.querySelector('a.ql-remove').addEventListener('click', function (event) {\n if (_this3.linkRange != null) {\n var range = _this3.linkRange;\n _this3.restoreFocus();\n _this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER);\n delete _this3.linkRange;\n }\n event.preventDefault();\n _this3.hide();\n });\n this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) {\n if (range == null) return;\n if (range.length === 0 && source === _emitter2.default.sources.USER) {\n var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index),\n _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),\n link = _quill$scroll$descend2[0],\n offset = _quill$scroll$descend2[1];\n\n if (link != null) {\n _this3.linkRange = new _selection.Range(range.index - offset, link.length());\n var preview = _link2.default.formats(link.domNode);\n _this3.preview.textContent = preview;\n _this3.preview.setAttribute('href', preview);\n _this3.show();\n _this3.position(_this3.quill.getBounds(_this3.linkRange));\n return;\n }\n } else {\n delete _this3.linkRange;\n }\n _this3.hide();\n });\n }\n }, {\n key: 'show',\n value: function show() {\n _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this);\n this.root.removeAttribute('data-mode');\n }\n }]);\n\n return SnowTooltip;\n}(_base.BaseTooltip);\n\nSnowTooltip.TEMPLATE = ['', '', '', ''].join('');\n\nexports.default = SnowTheme;\n\n/***/ })\n/******/ ])[\"default\"];\n});\n\n\n// WEBPACK FOOTER //\n// quill.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 45);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap bc1e3bc04ac5f71cbeee","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = require(\"./blot/abstract/container\");\nvar format_1 = require(\"./blot/abstract/format\");\nvar leaf_1 = require(\"./blot/abstract/leaf\");\nvar scroll_1 = require(\"./blot/scroll\");\nvar inline_1 = require(\"./blot/inline\");\nvar block_1 = require(\"./blot/block\");\nvar embed_1 = require(\"./blot/embed\");\nvar text_1 = require(\"./blot/text\");\nvar attributor_1 = require(\"./attributor/attributor\");\nvar class_1 = require(\"./attributor/class\");\nvar style_1 = require(\"./attributor/style\");\nvar store_1 = require(\"./attributor/store\");\nvar Registry = require(\"./registry\");\nvar Parchment = {\n Scope: Registry.Scope,\n create: Registry.create,\n find: Registry.find,\n query: Registry.query,\n register: Registry.register,\n Container: container_1.default,\n Format: format_1.default,\n Leaf: leaf_1.default,\n Embed: embed_1.default,\n Scroll: scroll_1.default,\n Block: block_1.default,\n Inline: inline_1.default,\n Text: text_1.default,\n Attributor: {\n Attribute: attributor_1.default,\n Class: class_1.default,\n Style: style_1.default,\n Store: store_1.default,\n },\n};\nexports.default = Parchment;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/parchment.ts\n// module id = 0\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ParchmentError = /** @class */ (function (_super) {\n __extends(ParchmentError, _super);\n function ParchmentError(message) {\n var _this = this;\n message = '[Parchment] ' + message;\n _this = _super.call(this, message) || this;\n _this.message = message;\n _this.name = _this.constructor.name;\n return _this;\n }\n return ParchmentError;\n}(Error));\nexports.ParchmentError = ParchmentError;\nvar attributes = {};\nvar classes = {};\nvar tags = {};\nvar types = {};\nexports.DATA_KEY = '__blot';\nvar Scope;\n(function (Scope) {\n Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n})(Scope = exports.Scope || (exports.Scope = {}));\nfunction create(input, value) {\n var match = query(input);\n if (match == null) {\n throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n }\n var BlotClass = match;\n var node = \n // @ts-ignore\n input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value);\n return new BlotClass(node, value);\n}\nexports.create = create;\nfunction find(node, bubble) {\n if (bubble === void 0) { bubble = false; }\n if (node == null)\n return null;\n // @ts-ignore\n if (node[exports.DATA_KEY] != null)\n return node[exports.DATA_KEY].blot;\n if (bubble)\n return find(node.parentNode, bubble);\n return null;\n}\nexports.find = find;\nfunction query(query, scope) {\n if (scope === void 0) { scope = Scope.ANY; }\n var match;\n if (typeof query === 'string') {\n match = types[query] || attributes[query];\n // @ts-ignore\n }\n else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) {\n match = types['text'];\n }\n else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = types['block'];\n }\n else if (query & Scope.LEVEL & Scope.INLINE) {\n match = types['inline'];\n }\n }\n else if (query instanceof HTMLElement) {\n var names = (query.getAttribute('class') || '').split(/\\s+/);\n for (var i in names) {\n match = classes[names[i]];\n if (match)\n break;\n }\n match = match || tags[query.tagName];\n }\n if (match == null)\n return null;\n // @ts-ignore\n if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)\n return match;\n return null;\n}\nexports.query = query;\nfunction register() {\n var Definitions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n Definitions[_i] = arguments[_i];\n }\n if (Definitions.length > 1) {\n return Definitions.map(function (d) {\n return register(d);\n });\n }\n var Definition = Definitions[0];\n if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n throw new ParchmentError('Invalid definition');\n }\n else if (Definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n types[Definition.blotName || Definition.attrName] = Definition;\n if (typeof Definition.keyName === 'string') {\n attributes[Definition.keyName] = Definition;\n }\n else {\n if (Definition.className != null) {\n classes[Definition.className] = Definition;\n }\n if (Definition.tagName != null) {\n if (Array.isArray(Definition.tagName)) {\n Definition.tagName = Definition.tagName.map(function (tagName) {\n return tagName.toUpperCase();\n });\n }\n else {\n Definition.tagName = Definition.tagName.toUpperCase();\n }\n var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n tagNames.forEach(function (tag) {\n if (tags[tag] == null || Definition.className == null) {\n tags[tag] = Definition;\n }\n });\n }\n }\n return Definition;\n}\nexports.register = register;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/registry.ts\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = target[name];\n\t\t\t\tcopy = options[name];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\ttarget[name] = extend(deep, clone, copy);\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/extend/index.js\n// module id = 2\n// module chunks = 0","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Break from './break';\nimport Inline from './inline';\nimport TextBlot from './text';\n\n\nconst NEWLINE_LENGTH = 1;\n\n\nclass BlockEmbed extends Parchment.Embed {\n attach() {\n super.attach();\n this.attributes = new Parchment.Attributor.Store(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), extend(this.formats(), this.attributes.values()));\n }\n\n format(name, value) {\n let attribute = Parchment.query(name, Parchment.Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index, length, name, value) {\n this.format(name, value);\n }\n\n insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n let block = Parchment.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n super.insertAt(index, value, def);\n }\n }\n}\nBlockEmbed.scope = Parchment.Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\n\nclass Block extends Parchment.Block {\n constructor(domNode) {\n super(domNode);\n this.cache = {};\n }\n\n delta() {\n if (this.cache.delta == null) {\n this.cache.delta = this.descendants(Parchment.Leaf).reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n } else {\n return delta.insert(leaf.value(), bubbleFormats(leaf));\n }\n }, new Delta()).insert('\\n', bubbleFormats(this));\n }\n return this.cache.delta;\n }\n\n deleteAt(index, length) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(index, Math.min(length, this.length() - index - 1), name, value);\n }\n this.cache = {};\n }\n\n insertAt(index, value, def) {\n if (def != null) return super.insertAt(index, value, def);\n if (value.length === 0) return;\n let lines = value.split('\\n');\n let text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n let block = this;\n lines.reduce(function(index, line) {\n block = block.split(index, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot, ref) {\n let head = this.children.head;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target, ref) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index) {\n return super.path(index, true);\n }\n\n removeChild(child) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index, force = false) {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n let clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n } else {\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n } else {\n let next = super.split(index, force);\n this.cache = {};\n return next;\n }\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = 'break';\nBlock.allowedChildren = [Inline, Parchment.Embed, TextBlot];\n\n\nfunction bubbleFormats(blot, formats = {}) {\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = extend(formats, blot.formats());\n }\n if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats);\n}\n\n\nexport { bubbleFormats, BlockEmbed, Block as default };\n\n\n\n// WEBPACK FOOTER //\n// ./blots/block.js","var diff = require('fast-diff');\nvar equal = require('deep-equal');\nvar extend = require('extend');\nvar op = require('./op');\n\n\nvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\n\nvar Delta = function (ops) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n};\n\n\nDelta.prototype.insert = function (text, attributes) {\n var newOp = {};\n if (text.length === 0) return this;\n newOp.insert = text;\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype['delete'] = function (length) {\n if (length <= 0) return this;\n return this.push({ 'delete': length });\n};\n\nDelta.prototype.retain = function (length, attributes) {\n if (length <= 0) return this;\n var newOp = { retain: length };\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype.push = function (newOp) {\n var index = this.ops.length;\n var lastOp = this.ops[index - 1];\n newOp = extend(true, {}, newOp);\n if (typeof lastOp === 'object') {\n if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {\n this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (equal(newOp.attributes, lastOp.attributes)) {\n if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n};\n\nDelta.prototype.chop = function () {\n var lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n};\n\nDelta.prototype.filter = function (predicate) {\n return this.ops.filter(predicate);\n};\n\nDelta.prototype.forEach = function (predicate) {\n this.ops.forEach(predicate);\n};\n\nDelta.prototype.map = function (predicate) {\n return this.ops.map(predicate);\n};\n\nDelta.prototype.partition = function (predicate) {\n var passed = [], failed = [];\n this.forEach(function(op) {\n var target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n};\n\nDelta.prototype.reduce = function (predicate, initial) {\n return this.ops.reduce(predicate, initial);\n};\n\nDelta.prototype.changeLength = function () {\n return this.reduce(function (length, elem) {\n if (elem.insert) {\n return length + op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n};\n\nDelta.prototype.length = function () {\n return this.reduce(function (length, elem) {\n return length + op.length(elem);\n }, 0);\n};\n\nDelta.prototype.slice = function (start, end) {\n start = start || 0;\n if (typeof end !== 'number') end = Infinity;\n var ops = [];\n var iter = op.iterator(this.ops);\n var index = 0;\n while (index < end && iter.hasNext()) {\n var nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += op.length(nextOp);\n }\n return new Delta(ops);\n};\n\n\nDelta.prototype.compose = function (other) {\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (typeof otherOp.retain === 'number') {\n var newOp = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length;\n } else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n if (attributes) newOp.attributes = attributes;\n delta.push(newOp);\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.concat = function (other) {\n var delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n};\n\nDelta.prototype.diff = function (other, index) {\n if (this.ops === other.ops) {\n return new Delta();\n }\n var strings = [this, other].map(function (delta) {\n return delta.map(function (op) {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n var prep = (delta === other) ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n }).join('');\n });\n var delta = new Delta();\n var diffResult = diff(strings[0], strings[1], index);\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n diffResult.forEach(function (component) {\n var length = component[1].length;\n while (length > 0) {\n var opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n delta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n delta['delete'](opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n var thisOp = thisIter.next(opLength);\n var otherOp = otherIter.next(opLength);\n if (equal(thisOp.insert, otherOp.insert)) {\n delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));\n } else {\n delta.push(otherOp)['delete'](opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return delta.chop();\n};\n\nDelta.prototype.eachLine = function (predicate, newline) {\n newline = newline || '\\n';\n var iter = op.iterator(this.ops);\n var line = new Delta();\n var i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') return;\n var thisOp = iter.peek();\n var start = op.length(thisOp) - iter.peekLength();\n var index = typeof thisOp.insert === 'string' ?\n thisOp.insert.indexOf(newline, start) - start : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n};\n\nDelta.prototype.transform = function (other, priority) {\n priority = !!priority;\n if (typeof other === 'number') {\n return this.transformPosition(other, priority);\n }\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {\n delta.retain(op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (thisOp['delete']) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp['delete']) {\n delta.push(otherOp);\n } else {\n // We retain either their retain or insert\n delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.transformPosition = function (index, priority) {\n priority = !!priority;\n var thisIter = op.iterator(this.ops);\n var offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n var length = thisIter.peekLength();\n var nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n};\n\n\nmodule.exports = Delta;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/quill-delta/lib/delta.js\n// module id = 4\n// module chunks = 0","import Text from './text';\nimport Parchment from 'parchment';\n\n\nclass Inline extends Parchment.Inline {\n static compare(self, other) {\n let selfIndex = Inline.order.indexOf(self);\n let otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n } else if (self === other) {\n return 0;\n } else if (self < other) {\n return -1;\n } else {\n return 1;\n }\n }\n\n formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && Parchment.query(name, Parchment.Scope.BLOT)) {\n let blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n if (this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n let parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\nInline.allowedChildren = [Inline, Parchment.Embed, Text];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = [\n 'cursor', 'inline', // Must be lower\n 'underline', 'strike', 'italic', 'bold', 'script',\n 'link', 'code' // Must be higher\n];\n\n\nexport default Inline;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/inline.js","import './polyfill';\nimport Delta from 'quill-delta';\nimport Editor from './editor';\nimport Emitter from './emitter';\nimport Module from './module';\nimport Parchment from 'parchment';\nimport Selection, { Range } from './selection';\nimport extend from 'extend';\nimport logger from './logger';\nimport Theme from './theme';\n\nlet debug = logger('quill');\n\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static find(node) {\n return node.__quill || Parchment.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(path, target, overwrite = false) {\n if (typeof path !== 'string') {\n let name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register('formats/' + name, path, target);\n } else {\n Object.keys(path).forEach((key) => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if ((path.startsWith('blots/') || path.startsWith('formats/')) &&\n target.blotName !== 'abstract') {\n Parchment.register(target);\n } else if (path.startsWith('modules') && typeof target.register === 'function') {\n target.register();\n }\n }\n }\n\n constructor(container, options = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n let html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n this.container.__quill = this;\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new Emitter();\n this.scroll = Parchment.create(this.root, {\n emitter: this.emitter,\n whitelist: this.options.formats\n });\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options);\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n let range = this.selection.lastRange;\n let index = range && range.length === 0 ? range.index : undefined;\n modify.call(this, () => {\n return this.editor.update(null, mutations, index);\n }, source);\n });\n let contents = this.clipboard.convert(`
    ${html}


    `);\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n }\n\n addContainer(container, refNode = null) {\n if (typeof container === 'string') {\n let className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1*length);\n }\n\n disable() {\n this.enable(false);\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n let scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value, source = Emitter.sources.API) {\n return modify.call(this, () => {\n let range = this.getSelection(true);\n let change = new Delta();\n if (range == null) {\n return change;\n } else if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, { [name]: value });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, { [name]: value });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index, length = 0) {\n let bounds;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n let containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index = this.getSelection(true), length = 0) {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n } else {\n return this.editor.getFormat(index.index, index.length);\n }\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines(index = 0, length = Number.MAX_VALUE) {\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n } else {\n return this.scroll.lines(index, length);\n }\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection(focus = false) {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getText(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value, source = Quill.sources.API) {\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats;\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return !this.container.classList.contains('ql-disabled');\n }\n\n off() {\n return this.emitter.off.apply(this.emitter, arguments);\n }\n\n on() {\n return this.emitter.on.apply(this.emitter, arguments);\n }\n\n once() {\n return this.emitter.once.apply(this.emitter, arguments);\n }\n\n pasteHTML(index, html, source) {\n this.clipboard.dangerouslyPasteHTML(index, html, source);\n }\n\n removeFormat(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n let length = this.getLength();\n let deleted = this.editor.deleteText(0, length);\n let applied = this.editor.applyDelta(delta);\n let lastOp = applied.ops[applied.ops.length - 1];\n if (lastOp != null && typeof(lastOp.insert) === 'string' && lastOp.insert[lastOp.insert.length-1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n let ret = deleted.compose(applied);\n return ret;\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(index, length), source);\n if (source !== Emitter.sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text, source = Emitter.sources.API) {\n let delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source = Emitter.sources.USER) {\n let change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n return change;\n }\n\n updateContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n}\nQuill.DEFAULTS = {\n bounds: null,\n formats: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n scrollingContainer: null,\n strict: true,\n theme: 'default'\n};\nQuill.events = Emitter.events;\nQuill.sources = Emitter.sources;\n// eslint-disable-next-line no-undef\nQuill.version = typeof(QUILL_VERSION) === 'undefined' ? 'dev' : QUILL_VERSION;\n\nQuill.imports = {\n 'delta' : Delta,\n 'parchment' : Parchment,\n 'core/module' : Module,\n 'core/theme' : Theme\n};\n\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend(true, {\n container: container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true\n }\n }, userConfig);\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = Theme;\n } else {\n userConfig.theme = Quill.import(`themes/${userConfig.theme}`);\n if (userConfig.theme == null) {\n throw new Error(`Invalid theme ${userConfig.theme}. Did you register it?`);\n }\n }\n let themeConfig = extend(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(function(config) {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(function(module) {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n let moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n let moduleConfig = moduleNames.reduce(function(config, name) {\n let moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(`Cannot load ${name} module. Are you sure you registered it?`);\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (userConfig.modules != null && userConfig.modules.toolbar &&\n userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n userConfig = extend(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(function(key) {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(function(config, name) {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n }, {});\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === Emitter.sources.USER) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n let oldDelta = this.editor.delta;\n let change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n let args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value, value = name, name = length, length = index.length, index = index.index;\n } else {\n length = index.length, index = index.index;\n }\n } else if (typeof length !== 'number') {\n source = value, value = name, name = length, length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start, end;\n if (index instanceof Delta) {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n return index.transformPosition(pos, source !== Emitter.sources.USER);\n });\n } else {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n if (pos < index || (pos === index && source === Emitter.sources.USER)) return pos;\n if (length >= 0) {\n return pos + length;\n } else {\n return Math.max(index, pos + length);\n }\n });\n }\n return new Range(start, end - start);\n}\n\n\nexport { expandConfig, overload, Quill as default };\n\n\n\n// WEBPACK FOOTER //\n// ./core/quill.js","class Module {\n constructor(quill, options = {}) {\n this.quill = quill;\n this.options = options;\n }\n}\nModule.DEFAULTS = {};\n\n\nexport default Module;\n\n\n\n// WEBPACK FOOTER //\n// ./core/module.js","import Parchment from 'parchment';\n\nclass TextBlot extends Parchment.Text { }\n\nexport default TextBlot;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/text.js","import EventEmitter from 'eventemitter3';\nimport logger from './logger';\n\nlet debug = logger('quill:events');\n\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach(function(eventName) {\n document.addEventListener(eventName, (...args) => {\n [].slice.call(document.querySelectorAll('.ql-container')).forEach((node) => {\n // TODO use WeakMap\n if (node.__quill && node.__quill.emitter) {\n node.__quill.emitter.handleDOM(...args);\n }\n });\n });\n});\n\n\nclass Emitter extends EventEmitter {\n constructor() {\n super();\n this.listeners = {};\n this.on('error', debug.error);\n }\n\n emit() {\n debug.log.apply(debug, arguments);\n super.emit.apply(this, arguments);\n }\n\n handleDOM(event, ...args) {\n (this.listeners[event.type] || []).forEach(function({ node, handler }) {\n if (event.target === node || node.contains(event.target)) {\n handler(event, ...args);\n }\n });\n }\n\n listenDOM(eventName, node, handler) {\n if (!this.listeners[eventName]) {\n this.listeners[eventName] = [];\n }\n this.listeners[eventName].push({ node, handler })\n }\n}\n\nEmitter.events = {\n EDITOR_CHANGE : 'editor-change',\n SCROLL_BEFORE_UPDATE : 'scroll-before-update',\n SCROLL_OPTIMIZE : 'scroll-optimize',\n SCROLL_UPDATE : 'scroll-update',\n SELECTION_CHANGE : 'selection-change',\n TEXT_CHANGE : 'text-change'\n};\nEmitter.sources = {\n API : 'api',\n SILENT : 'silent',\n USER : 'user'\n};\n\n\nexport default Emitter;\n\n\n\n// WEBPACK FOOTER //\n// ./core/emitter.js","let levels = ['error', 'warn', 'log', 'info'];\nlet level = 'warn';\n\nfunction debug(method, ...args) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method](...args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce(function(logger, method) {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\ndebug.level = namespace.level = function(newLevel) {\n level = newLevel;\n};\n\n\nexport default namespace;\n\n\n\n// WEBPACK FOOTER //\n// ./core/logger.js","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = require(\"../registry\");\nvar Attributor = /** @class */ (function () {\n function Attributor(attrName, keyName, options) {\n if (options === void 0) { options = {}; }\n this.attrName = attrName;\n this.keyName = keyName;\n var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n if (options.scope != null) {\n // Ignore type bits, force attribute bit\n this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n }\n else {\n this.scope = Registry.Scope.ATTRIBUTE;\n }\n if (options.whitelist != null)\n this.whitelist = options.whitelist;\n }\n Attributor.keys = function (node) {\n return [].map.call(node.attributes, function (item) {\n return item.name;\n });\n };\n Attributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.setAttribute(this.keyName, value);\n return true;\n };\n Attributor.prototype.canAdd = function (node, value) {\n var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n if (match == null)\n return false;\n if (this.whitelist == null)\n return true;\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n }\n else {\n return this.whitelist.indexOf(value) > -1;\n }\n };\n Attributor.prototype.remove = function (node) {\n node.removeAttribute(this.keyName);\n };\n Attributor.prototype.value = function (node) {\n var value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n };\n return Attributor;\n}());\nexports.default = Attributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/attributor/attributor.ts\n// module id = 11\n// module chunks = 0","var pSlice = Array.prototype.slice;\nvar objectKeys = require('./lib/keys.js');\nvar isArguments = require('./lib/is_arguments.js');\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n if (!opts) opts = {};\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected, opts);\n }\n}\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n}\n\nfunction objEquiv(a, b, opts) {\n var i, key;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n var ka = objectKeys(a),\n kb = objectKeys(b);\n } catch (e) {//happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) return false;\n }\n return typeof a === typeof b;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/deep-equal/index.js\n// module id = 12\n// module chunks = 0","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Inline from '../blots/inline';\nimport TextBlot from '../blots/text';\n\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\n\nclass CodeBlock extends Block {\n static create(value) {\n let domNode = super.create(value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n\n static formats() {\n return true;\n }\n\n delta() {\n let text = this.domNode.textContent;\n if (text.endsWith('\\n')) { // Should always be true\n text = text.slice(0, -1);\n }\n return text.split('\\n').reduce((delta, frag) => {\n return delta.insert(frag).insert('\\n', this.formats());\n }, new Delta());\n }\n\n format(name, value) {\n if (name === this.statics.blotName && value) return;\n let [text, ] = this.descendant(TextBlot, this.length() - 1);\n if (text != null) {\n text.deleteAt(text.length() - 1, 1);\n }\n super.format(name, value);\n }\n\n formatAt(index, length, name, value) {\n if (length === 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK) == null ||\n (name === this.statics.blotName && value === this.statics.formats(this.domNode))) {\n return;\n }\n let nextNewline = this.newlineIndex(index);\n if (nextNewline < 0 || nextNewline >= index + length) return;\n let prevNewline = this.newlineIndex(index, true) + 1;\n let isolateLength = nextNewline - prevNewline + 1;\n let blot = this.isolate(prevNewline, isolateLength);\n let next = blot.next;\n blot.format(name, value);\n if (next instanceof CodeBlock) {\n next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n }\n }\n\n insertAt(index, value, def) {\n if (def != null) return;\n let [text, offset] = this.descendant(TextBlot, index);\n text.insertAt(offset, value);\n }\n\n length() {\n let length = this.domNode.textContent.length;\n if (!this.domNode.textContent.endsWith('\\n')) {\n return length + 1;\n }\n return length;\n }\n\n newlineIndex(searchIndex, reverse = false) {\n if (!reverse) {\n let offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n return offset > -1 ? searchIndex + offset : -1;\n } else {\n return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n }\n }\n\n optimize(context) {\n if (!this.domNode.textContent.endsWith('\\n')) {\n this.appendChild(Parchment.create('text', '\\n'));\n }\n super.optimize(context);\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n next.optimize(context);\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n super.replace(target);\n [].slice.call(this.domNode.querySelectorAll('*')).forEach(function(node) {\n let blot = Parchment.find(node);\n if (blot == null) {\n node.parentNode.removeChild(node);\n } else if (blot instanceof Parchment.Embed) {\n blot.remove();\n } else {\n blot.unwrap();\n }\n });\n }\n}\nCodeBlock.blotName = 'code-block';\nCodeBlock.tagName = 'PRE';\nCodeBlock.TAB = ' ';\n\n\nexport { Code, CodeBlock as default };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/code.js","import Parchment from 'parchment';\n\n\nclass Break extends Parchment.Embed {\n static value() {\n return undefined;\n }\n\n insertInto(parent, ref) {\n if (parent.children.length === 0) {\n super.insertInto(parent, ref);\n } else {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\n\nexport default Break;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/break.js","import Inline from '../blots/inline';\n\n\nclass Link extends Inline {\n static create(value) {\n let node = super.create(value);\n value = this.sanitize(value);\n node.setAttribute('href', value);\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n\n format(name, value) {\n if (name !== this.statics.blotName || !value) return super.format(name, value);\n value = this.constructor.sanitize(value);\n this.domNode.setAttribute('href', value);\n }\n}\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\nLink.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];\n\n\nfunction sanitize(url, protocols) {\n let anchor = document.createElement('a');\n anchor.href = url;\n let protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\n\nexport { Link as default, sanitize };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/link.js","import Keyboard from '../modules/keyboard';\nimport DropdownIcon from '../assets/icons/dropdown.svg';\n\nlet optionsCounter = 0;\n\nfunction toggleAriaAttribute(element, attribute) {\n element.setAttribute(attribute, !(element.getAttribute(attribute) === 'true'));\n}\n\nclass Picker {\n constructor(select) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n this.select.parentNode.insertBefore(this.container, this.select);\n\n this.label.addEventListener('mousedown', () => {\n this.togglePicker();\n });\n this.label.addEventListener('keydown', (event) => {\n switch(event.keyCode) {\n // Allows the \"Enter\" key to open the picker\n case Keyboard.keys.ENTER:\n this.togglePicker();\n break;\n\n // Allows the \"Escape\" key to close the picker\n case Keyboard.keys.ESCAPE:\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n\n buildItem(option) {\n let item = document.createElement('span');\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n\n item.classList.add('ql-picker-item');\n if (option.hasAttribute('value')) {\n item.setAttribute('data-value', option.getAttribute('value'));\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n item.addEventListener('keydown', (event) => {\n switch(event.keyCode) {\n // Allows the \"Enter\" key to select an item\n case Keyboard.keys.ENTER:\n this.selectItem(item, true);\n event.preventDefault();\n break;\n\n // Allows the \"Escape\" key to close the picker\n case Keyboard.keys.ESCAPE:\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n\n return item;\n }\n\n buildLabel() {\n let label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = DropdownIcon;\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n\n buildOptions() {\n let options = document.createElement('span');\n options.classList.add('ql-picker-options');\n\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n options.tabIndex = '-1';\n\n // Need a unique id for aria-controls\n options.id = `ql-picker-options-${optionsCounter}`;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n\n this.options = options;\n\n [].slice.call(this.select.options).forEach((option) => {\n let item = this.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n\n buildPicker() {\n [].slice.call(this.select.attributes).forEach((item) => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n\n escape() {\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(() => this.label.focus(), 1);\n }\n\n close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n this.options.setAttribute('aria-hidden', 'true');\n }\n\n selectItem(item, trigger = false) {\n let selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);\n if (item.hasAttribute('data-value')) {\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n if (typeof Event === 'function') {\n this.select.dispatchEvent(new Event('change'));\n } else if (typeof Event === 'object') { // IE11\n let event = document.createEvent('Event');\n event.initEvent('change', true, true);\n this.select.dispatchEvent(event);\n }\n this.close();\n }\n }\n\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n let item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex];\n option = this.select.options[this.select.selectedIndex];\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n let isActive = option != null && option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n\n\nexport default Picker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/picker.js","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar linked_list_1 = require(\"../../collection/linked-list\");\nvar shadow_1 = require(\"./shadow\");\nvar Registry = require(\"../../registry\");\nvar ContainerBlot = /** @class */ (function (_super) {\n __extends(ContainerBlot, _super);\n function ContainerBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.build();\n return _this;\n }\n ContainerBlot.prototype.appendChild = function (other) {\n this.insertBefore(other);\n };\n ContainerBlot.prototype.attach = function () {\n _super.prototype.attach.call(this);\n this.children.forEach(function (child) {\n child.attach();\n });\n };\n ContainerBlot.prototype.build = function () {\n var _this = this;\n this.children = new linked_list_1.default();\n // Need to be reversed for if DOM nodes already in order\n [].slice\n .call(this.domNode.childNodes)\n .reverse()\n .forEach(function (node) {\n try {\n var child = makeBlot(node);\n _this.insertBefore(child, _this.children.head || undefined);\n }\n catch (err) {\n if (err instanceof Registry.ParchmentError)\n return;\n else\n throw err;\n }\n });\n };\n ContainerBlot.prototype.deleteAt = function (index, length) {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.deleteAt(offset, length);\n });\n };\n ContainerBlot.prototype.descendant = function (criteria, index) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n return [child, offset];\n }\n else if (child instanceof ContainerBlot) {\n return child.descendant(criteria, offset);\n }\n else {\n return [null, -1];\n }\n };\n ContainerBlot.prototype.descendants = function (criteria, index, length) {\n if (index === void 0) { index = 0; }\n if (length === void 0) { length = Number.MAX_VALUE; }\n var descendants = [];\n var lengthLeft = length;\n this.children.forEachAt(index, length, function (child, index, length) {\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n descendants.push(child);\n }\n if (child instanceof ContainerBlot) {\n descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return descendants;\n };\n ContainerBlot.prototype.detach = function () {\n this.children.forEach(function (child) {\n child.detach();\n });\n _super.prototype.detach.call(this);\n };\n ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.formatAt(offset, length, name, value);\n });\n };\n ContainerBlot.prototype.insertAt = function (index, value, def) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if (child) {\n child.insertAt(offset, value, def);\n }\n else {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n this.appendChild(blot);\n }\n };\n ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n if (this.statics.allowedChildren != null &&\n !this.statics.allowedChildren.some(function (child) {\n return childBlot instanceof child;\n })) {\n throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n }\n childBlot.insertInto(this, refBlot);\n };\n ContainerBlot.prototype.length = function () {\n return this.children.reduce(function (memo, child) {\n return memo + child.length();\n }, 0);\n };\n ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n this.children.forEach(function (child) {\n targetParent.insertBefore(child, refNode);\n });\n };\n ContainerBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n var child = Registry.create(this.statics.defaultChild);\n this.appendChild(child);\n child.optimize(context);\n }\n else {\n this.remove();\n }\n }\n };\n ContainerBlot.prototype.path = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n var position = [[this, index]];\n if (child instanceof ContainerBlot) {\n return position.concat(child.path(offset, inclusive));\n }\n else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n };\n ContainerBlot.prototype.removeChild = function (child) {\n this.children.remove(child);\n };\n ContainerBlot.prototype.replace = function (target) {\n if (target instanceof ContainerBlot) {\n target.moveChildren(this);\n }\n _super.prototype.replace.call(this, target);\n };\n ContainerBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = this.clone();\n this.parent.insertBefore(after, this.next);\n this.children.forEachAt(index, this.length(), function (child, offset, length) {\n child = child.split(offset, force);\n after.appendChild(child);\n });\n return after;\n };\n ContainerBlot.prototype.unwrap = function () {\n this.moveChildren(this.parent, this.next);\n this.remove();\n };\n ContainerBlot.prototype.update = function (mutations, context) {\n var _this = this;\n var addedNodes = [];\n var removedNodes = [];\n mutations.forEach(function (mutation) {\n if (mutation.target === _this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach(function (node) {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (node.parentNode != null &&\n // @ts-ignore\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return;\n }\n var blot = Registry.find(node);\n if (blot == null)\n return;\n if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n blot.detach();\n }\n });\n addedNodes\n .filter(function (node) {\n return node.parentNode == _this.domNode;\n })\n .sort(function (a, b) {\n if (a === b)\n return 0;\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach(function (node) {\n var refBlot = null;\n if (node.nextSibling != null) {\n refBlot = Registry.find(node.nextSibling);\n }\n var blot = makeBlot(node);\n if (blot.next != refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(_this);\n }\n _this.insertBefore(blot, refBlot || undefined);\n }\n });\n };\n return ContainerBlot;\n}(shadow_1.default));\nfunction makeBlot(node) {\n var blot = Registry.find(node);\n if (blot == null) {\n try {\n blot = Registry.create(node);\n }\n catch (e) {\n blot = Registry.create(Registry.Scope.INLINE);\n [].slice.call(node.childNodes).forEach(function (child) {\n // @ts-ignore\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n }\n }\n return blot;\n}\nexports.default = ContainerBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/abstract/container.ts\n// module id = 17\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"../../attributor/attributor\");\nvar store_1 = require(\"../../attributor/store\");\nvar container_1 = require(\"./container\");\nvar Registry = require(\"../../registry\");\nvar FormatBlot = /** @class */ (function (_super) {\n __extends(FormatBlot, _super);\n function FormatBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.attributes = new store_1.default(_this.domNode);\n return _this;\n }\n FormatBlot.formats = function (domNode) {\n if (typeof this.tagName === 'string') {\n return true;\n }\n else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n };\n FormatBlot.prototype.format = function (name, value) {\n var format = Registry.query(name);\n if (format instanceof attributor_1.default) {\n this.attributes.attribute(format, value);\n }\n else if (value) {\n if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n this.replaceWith(name, value);\n }\n }\n };\n FormatBlot.prototype.formats = function () {\n var formats = this.attributes.values();\n var format = this.statics.formats(this.domNode);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n };\n FormatBlot.prototype.replaceWith = function (name, value) {\n var replacement = _super.prototype.replaceWith.call(this, name, value);\n this.attributes.copy(replacement);\n return replacement;\n };\n FormatBlot.prototype.update = function (mutations, context) {\n var _this = this;\n _super.prototype.update.call(this, mutations, context);\n if (mutations.some(function (mutation) {\n return mutation.target === _this.domNode && mutation.type === 'attributes';\n })) {\n this.attributes.build();\n }\n };\n FormatBlot.prototype.wrap = function (name, value) {\n var wrapper = _super.prototype.wrap.call(this, name, value);\n if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n };\n return FormatBlot;\n}(container_1.default));\nexports.default = FormatBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/abstract/format.ts\n// module id = 18\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar shadow_1 = require(\"./shadow\");\nvar Registry = require(\"../../registry\");\nvar LeafBlot = /** @class */ (function (_super) {\n __extends(LeafBlot, _super);\n function LeafBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LeafBlot.value = function (domNode) {\n return true;\n };\n LeafBlot.prototype.index = function (node, offset) {\n if (this.domNode === node ||\n this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return Math.min(offset, 1);\n }\n return -1;\n };\n LeafBlot.prototype.position = function (index, inclusive) {\n var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n if (index > 0)\n offset += 1;\n return [this.parent.domNode, offset];\n };\n LeafBlot.prototype.value = function () {\n return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;\n var _a;\n };\n LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n return LeafBlot;\n}(shadow_1.default));\nexports.default = LeafBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/abstract/leaf.ts\n// module id = 19\n// module chunks = 0","var equal = require('deep-equal');\nvar extend = require('extend');\n\n\nvar lib = {\n attributes: {\n compose: function (a, b, keepNull) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = extend(true, {}, b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce(function (copy, key) {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (var key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n diff: function(a, b) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {\n if (!equal(a[key], b[key])) {\n attributes[key] = b[key] === undefined ? null : b[key];\n }\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n transform: function (a, b, priority) {\n if (typeof a !== 'object') return b;\n if (typeof b !== 'object') return undefined;\n if (!priority) return b; // b simply overwrites us without priority\n var attributes = Object.keys(b).reduce(function (attributes, key) {\n if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n },\n\n iterator: function (ops) {\n return new Iterator(ops);\n },\n\n length: function (op) {\n if (typeof op['delete'] === 'number') {\n return op['delete'];\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n};\n\n\nfunction Iterator(ops) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n};\n\nIterator.prototype.hasNext = function () {\n return this.peekLength() < Infinity;\n};\n\nIterator.prototype.next = function (length) {\n if (!length) length = Infinity;\n var nextOp = this.ops[this.index];\n if (nextOp) {\n var offset = this.offset;\n var opLength = lib.length(nextOp)\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp['delete'] === 'number') {\n return { 'delete': length };\n } else {\n var retOp = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n};\n\nIterator.prototype.peek = function () {\n return this.ops[this.index];\n};\n\nIterator.prototype.peekLength = function () {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return lib.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n};\n\nIterator.prototype.peekType = function () {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index]['delete'] === 'number') {\n return 'delete';\n } else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n};\n\n\nmodule.exports = lib;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/quill-delta/lib/op.js\n// module id = 20\n// module chunks = 0","var clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/clone/clone.js\n// module id = 21\n// module chunks = 0","import Parchment from 'parchment';\nimport clone from 'clone';\nimport equal from 'deep-equal';\nimport Emitter from './emitter';\nimport logger from './logger';\n\nlet debug = logger('quill:selection');\n\n\nclass Range {\n constructor(index, length = 0) {\n this.index = index;\n this.length = length;\n }\n}\n\n\nclass Selection {\n constructor(scroll, emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n this.cursor = Parchment.create('cursor', this);\n // savedRange is last non-null range\n this.lastRange = this.savedRange = new Range(0, 0);\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown) {\n setTimeout(this.update.bind(this, Emitter.sources.USER), 1);\n }\n });\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type, delta) => {\n if (type === Emitter.events.TEXT_CHANGE && delta.length() > 0) {\n this.update(Emitter.sources.SILENT);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, () => {\n if (!this.hasFocus()) return;\n let native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n // TODO unclear if this has negative side effects\n this.emitter.once(Emitter.events.SCROLL_UPDATE, () => {\n try {\n this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);\n } catch (ignored) {}\n });\n });\n this.emitter.on(Emitter.events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const { startNode, startOffset, endNode, endOffset } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n }\n });\n this.update(Emitter.sources.SILENT);\n }\n\n handleComposition() {\n this.root.addEventListener('compositionstart', () => {\n this.composing = true;\n });\n this.root.addEventListener('compositionend', () => {\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);\n }, 1);\n }\n });\n }\n\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(Emitter.sources.USER);\n });\n }\n\n focus() {\n if (this.hasFocus()) return;\n this.root.focus();\n this.setRange(this.savedRange);\n }\n\n format(format, value) {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[format]) return;\n this.scroll.update();\n let nativeRange = this.getNativeRange();\n if (nativeRange == null || !nativeRange.native.collapsed || Parchment.query(format, Parchment.Scope.BLOCK)) return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n let blot = Parchment.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof Parchment.Leaf) {\n let after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index, length = 0) {\n let scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node, [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n let range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n } else {\n let side = 'left';\n let rect;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0\n };\n }\n }\n\n getNativeRange() {\n let selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n let nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n let range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange() {\n let normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n let range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n\n hasFocus() {\n return document.activeElement === this.root;\n }\n\n normalizedToRange(range) {\n let positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n let indexes = positions.map((position) => {\n let [node, offset] = position;\n let blot = Parchment.find(node, true);\n let index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n } else if (blot instanceof Parchment.Container) {\n return index + blot.length();\n } else {\n return index + blot.index(node, offset);\n }\n });\n let end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n let start = Math.min(end, ...indexes);\n return new Range(start, end-start);\n }\n\n normalizeNative(nativeRange) {\n if (!contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))) {\n return null;\n }\n let range = {\n start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange\n };\n [range.start, range.end].forEach(function(position) {\n let node = position.node, offset = position.offset;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n } else {\n break;\n }\n }\n position.node = node, position.offset = offset;\n });\n return range;\n }\n\n rangeToNative(range) {\n let indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n let args = [];\n let scrollLength = this.scroll.length();\n indexes.forEach((index, i) => {\n index = Math.min(scrollLength - 1, index);\n let node, [leaf, offset] = this.scroll.leaf(index);\n [node, offset] = leaf.position(offset, i !== 0);\n args.push(node, offset);\n });\n if (args.length < 2) {\n args = args.concat(args);\n }\n return args;\n }\n\n scrollIntoView(scrollingContainer) {\n let range = this.lastRange;\n if (range == null) return;\n let bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n let limit = this.scroll.length()-1;\n let [first, ] = this.scroll.line(Math.min(range.index, limit));\n let last = first;\n if (range.length > 0) {\n [last, ] = this.scroll.line(Math.min(range.index + range.length, limit));\n }\n if (first == null || last == null) return;\n let scrollBounds = scrollingContainer.getBoundingClientRect();\n if (bounds.top < scrollBounds.top) {\n scrollingContainer.scrollTop -= (scrollBounds.top - bounds.top);\n } else if (bounds.bottom > scrollBounds.bottom) {\n scrollingContainer.scrollTop += (bounds.bottom - scrollBounds.bottom);\n }\n }\n\n setNativeRange(startNode, startOffset, endNode = startNode, endOffset = startOffset, force = false) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n return;\n }\n let selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n let native = (this.getNativeRange() || {}).native;\n if (native == null || force ||\n startNode !== native.startContainer ||\n startOffset !== native.startOffset ||\n endNode !== native.endContainer ||\n endOffset !== native.endOffset) {\n\n if (startNode.tagName == \"BR\") {\n startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);\n startNode = startNode.parentNode;\n }\n if (endNode.tagName == \"BR\") {\n endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);\n endNode = endNode.parentNode;\n }\n let range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n }\n }\n\n setRange(range, force = false, source = Emitter.sources.API) {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n let args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source = Emitter.sources.USER) {\n let oldRange = this.lastRange;\n let [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!equal(oldRange, this.lastRange)) {\n if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n this.cursor.restore();\n }\n let args = [Emitter.events.SELECTION_CHANGE, clone(this.lastRange), clone(oldRange), source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode;\n } catch (e) {\n return false;\n }\n // IE11 has bug with Text nodes\n // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n if (descendant instanceof Text) {\n descendant = descendant.parentNode;\n }\n return parent.contains(descendant);\n}\n\n\nexport { Range, Selection as default };\n\n\n\n// WEBPACK FOOTER //\n// ./core/selection.js","import Parchment from 'parchment';\nimport Block, { BlockEmbed } from './block';\n\n\nclass Container extends Parchment.Container { }\nContainer.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Container;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/container.js","import Parchment from 'parchment';\n\nclass ColorAttributor extends Parchment.Attributor.Style {\n value(domNode) {\n let value = super.value(domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n return '#' + value.split(',').map(function(component) {\n return ('00' + parseInt(component).toString(16)).slice(-2);\n }).join('');\n }\n}\n\nlet ColorClass = new Parchment.Attributor.Class('color', 'ql-color', {\n scope: Parchment.Scope.INLINE\n});\nlet ColorStyle = new ColorAttributor('color', 'color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/color.js","import clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\nimport Delta from 'quill-delta';\nimport DeltaOp from 'quill-delta/lib/op';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nlet debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\n\nclass Keyboard extends Module {\n static match(evt, binding) {\n binding = normalize(binding);\n if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function(key) {\n return (!!binding[key] !== evt[key] && binding[key] !== null);\n })) {\n return false;\n }\n return binding.key === (evt.which || evt.keyCode);\n }\n\n constructor(quill, options) {\n super(quill, options);\n this.bindings = {};\n Object.keys(this.options.bindings).forEach((name) => {\n if (name === 'list autofill' &&\n quill.scroll.whitelist != null &&\n !quill.scroll.whitelist['list']) {\n return;\n }\n if (this.options.bindings[name]) {\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function() {});\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete);\n } else {\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);\n }\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null },\n { collapsed: true, offset: 0 },\n handleBackspace);\n this.listen();\n }\n\n addBinding(key, context = {}, handler = {}) {\n let binding = normalize(key);\n if (binding == null || binding.key == null) {\n return debug.warn('Attempted to add invalid keyboard binding', binding);\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler: handler };\n }\n binding = extend(binding, context, handler);\n this.bindings[binding.key] = this.bindings[binding.key] || [];\n this.bindings[binding.key].push(binding);\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', (evt) => {\n if (evt.defaultPrevented) return;\n let which = evt.which || evt.keyCode;\n let bindings = (this.bindings[which] || []).filter(function(binding) {\n return Keyboard.match(evt, binding);\n });\n if (bindings.length === 0) return;\n let range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n let [line, offset] = this.quill.getLine(range.index);\n let [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n let [leafEnd, offsetEnd] = range.length === 0 ? [leafStart, offsetStart] : this.quill.getLeaf(range.index + range.length);\n let prefixText = leafStart instanceof Parchment.Text ? leafStart.value().slice(0, offsetStart) : '';\n let suffixText = leafEnd instanceof Parchment.Text ? leafEnd.value().slice(offsetEnd) : '';\n let curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n offset: offset,\n prefix: prefixText,\n suffix: suffixText\n };\n let prevented = bindings.some((binding) => {\n if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n if (binding.empty != null && binding.empty !== curContext.empty) return false;\n if (binding.offset != null && binding.offset !== curContext.offset) return false;\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(function(name) {\n return curContext.format[name] == null;\n })) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (!Object.keys(binding.format).every(function(name) {\n if (binding.format[name] === true) return curContext.format[name] != null;\n if (binding.format[name] === false) return curContext.format[name] == null;\n return equal(binding.format[name], curContext.format[name]);\n })) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n return binding.handler.call(this, range, curContext) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n}\n\nKeyboard.keys = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n DELETE: 46\n};\n\nKeyboard.DEFAULTS = {\n bindings: {\n 'bold' : makeFormatHandler('bold'),\n 'italic' : makeFormatHandler('italic'),\n 'underline' : makeFormatHandler('underline'),\n 'indent': {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: Keyboard.keys.TAB,\n format: ['blockquote', 'indent', 'list'],\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n }\n },\n 'outdent': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n }\n },\n 'outdent backspace': {\n key: Keyboard.keys.BACKSPACE,\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler: function(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n }\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler: function(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n }\n },\n 'tab': {\n key: Keyboard.keys.TAB,\n handler: function(range) {\n this.quill.history.cutoff();\n let delta = new Delta().retain(range.index)\n .delete(range.length)\n .insert('\\t');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n }\n },\n 'list empty enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['list'],\n empty: true,\n handler: function(range, context) {\n this.quill.format('list', false, Quill.sources.USER);\n if (context.format.indent) {\n this.quill.format('indent', false, Quill.sources.USER);\n }\n }\n },\n 'checklist enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: { list: 'checked' },\n handler: function(range) {\n let [line, offset] = this.quill.getLine(range.index);\n let formats = extend({}, line.formats(), { list: 'checked' });\n let delta = new Delta().retain(range.index)\n .insert('\\n', formats)\n .retain(line.length() - offset - 1)\n .retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'header enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler: function(range, context) {\n let [line, offset] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index)\n .insert('\\n', context.format)\n .retain(line.length() - offset - 1)\n .retain(1, { header: null });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'list autofill': {\n key: ' ',\n collapsed: true,\n format: { list: false },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler: function(range, context) {\n let length = context.prefix.length;\n let [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]': case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-': case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', Quill.sources.USER);\n this.quill.history.cutoff();\n let delta = new Delta().retain(range.index - offset)\n .delete(length + 1)\n .retain(line.length() - 2 - offset)\n .retain(1, { list: value });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n }\n },\n 'code exit': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['code-block'],\n prefix: /\\n\\n$/,\n suffix: /^\\s+$/,\n handler: function(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new Delta()\n .retain(range.index + line.length() - offset - 2)\n .retain(1, { 'code-block': null })\n .delete(1);\n this.quill.updateContents(delta, Quill.sources.USER);\n }\n },\n 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false),\n 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true),\n 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),\n 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)\n }\n};\n\nfunction makeEmbedArrowHandler(key, shiftKey) {\n const where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler: function(range) {\n let index = range.index;\n if (key === Keyboard.keys.RIGHT) {\n index += (range.length + 1);\n }\n const [leaf, ] = this.quill.getLeaf(index);\n if (!(leaf instanceof Parchment.Embed)) return true;\n if (key === Keyboard.keys.LEFT) {\n if (shiftKey) {\n this.quill.setSelection(range.index - 1, range.length + 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(range.index - 1, Quill.sources.USER);\n }\n } else {\n if (shiftKey) {\n this.quill.setSelection(range.index, range.length + 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(range.index + range.length + 1, Quill.sources.USER);\n }\n }\n return false;\n }\n };\n}\n\n\nfunction handleBackspace(range, context) {\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let [line, ] = this.quill.getLine(range.index);\n let formats = {};\n if (context.offset === 0) {\n let [prev, ] = this.quill.getLine(range.index - 1);\n if (prev != null && prev.length() > 1) {\n let curFormats = line.formats();\n let prevFormats = this.quill.getFormat(range.index-1, 1);\n formats = DeltaOp.attributes.diff(curFormats, prevFormats) || {};\n }\n }\n // Check for astral symbols\n let length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix) ? 2 : 1;\n this.quill.deleteText(range.index-length, length, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index-length, length, formats, Quill.sources.USER);\n }\n this.quill.focus();\n}\n\nfunction handleDelete(range, context) {\n // Check for astral symbols\n let length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix) ? 2 : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {}, nextLength = 0;\n let [line, ] = this.quill.getLine(range.index);\n if (context.offset >= line.length() - 1) {\n let [next, ] = this.quill.getLine(range.index + 1);\n if (next) {\n let curFormats = line.formats();\n let nextFormats = this.quill.getFormat(range.index, 1);\n formats = DeltaOp.attributes.diff(curFormats, nextFormats) || {};\n nextLength = next.length();\n }\n }\n this.quill.deleteText(range.index, length, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index + nextLength - 1, length, formats, Quill.sources.USER);\n }\n}\n\nfunction handleDeleteRange(range) {\n let lines = this.quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n let firstFormats = lines[0].formats();\n let lastFormats = lines[lines.length - 1].formats();\n formats = DeltaOp.attributes.diff(lastFormats, firstFormats) || {};\n }\n this.quill.deleteText(range, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index, 1, formats, Quill.sources.USER);\n }\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.quill.focus();\n}\n\nfunction handleEnter(range, context) {\n if (range.length > 0) {\n this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n }\n let lineFormats = Object.keys(context.format).reduce(function(lineFormats, format) {\n if (Parchment.query(format, Parchment.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n lineFormats[format] = context.format[format];\n }\n return lineFormats;\n }, {});\n this.quill.insertText(range.index, '\\n', lineFormats, Quill.sources.USER);\n // Earlier scroll.deleteAt might have messed up our selection,\n // so insertText's built in selection preservation is not reliable\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.focus();\n Object.keys(context.format).forEach((name) => {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'link') return;\n this.quill.format(name, context.format[name], Quill.sources.USER);\n });\n}\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: Keyboard.keys.TAB,\n shiftKey: !indent,\n format: {'code-block': true },\n handler: function(range) {\n let CodeBlock = Parchment.query('code-block');\n let index = range.index, length = range.length;\n let [block, offset] = this.quill.scroll.descendant(CodeBlock, index);\n if (block == null) return;\n let scrollIndex = this.quill.getIndex(block);\n let start = block.newlineIndex(offset, true) + 1;\n let end = block.newlineIndex(scrollIndex + offset + length);\n let lines = block.domNode.textContent.slice(start, end).split('\\n');\n offset = 0;\n lines.forEach((line, i) => {\n if (indent) {\n block.insertAt(start + offset, CodeBlock.TAB);\n offset += CodeBlock.TAB.length;\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.startsWith(CodeBlock.TAB)) {\n block.deleteAt(start + offset, CodeBlock.TAB.length);\n offset -= CodeBlock.TAB.length;\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n offset += line.length + 1;\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n }\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0].toUpperCase(),\n shortKey: true,\n handler: function(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n }\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n return normalize({ key: binding });\n }\n if (typeof binding === 'object') {\n binding = clone(binding, false);\n }\n if (typeof binding.key === 'string') {\n if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n binding.key = Keyboard.keys[binding.key.toUpperCase()];\n } else if (binding.key.length === 1) {\n binding.key = binding.key.toUpperCase().charCodeAt(0);\n } else {\n return null;\n }\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\n\nexport { Keyboard as default, SHORTKEY };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/keyboard.js","module.exports = {\n 'align': {\n '' : require('../assets/icons/align-left.svg'),\n 'center' : require('../assets/icons/align-center.svg'),\n 'right' : require('../assets/icons/align-right.svg'),\n 'justify' : require('../assets/icons/align-justify.svg')\n },\n 'background': require('../assets/icons/background.svg'),\n 'blockquote': require('../assets/icons/blockquote.svg'),\n 'bold' : require('../assets/icons/bold.svg'),\n 'clean' : require('../assets/icons/clean.svg'),\n 'code' : require('../assets/icons/code.svg'),\n 'code-block': require('../assets/icons/code.svg'),\n 'color' : require('../assets/icons/color.svg'),\n 'direction' : {\n '' : require('../assets/icons/direction-ltr.svg'),\n 'rtl' : require('../assets/icons/direction-rtl.svg')\n },\n 'float': {\n 'center' : require('../assets/icons/float-center.svg'),\n 'full' : require('../assets/icons/float-full.svg'),\n 'left' : require('../assets/icons/float-left.svg'),\n 'right' : require('../assets/icons/float-right.svg')\n },\n 'formula' : require('../assets/icons/formula.svg'),\n 'header': {\n '1' : require('../assets/icons/header.svg'),\n '2' : require('../assets/icons/header-2.svg')\n },\n 'italic' : require('../assets/icons/italic.svg'),\n 'image' : require('../assets/icons/image.svg'),\n 'indent': {\n '+1' : require('../assets/icons/indent.svg'),\n '-1' : require('../assets/icons/outdent.svg')\n },\n 'link' : require('../assets/icons/link.svg'),\n 'list': {\n 'ordered' : require('../assets/icons/list-ordered.svg'),\n 'bullet' : require('../assets/icons/list-bullet.svg'),\n 'check' : require('../assets/icons/list-check.svg')\n },\n 'script': {\n 'sub' : require('../assets/icons/subscript.svg'),\n 'super' : require('../assets/icons/superscript.svg'),\n },\n 'strike' : require('../assets/icons/strike.svg'),\n 'underline' : require('../assets/icons/underline.svg'),\n 'video' : require('../assets/icons/video.svg')\n};\n\n\n\n// WEBPACK FOOTER //\n// ./ui/icons.js","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = require(\"../../registry\");\nvar ShadowBlot = /** @class */ (function () {\n function ShadowBlot(domNode) {\n this.domNode = domNode;\n // @ts-ignore\n this.domNode[Registry.DATA_KEY] = { blot: this };\n }\n Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n // Hack for accessing inherited static methods\n get: function () {\n return this.constructor;\n },\n enumerable: true,\n configurable: true\n });\n ShadowBlot.create = function (value) {\n if (this.tagName == null) {\n throw new Registry.ParchmentError('Blot definition missing tagName');\n }\n var node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value).toString() === value) {\n value = parseInt(value);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n }\n else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n }\n else {\n node = document.createElement(this.tagName[0]);\n }\n }\n else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n };\n ShadowBlot.prototype.attach = function () {\n if (this.parent != null) {\n this.scroll = this.parent.scroll;\n }\n };\n ShadowBlot.prototype.clone = function () {\n var domNode = this.domNode.cloneNode(false);\n return Registry.create(domNode);\n };\n ShadowBlot.prototype.detach = function () {\n if (this.parent != null)\n this.parent.removeChild(this);\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY];\n };\n ShadowBlot.prototype.deleteAt = function (index, length) {\n var blot = this.isolate(index, length);\n blot.remove();\n };\n ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n var blot = this.isolate(index, length);\n if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n }\n else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n var parent = Registry.create(this.statics.scope);\n blot.wrap(parent);\n parent.format(name, value);\n }\n };\n ShadowBlot.prototype.insertAt = function (index, value, def) {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n var ref = this.split(index);\n this.parent.insertBefore(blot, ref);\n };\n ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n if (refBlot === void 0) { refBlot = null; }\n if (this.parent != null) {\n this.parent.children.remove(this);\n }\n var refDomNode = null;\n parentBlot.children.insertBefore(this, refBlot);\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (this.domNode.parentNode != parentBlot.domNode ||\n this.domNode.nextSibling != refDomNode) {\n parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n }\n this.parent = parentBlot;\n this.attach();\n };\n ShadowBlot.prototype.isolate = function (index, length) {\n var target = this.split(index);\n target.split(length);\n return target;\n };\n ShadowBlot.prototype.length = function () {\n return 1;\n };\n ShadowBlot.prototype.offset = function (root) {\n if (root === void 0) { root = this.parent; }\n if (this.parent == null || this == root)\n return 0;\n return this.parent.children.offset(this) + this.parent.offset(root);\n };\n ShadowBlot.prototype.optimize = function (context) {\n // TODO clean up once we use WeakMap\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY] != null) {\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY].mutations;\n }\n };\n ShadowBlot.prototype.remove = function () {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n };\n ShadowBlot.prototype.replace = function (target) {\n if (target.parent == null)\n return;\n target.parent.insertBefore(this, target.next);\n target.remove();\n };\n ShadowBlot.prototype.replaceWith = function (name, value) {\n var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n replacement.replace(this);\n return replacement;\n };\n ShadowBlot.prototype.split = function (index, force) {\n return index === 0 ? this : this.next;\n };\n ShadowBlot.prototype.update = function (mutations, context) {\n // Nothing to do by default\n };\n ShadowBlot.prototype.wrap = function (name, value) {\n var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next);\n }\n wrapper.appendChild(this);\n return wrapper;\n };\n ShadowBlot.blotName = 'abstract';\n return ShadowBlot;\n}());\nexports.default = ShadowBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/abstract/shadow.ts\n// module id = 27\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nvar class_1 = require(\"./class\");\nvar style_1 = require(\"./style\");\nvar Registry = require(\"../registry\");\nvar AttributorStore = /** @class */ (function () {\n function AttributorStore(domNode) {\n this.attributes = {};\n this.domNode = domNode;\n this.build();\n }\n AttributorStore.prototype.attribute = function (attribute, value) {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n }\n else {\n delete this.attributes[attribute.attrName];\n }\n }\n }\n else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n };\n AttributorStore.prototype.build = function () {\n var _this = this;\n this.attributes = {};\n var attributes = attributor_1.default.keys(this.domNode);\n var classes = class_1.default.keys(this.domNode);\n var styles = style_1.default.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(function (name) {\n var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n if (attr instanceof attributor_1.default) {\n _this.attributes[attr.attrName] = attr;\n }\n });\n };\n AttributorStore.prototype.copy = function (target) {\n var _this = this;\n Object.keys(this.attributes).forEach(function (key) {\n var value = _this.attributes[key].value(_this.domNode);\n target.format(key, value);\n });\n };\n AttributorStore.prototype.move = function (target) {\n var _this = this;\n this.copy(target);\n Object.keys(this.attributes).forEach(function (key) {\n _this.attributes[key].remove(_this.domNode);\n });\n this.attributes = {};\n };\n AttributorStore.prototype.values = function () {\n var _this = this;\n return Object.keys(this.attributes).reduce(function (attributes, name) {\n attributes[name] = _this.attributes[name].value(_this.domNode);\n return attributes;\n }, {});\n };\n return AttributorStore;\n}());\nexports.default = AttributorStore;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/attributor/store.ts\n// module id = 28\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nfunction match(node, prefix) {\n var className = node.getAttribute('class') || '';\n return className.split(/\\s+/).filter(function (name) {\n return name.indexOf(prefix + \"-\") === 0;\n });\n}\nvar ClassAttributor = /** @class */ (function (_super) {\n __extends(ClassAttributor, _super);\n function ClassAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ClassAttributor.keys = function (node) {\n return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n return name\n .split('-')\n .slice(0, -1)\n .join('-');\n });\n };\n ClassAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n this.remove(node);\n node.classList.add(this.keyName + \"-\" + value);\n return true;\n };\n ClassAttributor.prototype.remove = function (node) {\n var matches = match(node, this.keyName);\n matches.forEach(function (name) {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n };\n ClassAttributor.prototype.value = function (node) {\n var result = match(node, this.keyName)[0] || '';\n var value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n };\n return ClassAttributor;\n}(attributor_1.default));\nexports.default = ClassAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/attributor/class.ts\n// module id = 29\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nfunction camelize(name) {\n var parts = name.split('-');\n var rest = parts\n .slice(1)\n .map(function (part) {\n return part[0].toUpperCase() + part.slice(1);\n })\n .join('');\n return parts[0] + rest;\n}\nvar StyleAttributor = /** @class */ (function (_super) {\n __extends(StyleAttributor, _super);\n function StyleAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StyleAttributor.keys = function (node) {\n return (node.getAttribute('style') || '').split(';').map(function (value) {\n var arr = value.split(':');\n return arr[0].trim();\n });\n };\n StyleAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n // @ts-ignore\n node.style[camelize(this.keyName)] = value;\n return true;\n };\n StyleAttributor.prototype.remove = function (node) {\n // @ts-ignore\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n };\n StyleAttributor.prototype.value = function (node) {\n // @ts-ignore\n var value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n };\n return StyleAttributor;\n}(attributor_1.default));\nexports.default = StyleAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/attributor/style.ts\n// module id = 30\n// module chunks = 0","import Parchment from 'parchment';\nimport TextBlot from './text';\n\n\nclass Cursor extends Parchment.Embed {\n static value() {\n return undefined;\n }\n\n constructor(domNode, selection) {\n super(domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this._length = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name, value) {\n if (this._length !== 0) {\n return super.format(name, value);\n }\n let target = this, index = 0;\n while (target != null && target.statics.scope !== Parchment.Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this._length = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this._length = 0;\n }\n }\n\n index(node, offset) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this._length;\n }\n\n position() {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n this.parent = null;\n }\n\n restore() {\n if (this.selection.composing || this.parent == null) return;\n let textNode = this.textNode;\n let range = this.selection.getNativeRange();\n let restoreText, start, end;\n if (range != null && range.start.node === textNode && range.end.node === textNode) {\n [restoreText, start, end] = [textNode, range.start.offset, range.end.offset];\n }\n // Link format will insert text outside of anchor tag\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n if (this.textNode.data !== Cursor.CONTENTS) {\n let text = this.textNode.data.split(Cursor.CONTENTS).join('');\n if (this.next instanceof TextBlot) {\n restoreText = this.next.domNode;\n this.next.insertAt(0, text);\n this.textNode.data = Cursor.CONTENTS;\n } else {\n this.textNode.data = text;\n this.parent.insertBefore(Parchment.create(this.textNode), this);\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n }\n }\n this.remove();\n if (start != null) {\n [start, end] = [start, end].map(function(offset) {\n return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n });\n return {\n startNode: restoreText,\n startOffset: start,\n endNode: restoreText,\n endOffset: end\n };\n }\n }\n\n update(mutations, context) {\n if (mutations.some((mutation) => {\n return mutation.type === 'characterData' && mutation.target === this.textNode;\n })) {\n let range = this.restore();\n if (range) context.range = range;\n }\n }\n\n value() {\n return '';\n }\n}\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = \"\\uFEFF\"; // Zero width no break space\n\n\nexport default Cursor;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/cursor.js","class Theme {\n constructor(quill, options) {\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n init() {\n Object.keys(this.options.modules).forEach((name) => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name) {\n let moduleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n return this.modules[name];\n }\n}\nTheme.DEFAULTS = {\n modules: {}\n};\nTheme.themes = {\n 'default': Theme\n};\n\n\nexport default Theme;\n\n\n\n// WEBPACK FOOTER //\n// ./core/theme.js","import Parchment from 'parchment';\nimport TextBlot from './text';\n\nconst GUARD_TEXT = \"\\uFEFF\";\n\n\nclass Embed extends Parchment.Embed {\n constructor(node) {\n super(node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', false);\n [].slice.call(this.domNode.childNodes).forEach((childNode) => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node) {\n let range, textNode;\n let text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof TextBlot) {\n let prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(Parchment.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof TextBlot) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length\n }\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(Parchment.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations, context) {\n mutations.forEach((mutation) => {\n if (mutation.type === 'characterData' &&\n (mutation.target === this.leftGuard || mutation.target === this.rightGuard)) {\n let range = this.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n}\n\n\nexport default Embed;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/embed.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['right', 'center', 'justify']\n};\n\nlet AlignAttribute = new Parchment.Attributor.Attribute('align', 'align', config);\nlet AlignClass = new Parchment.Attributor.Class('align', 'ql-align', config);\nlet AlignStyle = new Parchment.Attributor.Style('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/align.js","import Parchment from 'parchment';\nimport { ColorAttributor } from './color';\n\nlet BackgroundClass = new Parchment.Attributor.Class('background', 'ql-bg', {\n scope: Parchment.Scope.INLINE\n});\nlet BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { BackgroundClass, BackgroundStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/background.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['rtl']\n};\n\nlet DirectionAttribute = new Parchment.Attributor.Attribute('direction', 'dir', config);\nlet DirectionClass = new Parchment.Attributor.Class('direction', 'ql-direction', config);\nlet DirectionStyle = new Parchment.Attributor.Style('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/direction.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.INLINE,\n whitelist: ['serif', 'monospace']\n};\n\nlet FontClass = new Parchment.Attributor.Class('font', 'ql-font', config);\n\nclass FontStyleAttributor extends Parchment.Attributor.Style {\n value(node) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nlet FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/font.js","import Parchment from 'parchment';\n\nlet SizeClass = new Parchment.Attributor.Class('size', 'ql-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['small', 'large', 'huge']\n});\nlet SizeStyle = new Parchment.Attributor.Style('size', 'font-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['10px', '18px', '32px']\n});\n\nexport { SizeClass, SizeStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/size.js","import Inline from '../blots/inline';\n\nclass Bold extends Inline {\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize(context) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexport default Bold;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/bold.js","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/code.svg\n// module id = 40\n// module chunks = 0","import Picker from './picker';\n\n\nclass ColorPicker extends Picker {\n constructor(select, label) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n [].slice.call(this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function(item) {\n item.classList.add('ql-primary');\n });\n }\n\n buildItem(option) {\n let item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n let colorLabel = this.label.querySelector('.ql-color-label');\n let value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n\n\nexport default ColorPicker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/color-picker.js","import Picker from './picker';\n\n\nclass IconPicker extends Picker {\n constructor(select, icons) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n [].forEach.call(this.container.querySelectorAll('.ql-picker-item'), (item) => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n });\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n item = item || this.defaultItem;\n this.label.innerHTML = item.innerHTML;\n }\n}\n\n\nexport default IconPicker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/icon-picker.js","class Tooltip {\n constructor(quill, boundsContainer) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (this.quill.root === this.quill.scrollingContainer) {\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = (-1*this.quill.root.scrollTop) + 'px';\n });\n }\n this.hide();\n }\n\n hide() {\n this.root.classList.add('ql-hidden');\n }\n\n position(reference) {\n let left = reference.left + reference.width/2 - this.root.offsetWidth/2;\n // root.scrollTop should be 0 if scrollContainer !== root\n let top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = left + 'px';\n this.root.style.top = top + 'px';\n this.root.classList.remove('ql-flip');\n let containerBounds = this.boundsContainer.getBoundingClientRect();\n let rootBounds = this.root.getBoundingClientRect();\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = (left + shift) + 'px';\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = (left + shift) + 'px';\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n let height = rootBounds.bottom - rootBounds.top;\n let verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = (top - verticalShift) + 'px';\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n\n\nexport default Tooltip;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/tooltip.js","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Emitter from '../core/emitter';\nimport Keyboard from '../modules/keyboard';\nimport Theme from '../core/theme';\nimport ColorPicker from '../ui/color-picker';\nimport IconPicker from '../ui/icon-picker';\nimport Picker from '../ui/picker';\nimport Tooltip from '../ui/tooltip';\n\n\nconst ALIGNS = [ false, 'center', 'right', 'justify' ];\n\nconst COLORS = [\n \"#000000\", \"#e60000\", \"#ff9900\", \"#ffff00\", \"#008a00\", \"#0066cc\", \"#9933ff\",\n \"#ffffff\", \"#facccc\", \"#ffebcc\", \"#ffffcc\", \"#cce8cc\", \"#cce0f5\", \"#ebd6ff\",\n \"#bbbbbb\", \"#f06666\", \"#ffc266\", \"#ffff66\", \"#66b966\", \"#66a3e0\", \"#c285ff\",\n \"#888888\", \"#a10000\", \"#b26b00\", \"#b2b200\", \"#006100\", \"#0047b2\", \"#6b24b2\",\n \"#444444\", \"#5c0000\", \"#663d00\", \"#666600\", \"#003700\", \"#002966\", \"#3d1466\"\n];\n\nconst FONTS = [ false, 'serif', 'monospace' ];\n\nconst HEADERS = [ '1', '2', '3', false ];\n\nconst SIZES = [ 'small', false, 'large', 'huge' ];\n\n\nclass BaseTheme extends Theme {\n constructor(quill, options) {\n super(quill, options);\n let listener = (e) => {\n if (!document.body.contains(quill.root)) {\n return document.body.removeEventListener('click', listener);\n }\n if (this.tooltip != null && !this.tooltip.root.contains(e.target) &&\n document.activeElement !== this.tooltip.textbox && !this.quill.hasFocus()) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach(function(picker) {\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n }\n\n addModule(name) {\n let module = super.addModule(name);\n if (name === 'toolbar') {\n this.extendToolbar(module);\n }\n return module;\n }\n\n buildButtons(buttons, icons) {\n buttons.forEach((button) => {\n let className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach((name) => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n button.innerHTML = icons[name][''] + icons[name]['rtl'];\n } else if (typeof icons[name] === 'string') {\n button.innerHTML = icons[name];\n } else {\n let value = button.value || '';\n if (value != null && icons[name][value]) {\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n\n buildPickers(selects, icons) {\n this.pickers = selects.map((select) => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n return new IconPicker(select, icons.align);\n } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {\n let format = select.classList.contains('ql-background') ? 'background' : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');\n }\n return new ColorPicker(select, icons[format]);\n } else {\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new Picker(select);\n }\n });\n let update = () => {\n this.pickers.forEach(function(picker) {\n picker.update();\n });\n };\n this.quill.on(Emitter.events.EDITOR_CHANGE, update);\n }\n}\nBaseTheme.DEFAULTS = extend(true, {}, Theme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula: function() {\n this.quill.theme.tooltip.edit('formula');\n },\n image: function() {\n let fileInput = this.container.querySelector('input.ql-image[type=file]');\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon');\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n if (fileInput.files != null && fileInput.files[0] != null) {\n let reader = new FileReader();\n reader.onload = (e) => {\n let range = this.quill.getSelection(true);\n this.quill.updateContents(new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ image: e.target.result })\n , Emitter.sources.USER);\n this.quill.setSelection(range.index + 1, Emitter.sources.SILENT);\n fileInput.value = \"\";\n }\n reader.readAsDataURL(fileInput.files[0]);\n }\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video: function() {\n this.quill.theme.tooltip.edit('video');\n }\n }\n }\n }\n});\n\n\nclass BaseTooltip extends Tooltip {\n constructor(quill, boundsContainer) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n\n listen() {\n this.textbox.addEventListener('keydown', (event) => {\n if (Keyboard.match(event, 'enter')) {\n this.save();\n event.preventDefault();\n } else if (Keyboard.match(event, 'escape')) {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n\n cancel() {\n this.hide();\n }\n\n edit(mode = 'link', preview = null) {\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n this.position(this.quill.getBounds(this.quill.selection.savedRange));\n this.textbox.select();\n this.textbox.setAttribute('placeholder', this.textbox.getAttribute(`data-${mode}`) || '');\n this.root.setAttribute('data-mode', mode);\n }\n\n restoreFocus() {\n let scrollTop = this.quill.scrollingContainer.scrollTop;\n this.quill.focus();\n this.quill.scrollingContainer.scrollTop = scrollTop;\n }\n\n save() {\n let value = this.textbox.value;\n switch(this.root.getAttribute('data-mode')) {\n case 'link': {\n let scrollTop = this.quill.root.scrollTop;\n if (this.linkRange) {\n this.quill.formatText(this.linkRange, 'link', value, Emitter.sources.USER);\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, Emitter.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video': {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula': {\n if (!value) break;\n let range = this.quill.getSelection(true);\n if (range != null) {\n let index = range.index + range.length;\n this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, Emitter.sources.USER);\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER);\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER);\n }\n break;\n }\n default:\n }\n this.textbox.value = '';\n this.hide();\n }\n}\n\n\nfunction extractVideoUrl(url) {\n let match = url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/) ||\n url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0';\n }\n if (match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/)) { // eslint-disable-line no-cond-assign\n return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/';\n }\n return url;\n}\n\nfunction fillSelect(select, values, defaultValue = false) {\n values.forEach(function(value) {\n let option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', value);\n }\n select.appendChild(option);\n });\n}\n\n\nexport { BaseTooltip, BaseTheme as default };\n\n\n\n// WEBPACK FOOTER //\n// ./themes/base.js","import Quill from './core';\n\nimport { AlignClass, AlignStyle } from './formats/align';\nimport { DirectionAttribute, DirectionClass, DirectionStyle } from './formats/direction';\nimport { IndentClass as Indent } from './formats/indent';\n\nimport Blockquote from './formats/blockquote';\nimport Header from './formats/header';\nimport List, { ListItem } from './formats/list';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background';\nimport { ColorClass, ColorStyle } from './formats/color';\nimport { FontClass, FontStyle } from './formats/font';\nimport { SizeClass, SizeStyle } from './formats/size';\n\nimport Bold from './formats/bold';\nimport Italic from './formats/italic';\nimport Link from './formats/link';\nimport Script from './formats/script';\nimport Strike from './formats/strike';\nimport Underline from './formats/underline';\n\nimport Image from './formats/image';\nimport Video from './formats/video';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code';\n\nimport Formula from './modules/formula';\nimport Syntax from './modules/syntax';\nimport Toolbar from './modules/toolbar';\n\nimport Icons from './ui/icons';\nimport Picker from './ui/picker';\nimport ColorPicker from './ui/color-picker';\nimport IconPicker from './ui/icon-picker';\nimport Tooltip from './ui/tooltip';\n\nimport BubbleTheme from './themes/bubble';\nimport SnowTheme from './themes/snow';\n\n\nQuill.register({\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle\n}, true);\n\n\nQuill.register({\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'formats/list/item': ListItem,\n\n 'modules/formula': Formula,\n 'modules/syntax': Syntax,\n 'modules/toolbar': Toolbar,\n\n 'themes/bubble': BubbleTheme,\n 'themes/snow': SnowTheme,\n\n 'ui/icons': Icons,\n 'ui/picker': Picker,\n 'ui/icon-picker': IconPicker,\n 'ui/color-picker': ColorPicker,\n 'ui/tooltip': Tooltip\n}, true);\n\n\nexport default Quill;\n\n\n\n// WEBPACK FOOTER //\n// ./quill.js","import Parchment from 'parchment';\nimport Quill from './core/quill';\n\nimport Block, { BlockEmbed } from './blots/block';\nimport Break from './blots/break';\nimport Container from './blots/container';\nimport Cursor from './blots/cursor';\nimport Embed from './blots/embed';\nimport Inline from './blots/inline';\nimport Scroll from './blots/scroll';\nimport TextBlot from './blots/text';\n\nimport Clipboard from './modules/clipboard';\nimport History from './modules/history';\nimport Keyboard from './modules/keyboard';\n\nQuill.register({\n 'blots/block' : Block,\n 'blots/block/embed' : BlockEmbed,\n 'blots/break' : Break,\n 'blots/container' : Container,\n 'blots/cursor' : Cursor,\n 'blots/embed' : Embed,\n 'blots/inline' : Inline,\n 'blots/scroll' : Scroll,\n 'blots/text' : TextBlot,\n\n 'modules/clipboard' : Clipboard,\n 'modules/history' : History,\n 'modules/keyboard' : Keyboard\n});\n\nParchment.register(Block, Break, Cursor, Inline, Scroll, TextBlot);\n\n\nexport default Quill;\n\n\n\n// WEBPACK FOOTER //\n// ./core.js","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LinkedList = /** @class */ (function () {\n function LinkedList() {\n this.head = this.tail = null;\n this.length = 0;\n }\n LinkedList.prototype.append = function () {\n var nodes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodes[_i] = arguments[_i];\n }\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n };\n LinkedList.prototype.contains = function (node) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n if (cur === node)\n return true;\n }\n return false;\n };\n LinkedList.prototype.insertBefore = function (node, refNode) {\n if (!node)\n return;\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n }\n else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n }\n else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n };\n LinkedList.prototype.offset = function (target) {\n var index = 0, cur = this.head;\n while (cur != null) {\n if (cur === target)\n return index;\n index += cur.length();\n cur = cur.next;\n }\n return -1;\n };\n LinkedList.prototype.remove = function (node) {\n if (!this.contains(node))\n return;\n if (node.prev != null)\n node.prev.next = node.next;\n if (node.next != null)\n node.next.prev = node.prev;\n if (node === this.head)\n this.head = node.next;\n if (node === this.tail)\n this.tail = node.prev;\n this.length -= 1;\n };\n LinkedList.prototype.iterator = function (curNode) {\n if (curNode === void 0) { curNode = this.head; }\n // TODO use yield when we can\n return function () {\n var ret = curNode;\n if (curNode != null)\n curNode = curNode.next;\n return ret;\n };\n };\n LinkedList.prototype.find = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var cur, next = this.iterator();\n while ((cur = next())) {\n var length = cur.length();\n if (index < length ||\n (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) {\n return [cur, index];\n }\n index -= length;\n }\n return [null, 0];\n };\n LinkedList.prototype.forEach = function (callback) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n callback(cur);\n }\n };\n LinkedList.prototype.forEachAt = function (index, length, callback) {\n if (length <= 0)\n return;\n var _a = this.find(index), startNode = _a[0], offset = _a[1];\n var cur, curIndex = index - offset, next = this.iterator(startNode);\n while ((cur = next()) && curIndex < index + length) {\n var curLength = cur.length();\n if (index > curIndex) {\n callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n }\n else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n }\n };\n LinkedList.prototype.map = function (callback) {\n return this.reduce(function (memo, cur) {\n memo.push(callback(cur));\n return memo;\n }, []);\n };\n LinkedList.prototype.reduce = function (callback, memo) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n memo = callback(memo, cur);\n }\n return memo;\n };\n return LinkedList;\n}());\nexports.default = LinkedList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/collection/linked-list.ts\n// module id = 47\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = require(\"./abstract/container\");\nvar Registry = require(\"../registry\");\nvar OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\nvar MAX_OPTIMIZE_ITERATIONS = 100;\nvar ScrollBlot = /** @class */ (function (_super) {\n __extends(ScrollBlot, _super);\n function ScrollBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.scroll = _this;\n _this.observer = new MutationObserver(function (mutations) {\n _this.update(mutations);\n });\n _this.observer.observe(_this.domNode, OBSERVER_CONFIG);\n _this.attach();\n return _this;\n }\n ScrollBlot.prototype.detach = function () {\n _super.prototype.detach.call(this);\n this.observer.disconnect();\n };\n ScrollBlot.prototype.deleteAt = function (index, length) {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(function (child) {\n child.remove();\n });\n }\n else {\n _super.prototype.deleteAt.call(this, index, length);\n }\n };\n ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n this.update();\n _super.prototype.formatAt.call(this, index, length, name, value);\n };\n ScrollBlot.prototype.insertAt = function (index, value, def) {\n this.update();\n _super.prototype.insertAt.call(this, index, value, def);\n };\n ScrollBlot.prototype.optimize = function (mutations, context) {\n var _this = this;\n if (mutations === void 0) { mutations = []; }\n if (context === void 0) { context = {}; }\n _super.prototype.optimize.call(this, context);\n // We must modify mutations directly, cannot make copy and then modify\n var records = [].slice.call(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0)\n mutations.push(records.pop());\n // TODO use WeakMap\n var mark = function (blot, markParent) {\n if (markParent === void 0) { markParent = true; }\n if (blot == null || blot === _this)\n return;\n if (blot.domNode.parentNode == null)\n return;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [];\n }\n if (markParent)\n mark(blot.parent);\n };\n var optimize = function (blot) {\n // Post-order traversal\n if (\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY] == null ||\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations == null) {\n return;\n }\n if (blot instanceof container_1.default) {\n blot.children.forEach(optimize);\n }\n blot.optimize(context);\n };\n var remaining = mutations;\n for (var i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(Registry.find(mutation.previousSibling, false));\n [].forEach.call(mutation.addedNodes, function (node) {\n var child = Registry.find(node, false);\n mark(child, false);\n if (child instanceof container_1.default) {\n child.children.forEach(function (grandChild) {\n mark(grandChild, false);\n });\n }\n });\n }\n else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = [].slice.call(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0)\n mutations.push(records.pop());\n }\n };\n ScrollBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (context === void 0) { context = {}; }\n mutations = mutations || this.observer.takeRecords();\n // TODO use WeakMap\n mutations\n .map(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return null;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n return blot;\n }\n else {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n return null;\n }\n })\n .forEach(function (blot) {\n if (blot == null ||\n blot === _this ||\n //@ts-ignore\n blot.domNode[Registry.DATA_KEY] == null)\n return;\n // @ts-ignore\n blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);\n });\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY].mutations != null) {\n // @ts-ignore\n _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);\n }\n this.optimize(mutations, context);\n };\n ScrollBlot.blotName = 'scroll';\n ScrollBlot.defaultChild = 'block';\n ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n ScrollBlot.tagName = 'DIV';\n return ScrollBlot;\n}(container_1.default));\nexports.default = ScrollBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/scroll.ts\n// module id = 48\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = require(\"./abstract/format\");\nvar Registry = require(\"../registry\");\n// Shallow object comparison\nfunction isEqual(obj1, obj2) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length)\n return false;\n // @ts-ignore\n for (var prop in obj1) {\n // @ts-ignore\n if (obj1[prop] !== obj2[prop])\n return false;\n }\n return true;\n}\nvar InlineBlot = /** @class */ (function (_super) {\n __extends(InlineBlot, _super);\n function InlineBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n InlineBlot.formats = function (domNode) {\n if (domNode.tagName === InlineBlot.tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n InlineBlot.prototype.format = function (name, value) {\n var _this = this;\n if (name === this.statics.blotName && !value) {\n this.children.forEach(function (child) {\n if (!(child instanceof format_1.default)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n _this.attributes.copy(child);\n });\n this.unwrap();\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n InlineBlot.prototype.formatAt = function (index, length, name, value) {\n if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n var blot = this.isolate(index, length);\n blot.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n InlineBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n var formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n var next = this.next;\n if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n next.moveChildren(this);\n next.remove();\n }\n };\n InlineBlot.blotName = 'inline';\n InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n InlineBlot.tagName = 'SPAN';\n return InlineBlot;\n}(format_1.default));\nexports.default = InlineBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/inline.ts\n// module id = 49\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = require(\"./abstract/format\");\nvar Registry = require(\"../registry\");\nvar BlockBlot = /** @class */ (function (_super) {\n __extends(BlockBlot, _super);\n function BlockBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BlockBlot.formats = function (domNode) {\n var tagName = Registry.query(BlockBlot.blotName).tagName;\n if (domNode.tagName === tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n BlockBlot.prototype.format = function (name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n return;\n }\n else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n BlockBlot.prototype.formatAt = function (index, length, name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n BlockBlot.prototype.insertAt = function (index, value, def) {\n if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n // Insert text or inline\n _super.prototype.insertAt.call(this, index, value, def);\n }\n else {\n var after = this.split(index);\n var blot = Registry.create(value, def);\n after.parent.insertBefore(blot, after);\n }\n };\n BlockBlot.prototype.update = function (mutations, context) {\n if (navigator.userAgent.match(/Trident/)) {\n this.build();\n }\n else {\n _super.prototype.update.call(this, mutations, context);\n }\n };\n BlockBlot.blotName = 'block';\n BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n BlockBlot.tagName = 'P';\n return BlockBlot;\n}(format_1.default));\nexports.default = BlockBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/block.ts\n// module id = 50\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = require(\"./abstract/leaf\");\nvar EmbedBlot = /** @class */ (function (_super) {\n __extends(EmbedBlot, _super);\n function EmbedBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EmbedBlot.formats = function (domNode) {\n return undefined;\n };\n EmbedBlot.prototype.format = function (name, value) {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n };\n EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n EmbedBlot.prototype.formats = function () {\n return this.statics.formats(this.domNode);\n };\n return EmbedBlot;\n}(leaf_1.default));\nexports.default = EmbedBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/embed.ts\n// module id = 51\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = require(\"./abstract/leaf\");\nvar Registry = require(\"../registry\");\nvar TextBlot = /** @class */ (function (_super) {\n __extends(TextBlot, _super);\n function TextBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.text = _this.statics.value(_this.domNode);\n return _this;\n }\n TextBlot.create = function (value) {\n return document.createTextNode(value);\n };\n TextBlot.value = function (domNode) {\n var text = domNode.data;\n // @ts-ignore\n if (text['normalize'])\n text = text['normalize']();\n return text;\n };\n TextBlot.prototype.deleteAt = function (index, length) {\n this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n };\n TextBlot.prototype.index = function (node, offset) {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n };\n TextBlot.prototype.insertAt = function (index, value, def) {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n }\n else {\n _super.prototype.insertAt.call(this, index, value, def);\n }\n };\n TextBlot.prototype.length = function () {\n return this.text.length;\n };\n TextBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n }\n else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), this.next.value());\n this.next.remove();\n }\n };\n TextBlot.prototype.position = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return [this.domNode, index];\n };\n TextBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = Registry.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next);\n this.text = this.statics.value(this.domNode);\n return after;\n };\n TextBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this.domNode;\n })) {\n this.text = this.statics.value(this.domNode);\n }\n };\n TextBlot.prototype.value = function () {\n return this.text;\n };\n TextBlot.blotName = 'text';\n TextBlot.scope = Registry.Scope.INLINE_BLOT;\n return TextBlot;\n}(leaf_1.default));\nexports.default = TextBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/text.ts\n// module id = 52\n// module chunks = 0","let elem = document.createElement('div');\nelem.classList.toggle('test-class', false);\nif (elem.classList.contains('test-class')) {\n let _toggle = DOMTokenList.prototype.toggle;\n DOMTokenList.prototype.toggle = function(token, force) {\n if (arguments.length > 1 && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n}\n\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function(searchString, position){\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function(searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n}\n\nif (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, \"find\", {\n value: function(predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n }\n });\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n // Disable resizing in Firefox\n document.execCommand(\"enableObjectResizing\", false, false);\n // Disable automatic linkifying in IE11\n document.execCommand(\"autoUrlDetect\", false, false);\n});\n\n\n\n// WEBPACK FOOTER //\n// ./core/polyfill.js","/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int} cursor_pos Expected edit position in text1 (optional)\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos) {\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n // Check cursor_pos within bounds\n if (cursor_pos < 0 || text1.length < cursor_pos) {\n cursor_pos = null;\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs);\n if (cursor_pos != null) {\n diffs = fix_cursor(diffs, cursor_pos);\n }\n diffs = fix_emoji(diffs);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [[DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n */\nfunction diff_cleanupMerge(diffs) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL,\n text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n if (count_delete === 0) {\n diffs.splice(pointer - count_insert,\n count_delete + count_insert, [DIFF_INSERT, text_insert]);\n } else if (count_insert === 0) {\n diffs.splice(pointer - count_delete,\n count_delete + count_insert, [DIFF_DELETE, text_delete]);\n } else {\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert, [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]);\n }\n pointer = pointer - count_delete - count_insert +\n (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n};\n\n\nvar diff = diff_main;\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n\n/*\n * Modify a diff such that the cursor position points to the start of a change:\n * E.g.\n * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)\n * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]\n * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)\n * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} A tuple [cursor location in the modified diff, modified diff]\n */\nfunction cursor_normalize_diff (diffs, cursor_pos) {\n if (cursor_pos === 0) {\n return [DIFF_EQUAL, diffs];\n }\n for (var current_pos = 0, i = 0; i < diffs.length; i++) {\n var d = diffs[i];\n if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {\n var next_pos = current_pos + d[1].length;\n if (cursor_pos === next_pos) {\n return [i + 1, diffs];\n } else if (cursor_pos < next_pos) {\n // copy to prevent side effects\n diffs = diffs.slice();\n // split d into two diff changes\n var split_pos = cursor_pos - current_pos;\n var d_left = [d[0], d[1].slice(0, split_pos)];\n var d_right = [d[0], d[1].slice(split_pos)];\n diffs.splice(i, 1, d_left, d_right);\n return [i + 1, diffs];\n } else {\n current_pos = next_pos;\n }\n }\n }\n throw new Error('cursor_pos is out of bounds!')\n}\n\n/*\n * Modify a diff such that the edit position is \"shifted\" to the proposed edit location (cursor_position).\n *\n * Case 1)\n * Check if a naive shift is possible:\n * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)\n * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result\n * Case 2)\n * Check if the following shifts are possible:\n * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']\n * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']\n * ^ ^\n * d d_next\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} Array of diff tuples\n */\nfunction fix_cursor (diffs, cursor_pos) {\n var norm = cursor_normalize_diff(diffs, cursor_pos);\n var ndiffs = norm[1];\n var cursor_pointer = norm[0];\n var d = ndiffs[cursor_pointer];\n var d_next = ndiffs[cursor_pointer + 1];\n\n if (d == null) {\n // Text was deleted from end of original string,\n // cursor is now out of bounds in new string\n return diffs;\n } else if (d[0] !== DIFF_EQUAL) {\n // A modification happened at the cursor location.\n // This is the expected outcome, so we can return the original diff.\n return diffs;\n } else {\n if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {\n // Case 1)\n // It is possible to perform a naive shift\n ndiffs.splice(cursor_pointer, 2, d_next, d)\n return merge_tuples(ndiffs, cursor_pointer, 2)\n } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {\n // Case 2)\n // d[1] is a prefix of d_next[1]\n // We can assume that d_next[0] !== 0, since d[0] === 0\n // Shift edit locations..\n ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);\n var suffix = d_next[1].slice(d[1].length);\n if (suffix.length > 0) {\n ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);\n }\n return merge_tuples(ndiffs, cursor_pointer, 3)\n } else {\n // Not possible to perform any modification\n return diffs;\n }\n }\n}\n\n/*\n * Check diff did not split surrogate pairs.\n * Ex. [0, '\\uD83D'], [-1, '\\uDC36'], [1, '\\uDC2F'] -> [-1, '\\uD83D\\uDC36'], [1, '\\uD83D\\uDC2F']\n * '\\uD83D\\uDC36' === '🐶', '\\uD83D\\uDC2F' === '🐯'\n *\n * @param {Array} diffs Array of diff tuples\n * @return {Array} Array of diff tuples\n */\nfunction fix_emoji (diffs) {\n var compact = false;\n var starts_with_pair_end = function(str) {\n return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF;\n }\n var ends_with_pair_start = function(str) {\n return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF;\n }\n for (var i = 2; i < diffs.length; i += 1) {\n if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) &&\n diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) &&\n diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) {\n compact = true;\n\n diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1];\n diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1];\n\n diffs[i-2][1] = diffs[i-2][1].slice(0, -1);\n }\n }\n if (!compact) {\n return diffs;\n }\n var fixed_diffs = [];\n for (var i = 0; i < diffs.length; i += 1) {\n if (diffs[i][1].length > 0) {\n fixed_diffs.push(diffs[i]);\n }\n }\n return fixed_diffs;\n}\n\n/*\n * Try to merge tuples with their neigbors in a given range.\n * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']\n *\n * @param {Array} diffs Array of diff tuples.\n * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).\n * @param {Int} length Number of consecutive elements to check.\n * @return {Array} Array of merged diff tuples.\n */\nfunction merge_tuples (diffs, start, length) {\n // Check from (start-1) to (start+length).\n for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {\n if (i + 1 < diffs.length) {\n var left_d = diffs[i];\n var right_d = diffs[i+1];\n if (left_d[0] === right_d[1]) {\n diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);\n }\n }\n }\n return diffs;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/fast-diff/diff.js\n// module id = 54\n// module chunks = 0","exports = module.exports = typeof Object.keys === 'function'\n ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/deep-equal/lib/keys.js\n// module id = 55\n// module chunks = 0","var supportsArgumentsClass = (function(){\n return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n return object &&\n typeof object == 'object' &&\n typeof object.length == 'number' &&\n Object.prototype.hasOwnProperty.call(object, 'callee') &&\n !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n false;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/deep-equal/lib/is_arguments.js\n// module id = 56\n// module chunks = 0","import Delta from 'quill-delta';\nimport DeltaOp from 'quill-delta/lib/op';\nimport Parchment from 'parchment';\nimport CodeBlock from '../formats/code';\nimport CursorBlot from '../blots/cursor';\nimport Block, { bubbleFormats } from '../blots/block';\nimport Break from '../blots/break';\nimport clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\n\n\nconst ASCII = /^[ -~]*$/;\n\n\nclass Editor {\n constructor(scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta) {\n let consumeNextNewline = false;\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n delta = normalizeDelta(delta);\n delta.reduce((index, op) => {\n let length = op.retain || op.delete || op.insert.length || 1;\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n let text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (index >= scrollLength && !text.endsWith('\\n')) {\n consumeNextNewline = true;\n }\n this.scroll.insertAt(index, text);\n let [line, offset] = this.scroll.line(index);\n let formats = extend({}, bubbleFormats(line));\n if (line instanceof Block) {\n let [leaf, ] = line.descendant(Parchment.Leaf, offset);\n formats = extend(formats, bubbleFormats(leaf));\n }\n attributes = DeltaOp.attributes.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n let key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach((name) => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n delta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batchEnd();\n return this.update(delta);\n }\n\n deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(index, length, formats = {}) {\n this.scroll.update();\n Object.keys(formats).forEach((format) => {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[format]) return;\n let lines = this.scroll.lines(index, Math.max(length, 1));\n let lengthRemaining = length;\n lines.forEach((line) => {\n let lineLength = line.length();\n if (!(line instanceof CodeBlock)) {\n line.format(format, formats[format]);\n } else {\n let codeIndex = index - line.offset(this.scroll);\n let codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n line.formatAt(codeIndex, codeLength, format, formats[format]);\n }\n lengthRemaining -= lineLength;\n });\n });\n this.scroll.optimize();\n return this.update(new Delta().retain(index).retain(length, clone(formats)));\n }\n\n formatText(index, length, formats = {}) {\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).retain(length, clone(formats)));\n }\n\n getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n\n getDelta() {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index, length = 0) {\n let lines = [], leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(function(path) {\n let [blot, ] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof Parchment.Leaf) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(Parchment.Leaf, index, length);\n }\n let formatsArr = [lines, leaves].map(function(blots) {\n if (blots.length === 0) return {};\n let formats = bubbleFormats(blots.shift());\n while (Object.keys(formats).length > 0) {\n let blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return extend.apply(extend, formatsArr);\n }\n\n getText(index, length) {\n return this.getContents(index, length).filter(function(op) {\n return typeof op.insert === 'string';\n }).map(function(op) {\n return op.insert;\n }).join('');\n }\n\n insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(index, text, formats = {}) {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).insert(text, clone(formats)));\n }\n\n isBlank() {\n if (this.scroll.children.length == 0) return true;\n if (this.scroll.children.length > 1) return false;\n let block = this.scroll.children.head;\n if (block.statics.blotName !== Block.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n removeFormat(index, length) {\n let text = this.getText(index, length);\n let [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0, suffix = new Delta();\n if (line != null) {\n if (!(line instanceof CodeBlock)) {\n suffixLength = line.length() - offset;\n } else {\n suffixLength = line.newlineIndex(offset) - offset + 1;\n }\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n let contents = this.getContents(index, length + suffixLength);\n let diff = contents.diff(new Delta().insert(text).concat(suffix));\n let delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(change, mutations = [], cursorIndex = undefined) {\n let oldDelta = this.delta;\n if (mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n mutations[0].target.data.match(ASCII) &&\n Parchment.find(mutations[0].target)) {\n // Optimization for character changes\n let textBlot = Parchment.find(mutations[0].target);\n let formats = bubbleFormats(textBlot);\n let index = textBlot.offset(this.scroll);\n let oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n let oldText = new Delta().insert(oldValue);\n let newText = new Delta().insert(textBlot.value());\n let diffDelta = new Delta().retain(index).concat(oldText.diff(newText, cursorIndex));\n change = diffDelta.reduce(function(delta, op) {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n } else {\n return delta.push(op);\n }\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !equal(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, cursorIndex);\n }\n }\n return change;\n }\n}\n\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce(function(merged, name) {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce(function(delta, op) {\n if (op.insert === 1) {\n let attributes = clone(op.attributes);\n delete attributes['image'];\n return delta.insert({ image: op.attributes.image }, attributes);\n }\n if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n op = clone(op);\n if (op.attributes.list) {\n op.attributes.list = 'ordered';\n } else {\n op.attributes.list = 'bullet';\n delete op.attributes.bullet;\n }\n }\n if (typeof op.insert === 'string') {\n let text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return delta.insert(text, op.attributes);\n }\n return delta.push(op);\n }, new Delta());\n}\n\n\nexport default Editor;\n\n\n\n// WEBPACK FOOTER //\n// ./core/editor.js","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/eventemitter3/index.js\n// module id = 58\n// module chunks = 0","import Parchment from 'parchment';\nimport Emitter from '../core/emitter';\nimport Block, { BlockEmbed } from './block';\nimport Break from './break';\nimport CodeBlock from '../formats/code';\nimport Container from './container';\n\n\nfunction isLine(blot) {\n return (blot instanceof Block || blot instanceof BlockEmbed);\n}\n\n\nclass Scroll extends Parchment.Scroll {\n constructor(domNode, config) {\n super(domNode);\n this.emitter = config.emitter;\n if (Array.isArray(config.whitelist)) {\n this.whitelist = config.whitelist.reduce(function(whitelist, format) {\n whitelist[format] = true;\n return whitelist;\n }, {});\n }\n // Some reason fixes composition issues with character languages in Windows/Chrome, Safari\n this.domNode.addEventListener('DOMNodeInserted', function() {});\n this.optimize();\n this.enable();\n }\n\n batchStart() {\n this.batch = true;\n }\n\n batchEnd() {\n this.batch = false;\n this.optimize();\n }\n\n deleteAt(index, length) {\n let [first, offset] = this.line(index);\n let [last, ] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n if (first instanceof CodeBlock) {\n let newlineIndex = first.newlineIndex(first.length(), true);\n if (newlineIndex > -1) {\n first = first.split(newlineIndex + 1);\n if (first === last) {\n this.optimize();\n return;\n }\n }\n } else if (last instanceof CodeBlock) {\n let newlineIndex = last.newlineIndex(0);\n if (newlineIndex > -1) {\n last.split(newlineIndex + 1);\n }\n }\n let ref = last.children.head instanceof Break ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled);\n }\n\n formatAt(index, length, format, value) {\n if (this.whitelist != null && !this.whitelist[format]) return;\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index, value, def) {\n if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n if (index >= this.length()) {\n if (def == null || Parchment.query(value, Parchment.Scope.BLOCK) == null) {\n let blot = Parchment.create(this.statics.defaultChild);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n value = value.slice(0, -1);\n }\n blot.insertAt(0, value, def);\n } else {\n let embed = Parchment.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot, ref) {\n if (blot.statics.scope === Parchment.Scope.INLINE_BLOT) {\n let wrapper = Parchment.create(this.statics.defaultChild);\n wrapper.appendChild(blot);\n blot = wrapper;\n }\n super.insertBefore(blot, ref);\n }\n\n leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n\n line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE) {\n let getLines = (blot, index, length) => {\n let lines = [], lengthLeft = length;\n blot.children.forEachAt(index, length, function(child, index, length) {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof Parchment.Container) {\n lines = lines.concat(getLines(child, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(mutations = [], context = {}) {\n if (this.batch === true) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index) {\n return super.path(index).slice(1); // Exclude self\n }\n\n update(mutations) {\n if (this.batch === true) return;\n let source = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n}\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = 'block';\nScroll.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Scroll;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/scroll.js","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nimport { AlignAttribute, AlignStyle } from '../formats/align';\nimport { BackgroundStyle } from '../formats/background';\nimport CodeBlock from '../formats/code';\nimport { ColorStyle } from '../formats/color';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction';\nimport { FontStyle } from '../formats/font';\nimport { SizeStyle } from '../formats/size';\n\nlet debug = logger('quill:clipboard');\n\n\nconst DOM_KEY = '__ql-matcher';\n\nconst CLIPBOARD_CONFIG = [\n [Node.TEXT_NODE, matchText],\n [Node.TEXT_NODE, matchNewline],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchSpacing],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['li', matchIndent],\n ['b', matchAlias.bind(matchAlias, 'bold')],\n ['i', matchAlias.bind(matchAlias, 'italic')],\n ['style', matchIgnore]\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [\n AlignAttribute,\n DirectionAttribute\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\n\nclass Clipboard extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.quill.root.addEventListener('paste', this.onPaste.bind(this));\n this.container = this.quill.addContainer('ql-clipboard');\n this.container.setAttribute('contenteditable', true);\n this.container.setAttribute('tabindex', -1);\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers).forEach(([selector, matcher]) => {\n if (!options.matchVisual && matcher === matchSpacing) return;\n this.addMatcher(selector, matcher);\n });\n }\n\n addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert(html) {\n if (typeof html === 'string') {\n this.container.innerHTML = html.replace(/\\>\\r?\\n +\\<'); // Remove spaces between tags\n return this.convert();\n }\n const formats = this.quill.getFormat(this.quill.selection.savedRange.index);\n if (formats[CodeBlock.blotName]) {\n const text = this.container.innerText;\n this.container.innerHTML = '';\n return new Delta().insert(text, { [CodeBlock.blotName]: formats[CodeBlock.blotName] });\n }\n let [elementMatchers, textMatchers] = this.prepareMatching();\n let delta = traverse(this.container, elementMatchers, textMatchers);\n // Remove trailing newline\n if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n delta = delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n debug.log('convert', this.container.innerHTML, delta);\n this.container.innerHTML = '';\n return delta;\n }\n\n dangerouslyPasteHTML(index, html, source = Quill.sources.API) {\n if (typeof index === 'string') {\n this.quill.setContents(this.convert(index), html);\n this.quill.setSelection(0, Quill.sources.SILENT);\n } else {\n let paste = this.convert(html);\n this.quill.updateContents(new Delta().retain(index).concat(paste), source);\n this.quill.setSelection(index + paste.length(), Quill.sources.SILENT);\n }\n }\n\n onPaste(e) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n let range = this.quill.getSelection();\n let delta = new Delta().retain(range.index);\n let scrollTop = this.quill.scrollingContainer.scrollTop;\n this.container.focus();\n this.quill.selection.update(Quill.sources.SILENT);\n setTimeout(() => {\n delta = delta.concat(this.convert()).delete(range.length);\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(delta.length() - range.length, Quill.sources.SILENT);\n this.quill.scrollingContainer.scrollTop = scrollTop;\n this.quill.focus();\n }, 1);\n }\n\n prepareMatching() {\n let elementMatchers = [], textMatchers = [];\n this.matchers.forEach((pair) => {\n let [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n [].forEach.call(this.container.querySelectorAll(selector), (node) => {\n // TODO use weakmap\n node[DOM_KEY] = node[DOM_KEY] || [];\n node[DOM_KEY].push(matcher);\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\nClipboard.DEFAULTS = {\n matchers: [],\n matchVisual: true\n};\n\n\nfunction applyFormat(delta, format, value) {\n if (typeof format === 'object') {\n return Object.keys(format).reduce(function(delta, key) {\n return applyFormat(delta, key, format[key]);\n }, delta);\n } else {\n return delta.reduce(function(delta, op) {\n if (op.attributes && op.attributes[format]) {\n return delta.push(op);\n } else {\n return delta.insert(op.insert, extend({}, {[format]: value}, op.attributes));\n }\n }, new Delta());\n }\n}\n\nfunction computeStyle(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) return {};\n const DOM_KEY = '__ql-computed-style';\n return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n}\n\nfunction deltaEndsWith(delta, text) {\n let endText = \"\";\n for (let i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n let op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1*text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n let style = computeStyle(node);\n return ['block', 'list-item'].indexOf(style.display) > -1;\n}\n\nfunction traverse(node, elementMatchers, textMatchers) { // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce(function(delta, matcher) {\n return matcher(node, delta);\n }, new Delta());\n } else if (node.nodeType === node.ELEMENT_NODE) {\n return [].reduce.call(node.childNodes || [], (delta, childNode) => {\n let childrenDelta = traverse(childNode, elementMatchers, textMatchers);\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n childrenDelta = (childNode[DOM_KEY] || []).reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n } else {\n return new Delta();\n }\n}\n\n\nfunction matchAlias(format, node, delta) {\n return applyFormat(delta, format, true);\n}\n\nfunction matchAttributor(node, delta) {\n let attributes = Parchment.Attributor.Attribute.keys(node);\n let classes = Parchment.Attributor.Class.keys(node);\n let styles = Parchment.Attributor.Style.keys(node);\n let formats = {};\n attributes.concat(classes).concat(styles).forEach((name) => {\n let attr = Parchment.query(name, Parchment.Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name]\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n return delta;\n}\n\nfunction matchBlot(node, delta) {\n let match = Parchment.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof Parchment.Embed) {\n let embed = {};\n let value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n delta = new Delta().insert(embed, match.formats(node));\n }\n } else if (typeof match.formats === 'function') {\n delta = applyFormat(delta, match.blotName, match.formats(node));\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchIndent(node, delta) {\n let match = Parchment.query(node);\n if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\\n')) {\n return delta;\n }\n let indent = -1, parent = node.parentNode;\n while (!parent.classList.contains('ql-clipboard')) {\n if ((Parchment.query(parent) || {}).blotName === 'list') {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.compose(new Delta().retain(delta.length() - 1).retain(1, { indent: indent}));\n}\n\nfunction matchNewline(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (isLine(node) || (delta.length() > 0 && node.nextSibling && isLine(node.nextSibling))) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchSpacing(node, delta) {\n if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\\n\\n')) {\n let nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);\n if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight*1.5) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n let formats = {};\n let style = node.style || {};\n if (style.fontStyle && computeStyle(node).fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') ||\n parseInt(computeStyle(node).fontWeight) >= 700)) {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n if (parseFloat(style.textIndent || 0) > 0) { // Could be 0.5in\n delta = new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchText(node, delta) {\n let text = node.data;\n // Word represents empty line with  \n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) {\n return delta;\n }\n if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n // eslint-disable-next-line func-style\n let replacer = function(collapse, match) {\n match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return match.length < 1 && collapse ? ' ' : match;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if ((node.previousSibling == null && isLine(node.parentNode)) ||\n (node.previousSibling != null && isLine(node.previousSibling))) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if ((node.nextSibling == null && isLine(node.parentNode)) ||\n (node.nextSibling != null && isLine(node.nextSibling))) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\n\nexport { Clipboard as default, matchAttributor, matchBlot, matchNewline, matchSpacing, matchText };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/clipboard.js","import Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\n\n\nclass History extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.lastRecorded = 0;\n this.ignoreChange = false;\n this.clear();\n this.quill.on(Quill.events.EDITOR_CHANGE, (eventName, delta, oldDelta, source) => {\n if (eventName !== Quill.events.TEXT_CHANGE || this.ignoreChange) return;\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(delta, oldDelta);\n } else {\n this.transform(delta);\n }\n });\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, this.undo.bind(this));\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, this.redo.bind(this));\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, this.redo.bind(this));\n }\n }\n\n change(source, dest) {\n if (this.stack[source].length === 0) return;\n let delta = this.stack[source].pop();\n this.stack[dest].push(delta);\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta[source], Quill.sources.USER);\n this.ignoreChange = false;\n let index = getLastChangeIndex(delta[source]);\n this.quill.setSelection(index);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = this.quill.getContents().diff(oldDelta);\n let timestamp = Date.now();\n if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n let delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta.undo);\n changeDelta = delta.redo.compose(changeDelta);\n } else {\n this.lastRecorded = timestamp;\n }\n this.stack.undo.push({\n redo: changeDelta,\n undo: undoDelta\n });\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta) {\n this.stack.undo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n this.stack.redo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n}\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false\n};\n\nfunction endsWithNewlineChange(delta) {\n let lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(function(attr) {\n return Parchment.query(attr, Parchment.Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(delta) {\n let deleteLength = delta.reduce(function(length, op) {\n length += (op.delete || 0);\n return length;\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\n\nexport { History as default, getLastChangeIndex };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/history.js","import Parchment from 'parchment';\n\nclass IdentAttributor extends Parchment.Attributor.Class {\n add(node, value) {\n if (value === '+1' || value === '-1') {\n let indent = this.value(node) || 0;\n value = (value === '+1' ? (indent + 1) : (indent - 1));\n }\n if (value === 0) {\n this.remove(node);\n return true;\n } else {\n return super.add(node, value);\n }\n }\n\n canAdd(node, value) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value));\n }\n\n value(node) {\n return parseInt(super.value(node)) || undefined; // Don't return NaN\n }\n}\n\nlet IndentClass = new IdentAttributor('indent', 'ql-indent', {\n scope: Parchment.Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n});\n\nexport { IndentClass };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/indent.js","import Block from '../blots/block';\n\n\nclass Blockquote extends Block {}\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\n\nexport default Blockquote;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/blockquote.js","import Block from '../blots/block';\n\n\nclass Header extends Block {\n static formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\n\nexport default Header;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/header.js","import Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Container from '../blots/container';\n\n\nclass ListItem extends Block {\n static formats(domNode) {\n return domNode.tagName === this.tagName ? undefined : super.formats(domNode);\n }\n\n format(name, value) {\n if (name === List.blotName && !value) {\n this.replaceWith(Parchment.create(this.statics.scope));\n } else {\n super.format(name, value);\n }\n }\n\n remove() {\n if (this.prev == null && this.next == null) {\n this.parent.remove();\n } else {\n super.remove();\n }\n }\n\n replaceWith(name, value) {\n this.parent.isolate(this.offset(this.parent), this.length());\n if (name === this.parent.statics.blotName) {\n this.parent.replaceWith(name, value);\n return this;\n } else {\n this.parent.unwrap();\n return super.replaceWith(name, value);\n }\n }\n}\nListItem.blotName = 'list-item';\nListItem.tagName = 'LI';\n\n\nclass List extends Container {\n static create(value) {\n let tagName = value === 'ordered' ? 'OL' : 'UL';\n let node = super.create(tagName);\n if (value === 'checked' || value === 'unchecked') {\n node.setAttribute('data-checked', value === 'checked');\n }\n return node;\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'OL') return 'ordered';\n if (domNode.tagName === 'UL') {\n if (domNode.hasAttribute('data-checked')) {\n return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked';\n } else {\n return 'bullet';\n }\n }\n return undefined;\n }\n\n constructor(domNode) {\n super(domNode);\n const listEventHandler = (e) => {\n if (e.target.parentNode !== domNode) return;\n let format = this.statics.formats(domNode);\n let blot = Parchment.find(e.target);\n if (format === 'checked') {\n blot.format('list', 'unchecked');\n } else if(format === 'unchecked') {\n blot.format('list', 'checked');\n }\n }\n\n domNode.addEventListener('touchstart', listEventHandler);\n domNode.addEventListener('mousedown', listEventHandler);\n }\n\n format(name, value) {\n if (this.children.length > 0) {\n this.children.tail.format(name, value);\n }\n }\n\n formats() {\n // We don't inherit from FormatBlot\n return { [this.statics.blotName]: this.statics.formats(this.domNode) };\n }\n\n insertBefore(blot, ref) {\n if (blot instanceof ListItem) {\n super.insertBefore(blot, ref);\n } else {\n let index = ref == null ? this.length() : ref.offset(this);\n let after = this.split(index);\n after.parent.insertBefore(blot, after);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n next.domNode.tagName === this.domNode.tagName &&\n next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n if (target.statics.blotName !== this.statics.blotName) {\n let item = Parchment.create(this.statics.defaultChild);\n target.moveChildren(item);\n this.appendChild(item);\n }\n super.replace(target);\n }\n}\nList.blotName = 'list';\nList.scope = Parchment.Scope.BLOCK_BLOT;\nList.tagName = ['OL', 'UL'];\nList.defaultChild = 'list-item';\nList.allowedChildren = [ListItem];\n\n\nexport { ListItem, List as default };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/list.js","import Bold from './bold';\n\nclass Italic extends Bold { }\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexport default Italic;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/italic.js","import Inline from '../blots/inline';\n\nclass Script extends Inline {\n static create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n } else if (value === 'sub') {\n return document.createElement('sub');\n } else {\n return super.create(value);\n }\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexport default Script;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/script.js","import Inline from '../blots/inline';\n\nclass Strike extends Inline { }\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexport default Strike;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/strike.js","import Inline from '../blots/inline';\n\nclass Underline extends Inline { }\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexport default Underline;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/underline.js","import Parchment from 'parchment';\nimport { sanitize } from '../formats/link';\n\nconst ATTRIBUTES = [\n 'alt',\n 'height',\n 'width'\n];\n\n\nclass Image extends Parchment.Embed {\n static create(value) {\n let node = super.create(value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static sanitize(url) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\n\nexport default Image;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/image.js","import { BlockEmbed } from '../blots/block';\nimport Link from '../formats/link';\n\nconst ATTRIBUTES = [\n 'height',\n 'width'\n];\n\n\nclass Video extends BlockEmbed {\n static create(value) {\n let node = super.create(value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static sanitize(url) {\n return Link.sanitize(url);\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\n\nexport default Video;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/video.js","import Embed from '../blots/embed';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\n\n\nclass FormulaBlot extends Embed {\n static create(value) {\n let node = super.create(value);\n if (typeof value === 'string') {\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00'\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n\n static value(domNode) {\n return domNode.getAttribute('data-value');\n }\n}\nFormulaBlot.blotName = 'formula';\nFormulaBlot.className = 'ql-formula';\nFormulaBlot.tagName = 'SPAN';\n\n\nclass Formula extends Module {\n static register() {\n Quill.register(FormulaBlot, true);\n }\n\n constructor() {\n super();\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n }\n}\n\n\nexport { FormulaBlot, Formula as default };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/formula.js","import Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\nimport CodeBlock from '../formats/code';\n\n\nclass SyntaxCodeBlock extends CodeBlock {\n replaceWith(block) {\n this.domNode.textContent = this.domNode.textContent;\n this.attach();\n super.replaceWith(block);\n }\n\n highlight(highlight) {\n let text = this.domNode.textContent;\n if (this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n this.domNode.innerHTML = highlight(text);\n this.domNode.normalize();\n this.attach();\n }\n this.cachedText = text;\n }\n }\n}\nSyntaxCodeBlock.className = 'ql-syntax';\n\n\nlet CodeToken = new Parchment.Attributor.Class('token', 'hljs', {\n scope: Parchment.Scope.INLINE\n});\n\n\nclass Syntax extends Module {\n static register() {\n Quill.register(CodeToken, true);\n Quill.register(SyntaxCodeBlock, true);\n }\n\n constructor(quill, options) {\n super(quill, options);\n if (typeof this.options.highlight !== 'function') {\n throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');\n }\n let timer = null;\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, this.options.interval);\n });\n this.highlight();\n }\n\n highlight() {\n if (this.quill.selection.composing) return;\n this.quill.update(Quill.sources.USER);\n let range = this.quill.getSelection();\n this.quill.scroll.descendants(SyntaxCodeBlock).forEach((code) => {\n code.highlight(this.options.highlight);\n });\n this.quill.update(Quill.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n }\n }\n}\nSyntax.DEFAULTS = {\n highlight: (function() {\n if (window.hljs == null) return null;\n return function(text) {\n let result = window.hljs.highlightAuto(text);\n return result.value;\n };\n })(),\n interval: 1000\n};\n\n\nexport { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default};\n\n\n\n// WEBPACK FOOTER //\n// ./modules/syntax.js","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nlet debug = logger('quill:toolbar');\n\n\nclass Toolbar extends Module {\n constructor(quill, options) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n let container = document.createElement('div');\n addControls(container, this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n return debug.error('Container required for toolbar', this.options);\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n Object.keys(this.options.handlers).forEach((format) => {\n this.addHandler(format, this.options.handlers[format]);\n });\n [].forEach.call(this.container.querySelectorAll('button, select'), (input) => {\n this.attach(input);\n });\n this.quill.on(Quill.events.EDITOR_CHANGE, (type, range) => {\n if (type === Quill.events.SELECTION_CHANGE) {\n this.update(range);\n }\n });\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n let [range, ] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n\n attach(input) {\n let format = [].find.call(input.classList, (className) => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (this.handlers[format] == null) {\n if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n debug.warn('ignoring attaching to disabled format', format, input);\n return;\n }\n if (Parchment.query(format) == null) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n }\n let eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, (e) => {\n let value;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n let selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n let [range, ] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (Parchment.query(format).prototype instanceof Parchment.Embed) {\n value = prompt(`Enter ${format}`);\n if (!value) return;\n this.quill.updateContents(new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ [format]: value })\n , Quill.sources.USER);\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n // TODO use weakmap\n this.controls.push([format, input]);\n }\n\n update(range) {\n let formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(function(pair) {\n let [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\\\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else {\n if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n let isActive = formats[format] === input.getAttribute('value') ||\n (formats[format] != null && formats[format].toString() === input.getAttribute('value')) ||\n (formats[format] == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\n\nfunction addButton(container, format, value) {\n let input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add('ql-' + format);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(function(controls) {\n let group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(function(control) {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n let format = Object.keys(control)[0];\n let value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n let input = document.createElement('select');\n input.classList.add('ql-' + format);\n values.forEach(function(value) {\n let option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean: function() {\n let range = this.quill.getSelection();\n if (range == null) return;\n if (range.length == 0) {\n let formats = this.quill.getFormat();\n Object.keys(formats).forEach((name) => {\n // Clean functionality in existing apps only clean inline formats\n if (Parchment.query(name, Parchment.Scope.INLINE) != null) {\n this.quill.format(name, false);\n }\n });\n } else {\n this.quill.removeFormat(range, Quill.sources.USER);\n }\n },\n direction: function(value) {\n let align = this.quill.getFormat()['align'];\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n indent: function(value) {\n let range = this.quill.getSelection();\n let formats = this.quill.getFormat(range);\n let indent = parseInt(formats.indent || 0);\n if (value === '+1' || value === '-1') {\n let modifier = (value === '+1') ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n },\n link: function(value) {\n if (value === true) {\n value = prompt('Enter link URL:');\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n list: function(value) {\n let range = this.quill.getSelection();\n let formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats['list'] === 'checked' || formats['list'] === 'unchecked') {\n this.quill.format('list', false, Quill.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', Quill.sources.USER);\n }\n } else {\n this.quill.format('list', value, Quill.sources.USER);\n }\n }\n }\n}\n\n\nexport { Toolbar as default, addControls };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/toolbar.js","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-left.svg\n// module id = 75\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-center.svg\n// module id = 76\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-right.svg\n// module id = 77\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-justify.svg\n// module id = 78\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/background.svg\n// module id = 79\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/blockquote.svg\n// module id = 80\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/bold.svg\n// module id = 81\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/clean.svg\n// module id = 82\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/color.svg\n// module id = 83\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/direction-ltr.svg\n// module id = 84\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/direction-rtl.svg\n// module id = 85\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-center.svg\n// module id = 86\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-full.svg\n// module id = 87\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-left.svg\n// module id = 88\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-right.svg\n// module id = 89\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/formula.svg\n// module id = 90\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/header.svg\n// module id = 91\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/header-2.svg\n// module id = 92\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/italic.svg\n// module id = 93\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/image.svg\n// module id = 94\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/indent.svg\n// module id = 95\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/outdent.svg\n// module id = 96\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/link.svg\n// module id = 97\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-ordered.svg\n// module id = 98\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-bullet.svg\n// module id = 99\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-check.svg\n// module id = 100\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/subscript.svg\n// module id = 101\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/superscript.svg\n// module id = 102\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/strike.svg\n// module id = 103\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/underline.svg\n// module id = 104\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/video.svg\n// module id = 105\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/dropdown.svg\n// module id = 106\n// module chunks = 0","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\n\nconst TOOLBAR_CONFIG = [\n ['bold', 'italic', 'link'],\n [{ header: 1 }, { header: 2 }, 'blockquote']\n];\n\nclass BubbleTheme extends BaseTheme {\n constructor(quill, options) {\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n\n extendToolbar(toolbar) {\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), icons);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), icons);\n }\n}\nBubbleTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function(value) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n }\n }\n }\n }\n});\n\n\nclass BubbleTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.quill.on(Emitter.events.EDITOR_CHANGE, (type, range, oldRange, source) => {\n if (type !== Emitter.events.SELECTION_CHANGE) return;\n if (range != null && range.length > 0 && source === Emitter.sources.USER) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = this.root.offsetWidth + 'px';\n let lines = this.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n this.position(this.quill.getBounds(range));\n } else {\n let lastLine = lines[lines.length - 1];\n let index = this.quill.getIndex(lastLine);\n let length = Math.min(lastLine.length() - 1, range.index + range.length - index);\n let bounds = this.quill.getBounds(new Range(index, length));\n this.position(bounds);\n }\n } else if (document.activeElement !== this.textbox && this.quill.hasFocus()) {\n this.hide();\n }\n });\n }\n\n listen() {\n super.listen();\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(Emitter.events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n let range = this.quill.getSelection();\n if (range != null) {\n this.position(this.quill.getBounds(range));\n }\n }, 1);\n });\n }\n\n cancel() {\n this.show();\n }\n\n position(reference) {\n let shift = super.position(reference);\n let arrow = this.root.querySelector('.ql-tooltip-arrow');\n arrow.style.marginLeft = '';\n if (shift === 0) return shift;\n arrow.style.marginLeft = (-1*shift - arrow.offsetWidth/2) + 'px';\n }\n}\nBubbleTooltip.TEMPLATE = [\n '',\n '
    ',\n '',\n '',\n '
    '\n].join('');\n\n\nexport { BubbleTooltip, BubbleTheme as default };\n\n\n\n// WEBPACK FOOTER //\n// ./themes/bubble.js","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport LinkBlot from '../formats/link';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\n\nconst TOOLBAR_CONFIG = [\n [{ header: ['1', '2', '3', false] }],\n ['bold', 'italic', 'underline', 'link'],\n [{ list: 'ordered' }, { list: 'bullet' }],\n ['clean']\n];\n\nclass SnowTheme extends BaseTheme {\n constructor(quill, options) {\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n\n extendToolbar(toolbar) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), icons);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), icons);\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function(range, context) {\n toolbar.handlers['link'].call(toolbar, !context.format.link);\n });\n }\n }\n}\nSnowTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function(value) {\n if (value) {\n let range = this.quill.getSelection();\n if (range == null || range.length == 0) return;\n let preview = this.quill.getText(range);\n if (/^\\S+@\\S+\\.\\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {\n preview = 'mailto:' + preview;\n }\n let tooltip = this.quill.theme.tooltip;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n }\n }\n }\n }\n});\n\n\nclass SnowTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.preview = this.root.querySelector('a.ql-preview');\n }\n\n listen() {\n super.listen();\n this.root.querySelector('a.ql-action').addEventListener('click', (event) => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n this.root.querySelector('a.ql-remove').addEventListener('click', (event) => {\n if (this.linkRange != null) {\n let range = this.linkRange;\n this.restoreFocus();\n this.quill.formatText(range, 'link', false, Emitter.sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(Emitter.events.SELECTION_CHANGE, (range, oldRange, source) => {\n if (range == null) return;\n if (range.length === 0 && source === Emitter.sources.USER) {\n let [link, offset] = this.quill.scroll.descendant(LinkBlot, range.index);\n if (link != null) {\n this.linkRange = new Range(range.index - offset, link.length());\n let preview = LinkBlot.formats(link.domNode);\n this.preview.textContent = preview;\n this.preview.setAttribute('href', preview);\n this.show();\n this.position(this.quill.getBounds(this.linkRange));\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.hide();\n });\n }\n\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\nSnowTooltip.TEMPLATE = [\n '',\n '',\n '',\n ''\n].join('');\n\n\nexport default SnowTheme;\n\n\n\n// WEBPACK FOOTER //\n// ./themes/snow.js"],"sourceRoot":""} \ No newline at end of file diff -Nru bibledit-5.0.912/quill/1.3.6/quill.snow.css bibledit-5.0.922/quill/1.3.6/quill.snow.css --- bibledit-5.0.912/quill/1.3.6/quill.snow.css 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/quill/1.3.6/quill.snow.css 2018-03-12 06:39:22.000000000 +0000 @@ -0,0 +1,945 @@ +/*! + * Quill Editor v1.3.6 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +.ql-container { + box-sizing: border-box; + font-family: Helvetica, Arial, sans-serif; + font-size: 13px; + height: 100%; + margin: 0px; + position: relative; +} +.ql-container.ql-disabled .ql-tooltip { + visibility: hidden; +} +.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before { + pointer-events: none; +} +.ql-clipboard { + left: -100000px; + height: 1px; + overflow-y: hidden; + position: absolute; + top: 50%; +} +.ql-clipboard p { + margin: 0; + padding: 0; +} +.ql-editor { + box-sizing: border-box; + line-height: 1.42; + height: 100%; + outline: none; + overflow-y: auto; + padding: 12px 15px; + tab-size: 4; + -moz-tab-size: 4; + text-align: left; + white-space: pre-wrap; + word-wrap: break-word; +} +.ql-editor > * { + cursor: text; +} +.ql-editor p, +.ql-editor ol, +.ql-editor ul, +.ql-editor pre, +.ql-editor blockquote, +.ql-editor h1, +.ql-editor h2, +.ql-editor h3, +.ql-editor h4, +.ql-editor h5, +.ql-editor h6 { + margin: 0; + padding: 0; + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol, +.ql-editor ul { + padding-left: 1.5em; +} +.ql-editor ol > li, +.ql-editor ul > li { + list-style-type: none; +} +.ql-editor ul > li::before { + content: '\2022'; +} +.ql-editor ul[data-checked=true], +.ql-editor ul[data-checked=false] { + pointer-events: none; +} +.ql-editor ul[data-checked=true] > li *, +.ql-editor ul[data-checked=false] > li * { + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before, +.ql-editor ul[data-checked=false] > li::before { + color: #777; + cursor: pointer; + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before { + content: '\2611'; +} +.ql-editor ul[data-checked=false] > li::before { + content: '\2610'; +} +.ql-editor li::before { + display: inline-block; + white-space: nowrap; + width: 1.2em; +} +.ql-editor li:not(.ql-direction-rtl)::before { + margin-left: -1.5em; + margin-right: 0.3em; + text-align: right; +} +.ql-editor li.ql-direction-rtl::before { + margin-left: 0.3em; + margin-right: -1.5em; +} +.ql-editor ol li:not(.ql-direction-rtl), +.ql-editor ul li:not(.ql-direction-rtl) { + padding-left: 1.5em; +} +.ql-editor ol li.ql-direction-rtl, +.ql-editor ul li.ql-direction-rtl { + padding-right: 1.5em; +} +.ql-editor ol li { + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; + counter-increment: list-0; +} +.ql-editor ol li:before { + content: counter(list-0, decimal) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-increment: list-1; +} +.ql-editor ol li.ql-indent-1:before { + content: counter(list-1, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-2 { + counter-increment: list-2; +} +.ql-editor ol li.ql-indent-2:before { + content: counter(list-2, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-2 { + counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-3 { + counter-increment: list-3; +} +.ql-editor ol li.ql-indent-3:before { + content: counter(list-3, decimal) '. '; +} +.ql-editor ol li.ql-indent-3 { + counter-reset: list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-4 { + counter-increment: list-4; +} +.ql-editor ol li.ql-indent-4:before { + content: counter(list-4, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-4 { + counter-reset: list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-5 { + counter-increment: list-5; +} +.ql-editor ol li.ql-indent-5:before { + content: counter(list-5, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-5 { + counter-reset: list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-6 { + counter-increment: list-6; +} +.ql-editor ol li.ql-indent-6:before { + content: counter(list-6, decimal) '. '; +} +.ql-editor ol li.ql-indent-6 { + counter-reset: list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-7 { + counter-increment: list-7; +} +.ql-editor ol li.ql-indent-7:before { + content: counter(list-7, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-7 { + counter-reset: list-8 list-9; +} +.ql-editor ol li.ql-indent-8 { + counter-increment: list-8; +} +.ql-editor ol li.ql-indent-8:before { + content: counter(list-8, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-8 { + counter-reset: list-9; +} +.ql-editor ol li.ql-indent-9 { + counter-increment: list-9; +} +.ql-editor ol li.ql-indent-9:before { + content: counter(list-9, decimal) '. '; +} +.ql-editor .ql-indent-1:not(.ql-direction-rtl) { + padding-left: 3em; +} +.ql-editor li.ql-indent-1:not(.ql-direction-rtl) { + padding-left: 4.5em; +} +.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 3em; +} +.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 4.5em; +} +.ql-editor .ql-indent-2:not(.ql-direction-rtl) { + padding-left: 6em; +} +.ql-editor li.ql-indent-2:not(.ql-direction-rtl) { + padding-left: 7.5em; +} +.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 6em; +} +.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 7.5em; +} +.ql-editor .ql-indent-3:not(.ql-direction-rtl) { + padding-left: 9em; +} +.ql-editor li.ql-indent-3:not(.ql-direction-rtl) { + padding-left: 10.5em; +} +.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 9em; +} +.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 10.5em; +} +.ql-editor .ql-indent-4:not(.ql-direction-rtl) { + padding-left: 12em; +} +.ql-editor li.ql-indent-4:not(.ql-direction-rtl) { + padding-left: 13.5em; +} +.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 12em; +} +.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 13.5em; +} +.ql-editor .ql-indent-5:not(.ql-direction-rtl) { + padding-left: 15em; +} +.ql-editor li.ql-indent-5:not(.ql-direction-rtl) { + padding-left: 16.5em; +} +.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 15em; +} +.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 16.5em; +} +.ql-editor .ql-indent-6:not(.ql-direction-rtl) { + padding-left: 18em; +} +.ql-editor li.ql-indent-6:not(.ql-direction-rtl) { + padding-left: 19.5em; +} +.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 18em; +} +.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 19.5em; +} +.ql-editor .ql-indent-7:not(.ql-direction-rtl) { + padding-left: 21em; +} +.ql-editor li.ql-indent-7:not(.ql-direction-rtl) { + padding-left: 22.5em; +} +.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 21em; +} +.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 22.5em; +} +.ql-editor .ql-indent-8:not(.ql-direction-rtl) { + padding-left: 24em; +} +.ql-editor li.ql-indent-8:not(.ql-direction-rtl) { + padding-left: 25.5em; +} +.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 24em; +} +.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 25.5em; +} +.ql-editor .ql-indent-9:not(.ql-direction-rtl) { + padding-left: 27em; +} +.ql-editor li.ql-indent-9:not(.ql-direction-rtl) { + padding-left: 28.5em; +} +.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 27em; +} +.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 28.5em; +} +.ql-editor .ql-video { + display: block; + max-width: 100%; +} +.ql-editor .ql-video.ql-align-center { + margin: 0 auto; +} +.ql-editor .ql-video.ql-align-right { + margin: 0 0 0 auto; +} +.ql-editor .ql-bg-black { + background-color: #000; +} +.ql-editor .ql-bg-red { + background-color: #e60000; +} +.ql-editor .ql-bg-orange { + background-color: #f90; +} +.ql-editor .ql-bg-yellow { + background-color: #ff0; +} +.ql-editor .ql-bg-green { + background-color: #008a00; +} +.ql-editor .ql-bg-blue { + background-color: #06c; +} +.ql-editor .ql-bg-purple { + background-color: #93f; +} +.ql-editor .ql-color-white { + color: #fff; +} +.ql-editor .ql-color-red { + color: #e60000; +} +.ql-editor .ql-color-orange { + color: #f90; +} +.ql-editor .ql-color-yellow { + color: #ff0; +} +.ql-editor .ql-color-green { + color: #008a00; +} +.ql-editor .ql-color-blue { + color: #06c; +} +.ql-editor .ql-color-purple { + color: #93f; +} +.ql-editor .ql-font-serif { + font-family: Georgia, Times New Roman, serif; +} +.ql-editor .ql-font-monospace { + font-family: Monaco, Courier New, monospace; +} +.ql-editor .ql-size-small { + font-size: 0.75em; +} +.ql-editor .ql-size-large { + font-size: 1.5em; +} +.ql-editor .ql-size-huge { + font-size: 2.5em; +} +.ql-editor .ql-direction-rtl { + direction: rtl; + text-align: inherit; +} +.ql-editor .ql-align-center { + text-align: center; +} +.ql-editor .ql-align-justify { + text-align: justify; +} +.ql-editor .ql-align-right { + text-align: right; +} +.ql-editor.ql-blank::before { + color: rgba(0,0,0,0.6); + content: attr(data-placeholder); + font-style: italic; + left: 15px; + pointer-events: none; + position: absolute; + right: 15px; +} +.ql-snow.ql-toolbar:after, +.ql-snow .ql-toolbar:after { + clear: both; + content: ''; + display: table; +} +.ql-snow.ql-toolbar button, +.ql-snow .ql-toolbar button { + background: none; + border: none; + cursor: pointer; + display: inline-block; + float: left; + height: 24px; + padding: 3px 5px; + width: 28px; +} +.ql-snow.ql-toolbar button svg, +.ql-snow .ql-toolbar button svg { + float: left; + height: 100%; +} +.ql-snow.ql-toolbar button:active:hover, +.ql-snow .ql-toolbar button:active:hover { + outline: none; +} +.ql-snow.ql-toolbar input.ql-image[type=file], +.ql-snow .ql-toolbar input.ql-image[type=file] { + display: none; +} +.ql-snow.ql-toolbar button:hover, +.ql-snow .ql-toolbar button:hover, +.ql-snow.ql-toolbar button:focus, +.ql-snow .ql-toolbar button:focus, +.ql-snow.ql-toolbar button.ql-active, +.ql-snow .ql-toolbar button.ql-active, +.ql-snow.ql-toolbar .ql-picker-label:hover, +.ql-snow .ql-toolbar .ql-picker-label:hover, +.ql-snow.ql-toolbar .ql-picker-label.ql-active, +.ql-snow .ql-toolbar .ql-picker-label.ql-active, +.ql-snow.ql-toolbar .ql-picker-item:hover, +.ql-snow .ql-toolbar .ql-picker-item:hover, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected { + color: #06c; +} +.ql-snow.ql-toolbar button:hover .ql-fill, +.ql-snow .ql-toolbar button:hover .ql-fill, +.ql-snow.ql-toolbar button:focus .ql-fill, +.ql-snow .ql-toolbar button:focus .ql-fill, +.ql-snow.ql-toolbar button.ql-active .ql-fill, +.ql-snow .ql-toolbar button.ql-active .ql-fill, +.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill, +.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill, +.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill { + fill: #06c; +} +.ql-snow.ql-toolbar button:hover .ql-stroke, +.ql-snow .ql-toolbar button:hover .ql-stroke, +.ql-snow.ql-toolbar button:focus .ql-stroke, +.ql-snow .ql-toolbar button:focus .ql-stroke, +.ql-snow.ql-toolbar button.ql-active .ql-stroke, +.ql-snow .ql-toolbar button.ql-active .ql-stroke, +.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-snow.ql-toolbar button:hover .ql-stroke-miter, +.ql-snow .ql-toolbar button:hover .ql-stroke-miter, +.ql-snow.ql-toolbar button:focus .ql-stroke-miter, +.ql-snow .ql-toolbar button:focus .ql-stroke-miter, +.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter, +.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter, +.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter { + stroke: #06c; +} +@media (pointer: coarse) { + .ql-snow.ql-toolbar button:hover:not(.ql-active), + .ql-snow .ql-toolbar button:hover:not(.ql-active) { + color: #444; + } + .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill, + .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill { + fill: #444; + } + .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter, + .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter { + stroke: #444; + } +} +.ql-snow { + box-sizing: border-box; +} +.ql-snow * { + box-sizing: border-box; +} +.ql-snow .ql-hidden { + display: none; +} +.ql-snow .ql-out-bottom, +.ql-snow .ql-out-top { + visibility: hidden; +} +.ql-snow .ql-tooltip { + position: absolute; + transform: translateY(10px); +} +.ql-snow .ql-tooltip a { + cursor: pointer; + text-decoration: none; +} +.ql-snow .ql-tooltip.ql-flip { + transform: translateY(-10px); +} +.ql-snow .ql-formats { + display: inline-block; + vertical-align: middle; +} +.ql-snow .ql-formats:after { + clear: both; + content: ''; + display: table; +} +.ql-snow .ql-stroke { + fill: none; + stroke: #444; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 2; +} +.ql-snow .ql-stroke-miter { + fill: none; + stroke: #444; + stroke-miterlimit: 10; + stroke-width: 2; +} +.ql-snow .ql-fill, +.ql-snow .ql-stroke.ql-fill { + fill: #444; +} +.ql-snow .ql-empty { + fill: none; +} +.ql-snow .ql-even { + fill-rule: evenodd; +} +.ql-snow .ql-thin, +.ql-snow .ql-stroke.ql-thin { + stroke-width: 1; +} +.ql-snow .ql-transparent { + opacity: 0.4; +} +.ql-snow .ql-direction svg:last-child { + display: none; +} +.ql-snow .ql-direction.ql-active svg:last-child { + display: inline; +} +.ql-snow .ql-direction.ql-active svg:first-child { + display: none; +} +.ql-snow .ql-editor h1 { + font-size: 2em; +} +.ql-snow .ql-editor h2 { + font-size: 1.5em; +} +.ql-snow .ql-editor h3 { + font-size: 1.17em; +} +.ql-snow .ql-editor h4 { + font-size: 1em; +} +.ql-snow .ql-editor h5 { + font-size: 0.83em; +} +.ql-snow .ql-editor h6 { + font-size: 0.67em; +} +.ql-snow .ql-editor a { + text-decoration: underline; +} +.ql-snow .ql-editor blockquote { + border-left: 4px solid #ccc; + margin-bottom: 5px; + margin-top: 5px; + padding-left: 16px; +} +.ql-snow .ql-editor code, +.ql-snow .ql-editor pre { + background-color: #f0f0f0; + border-radius: 3px; +} +.ql-snow .ql-editor pre { + white-space: pre-wrap; + margin-bottom: 5px; + margin-top: 5px; + padding: 5px 10px; +} +.ql-snow .ql-editor code { + font-size: 85%; + padding: 2px 4px; +} +.ql-snow .ql-editor pre.ql-syntax { + background-color: #23241f; + color: #f8f8f2; + overflow: visible; +} +.ql-snow .ql-editor img { + max-width: 100%; +} +.ql-snow .ql-picker { + color: #444; + display: inline-block; + float: left; + font-size: 14px; + font-weight: 500; + height: 24px; + position: relative; + vertical-align: middle; +} +.ql-snow .ql-picker-label { + cursor: pointer; + display: inline-block; + height: 100%; + padding-left: 8px; + padding-right: 2px; + position: relative; + width: 100%; +} +.ql-snow .ql-picker-label::before { + display: inline-block; + line-height: 22px; +} +.ql-snow .ql-picker-options { + background-color: #fff; + display: none; + min-width: 100%; + padding: 4px 8px; + position: absolute; + white-space: nowrap; +} +.ql-snow .ql-picker-options .ql-picker-item { + cursor: pointer; + display: block; + padding-bottom: 5px; + padding-top: 5px; +} +.ql-snow .ql-picker.ql-expanded .ql-picker-label { + color: #ccc; + z-index: 2; +} +.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill { + fill: #ccc; +} +.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke { + stroke: #ccc; +} +.ql-snow .ql-picker.ql-expanded .ql-picker-options { + display: block; + margin-top: -1px; + top: 100%; + z-index: 1; +} +.ql-snow .ql-color-picker, +.ql-snow .ql-icon-picker { + width: 28px; +} +.ql-snow .ql-color-picker .ql-picker-label, +.ql-snow .ql-icon-picker .ql-picker-label { + padding: 2px 4px; +} +.ql-snow .ql-color-picker .ql-picker-label svg, +.ql-snow .ql-icon-picker .ql-picker-label svg { + right: 4px; +} +.ql-snow .ql-icon-picker .ql-picker-options { + padding: 4px 0px; +} +.ql-snow .ql-icon-picker .ql-picker-item { + height: 24px; + width: 24px; + padding: 2px 4px; +} +.ql-snow .ql-color-picker .ql-picker-options { + padding: 3px 5px; + width: 152px; +} +.ql-snow .ql-color-picker .ql-picker-item { + border: 1px solid transparent; + float: left; + height: 16px; + margin: 2px; + padding: 0px; + width: 16px; +} +.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg { + position: absolute; + margin-top: -9px; + right: 0; + top: 50%; + width: 18px; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before { + content: attr(data-label); +} +.ql-snow .ql-picker.ql-header { + width: 98px; +} +.ql-snow .ql-picker.ql-header .ql-picker-label::before, +.ql-snow .ql-picker.ql-header .ql-picker-item::before { + content: 'Normal'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + content: 'Heading 1'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + content: 'Heading 2'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + content: 'Heading 3'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + content: 'Heading 4'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + content: 'Heading 5'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + content: 'Heading 6'; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + font-size: 2em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + font-size: 1.5em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + font-size: 1.17em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + font-size: 1em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + font-size: 0.83em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + font-size: 0.67em; +} +.ql-snow .ql-picker.ql-font { + width: 108px; +} +.ql-snow .ql-picker.ql-font .ql-picker-label::before, +.ql-snow .ql-picker.ql-font .ql-picker-item::before { + content: 'Sans Serif'; +} +.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before, +.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + content: 'Serif'; +} +.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before, +.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + content: 'Monospace'; +} +.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + font-family: Georgia, Times New Roman, serif; +} +.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + font-family: Monaco, Courier New, monospace; +} +.ql-snow .ql-picker.ql-size { + width: 98px; +} +.ql-snow .ql-picker.ql-size .ql-picker-label::before, +.ql-snow .ql-picker.ql-size .ql-picker-item::before { + content: 'Normal'; +} +.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before, +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + content: 'Small'; +} +.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before, +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + content: 'Large'; +} +.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before, +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + content: 'Huge'; +} +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + font-size: 10px; +} +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + font-size: 18px; +} +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + font-size: 32px; +} +.ql-snow .ql-color-picker.ql-background .ql-picker-item { + background-color: #fff; +} +.ql-snow .ql-color-picker.ql-color .ql-picker-item { + background-color: #000; +} +.ql-toolbar.ql-snow { + border: 1px solid #ccc; + box-sizing: border-box; + font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; + padding: 8px; +} +.ql-toolbar.ql-snow .ql-formats { + margin-right: 15px; +} +.ql-toolbar.ql-snow .ql-picker-label { + border: 1px solid transparent; +} +.ql-toolbar.ql-snow .ql-picker-options { + border: 1px solid transparent; + box-shadow: rgba(0,0,0,0.2) 0 2px 8px; +} +.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label { + border-color: #ccc; +} +.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options { + border-color: #ccc; +} +.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected, +.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover { + border-color: #000; +} +.ql-toolbar.ql-snow + .ql-container.ql-snow { + border-top: 0px; +} +.ql-snow .ql-tooltip { + background-color: #fff; + border: 1px solid #ccc; + box-shadow: 0px 0px 5px #ddd; + color: #444; + padding: 5px 12px; + white-space: nowrap; +} +.ql-snow .ql-tooltip::before { + content: "Visit URL:"; + line-height: 26px; + margin-right: 8px; +} +.ql-snow .ql-tooltip input[type=text] { + display: none; + border: 1px solid #ccc; + font-size: 13px; + height: 26px; + margin: 0px; + padding: 3px 5px; + width: 170px; +} +.ql-snow .ql-tooltip a.ql-preview { + display: inline-block; + max-width: 200px; + overflow-x: hidden; + text-overflow: ellipsis; + vertical-align: top; +} +.ql-snow .ql-tooltip a.ql-action::after { + border-right: 1px solid #ccc; + content: 'Edit'; + margin-left: 16px; + padding-right: 8px; +} +.ql-snow .ql-tooltip a.ql-remove::before { + content: 'Remove'; + margin-left: 8px; +} +.ql-snow .ql-tooltip a { + line-height: 26px; +} +.ql-snow .ql-tooltip.ql-editing a.ql-preview, +.ql-snow .ql-tooltip.ql-editing a.ql-remove { + display: none; +} +.ql-snow .ql-tooltip.ql-editing input[type=text] { + display: inline-block; +} +.ql-snow .ql-tooltip.ql-editing a.ql-action::after { + border-right: 0px; + content: 'Save'; + padding-right: 0px; +} +.ql-snow .ql-tooltip[data-mode=link]::before { + content: "Enter link:"; +} +.ql-snow .ql-tooltip[data-mode=formula]::before { + content: "Enter formula:"; +} +.ql-snow .ql-tooltip[data-mode=video]::before { + content: "Enter video:"; +} +.ql-snow a { + color: #06c; +} +.ql-container.ql-snow { + border: 1px solid #ccc; +} diff -Nru bibledit-5.0.912/quill/quill.bubble.css bibledit-5.0.922/quill/quill.bubble.css --- bibledit-5.0.912/quill/quill.bubble.css 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/quill/quill.bubble.css 2018-03-12 06:39:22.000000000 +0000 @@ -1,36 +1,8 @@ /*! - * Quill Editor v1.1.5 + * Quill Editor v1.3.6 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ .ql-container { box-sizing: border-box; @@ -43,6 +15,9 @@ .ql-container.ql-disabled .ql-tooltip { visibility: hidden; } +.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before { + pointer-events: none; +} .ql-clipboard { left: -100000px; height: 1px; @@ -56,7 +31,6 @@ } .ql-editor { box-sizing: border-box; - cursor: text; line-height: 1.42; height: 100%; outline: none; @@ -68,6 +42,9 @@ white-space: pre-wrap; word-wrap: break-word; } +.ql-editor > * { + cursor: text; +} .ql-editor p, .ql-editor ol, .ql-editor ul, @@ -92,28 +69,56 @@ list-style-type: none; } .ql-editor ul > li::before { - content: '\25CF'; + content: '\2022'; +} +.ql-editor ul[data-checked=true], +.ql-editor ul[data-checked=false] { + pointer-events: none; +} +.ql-editor ul[data-checked=true] > li *, +.ql-editor ul[data-checked=false] > li * { + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before, +.ql-editor ul[data-checked=false] > li::before { + color: #777; + cursor: pointer; + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before { + content: '\2611'; +} +.ql-editor ul[data-checked=false] > li::before { + content: '\2610'; } .ql-editor li::before { display: inline-block; - margin-right: 0.3em; - text-align: right; white-space: nowrap; width: 1.2em; } .ql-editor li:not(.ql-direction-rtl)::before { margin-left: -1.5em; + margin-right: 0.3em; + text-align: right; +} +.ql-editor li.ql-direction-rtl::before { + margin-left: 0.3em; + margin-right: -1.5em; } -.ql-editor ol li, -.ql-editor ul li { +.ql-editor ol li:not(.ql-direction-rtl), +.ql-editor ul li:not(.ql-direction-rtl) { padding-left: 1.5em; } +.ql-editor ol li.ql-direction-rtl, +.ql-editor ul li.ql-direction-rtl { + padding-right: 1.5em; +} .ql-editor ol li { counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; - counter-increment: list-num; + counter-increment: list-0; } .ql-editor ol li:before { - content: counter(list-num, decimal) '. '; + content: counter(list-0, decimal) '. '; } .ql-editor ol li.ql-indent-1 { counter-increment: list-1; @@ -385,8 +390,10 @@ color: rgba(0,0,0,0.6); content: attr(data-placeholder); font-style: italic; + left: 15px; pointer-events: none; position: absolute; + right: 15px; } .ql-bubble.ql-toolbar:after, .ql-bubble .ql-toolbar:after { @@ -410,12 +417,18 @@ float: left; height: 100%; } +.ql-bubble.ql-toolbar button:active:hover, +.ql-bubble .ql-toolbar button:active:hover { + outline: none; +} .ql-bubble.ql-toolbar input.ql-image[type=file], .ql-bubble .ql-toolbar input.ql-image[type=file] { display: none; } .ql-bubble.ql-toolbar button:hover, .ql-bubble .ql-toolbar button:hover, +.ql-bubble.ql-toolbar button:focus, +.ql-bubble .ql-toolbar button:focus, .ql-bubble.ql-toolbar button.ql-active, .ql-bubble .ql-toolbar button.ql-active, .ql-bubble.ql-toolbar .ql-picker-label:hover, @@ -430,6 +443,8 @@ } .ql-bubble.ql-toolbar button:hover .ql-fill, .ql-bubble .ql-toolbar button:hover .ql-fill, +.ql-bubble.ql-toolbar button:focus .ql-fill, +.ql-bubble .ql-toolbar button:focus .ql-fill, .ql-bubble.ql-toolbar button.ql-active .ql-fill, .ql-bubble .ql-toolbar button.ql-active .ql-fill, .ql-bubble.ql-toolbar .ql-picker-label:hover .ql-fill, @@ -442,6 +457,8 @@ .ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-fill, .ql-bubble.ql-toolbar button:hover .ql-stroke.ql-fill, .ql-bubble .ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar button:focus .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar button:focus .ql-stroke.ql-fill, .ql-bubble.ql-toolbar button.ql-active .ql-stroke.ql-fill, .ql-bubble .ql-toolbar button.ql-active .ql-stroke.ql-fill, .ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, @@ -456,6 +473,8 @@ } .ql-bubble.ql-toolbar button:hover .ql-stroke, .ql-bubble .ql-toolbar button:hover .ql-stroke, +.ql-bubble.ql-toolbar button:focus .ql-stroke, +.ql-bubble .ql-toolbar button:focus .ql-stroke, .ql-bubble.ql-toolbar button.ql-active .ql-stroke, .ql-bubble .ql-toolbar button.ql-active .ql-stroke, .ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke, @@ -468,6 +487,8 @@ .ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke, .ql-bubble.ql-toolbar button:hover .ql-stroke-miter, .ql-bubble .ql-toolbar button:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar button:focus .ql-stroke-miter, +.ql-bubble .ql-toolbar button:focus .ql-stroke-miter, .ql-bubble.ql-toolbar button.ql-active .ql-stroke-miter, .ql-bubble .ql-toolbar button.ql-active .ql-stroke-miter, .ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke-miter, @@ -480,6 +501,24 @@ .ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter { stroke: #fff; } +@media (pointer: coarse) { + .ql-bubble.ql-toolbar button:hover:not(.ql-active), + .ql-bubble .ql-toolbar button:hover:not(.ql-active) { + color: #ccc; + } + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill { + fill: #ccc; + } + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter { + stroke: #ccc; + } +} .ql-bubble { box-sizing: border-box; } @@ -495,11 +534,15 @@ } .ql-bubble .ql-tooltip { position: absolute; + transform: translateY(10px); } .ql-bubble .ql-tooltip a { cursor: pointer; text-decoration: none; } +.ql-bubble .ql-tooltip.ql-flip { + transform: translateY(-10px); +} .ql-bubble .ql-formats { display: inline-block; vertical-align: middle; @@ -588,13 +631,7 @@ } .ql-bubble .ql-editor code { font-size: 85%; - padding-bottom: 2px; - padding-top: 2px; -} -.ql-bubble .ql-editor code:before, -.ql-bubble .ql-editor code:after { - content: "\A0"; - letter-spacing: -2px; + padding: 2px 4px; } .ql-bubble .ql-editor pre.ql-syntax { background-color: #23241f; @@ -825,10 +862,8 @@ background-color: #444; border-radius: 25px; color: #fff; - margin-top: 10px; } .ql-bubble .ql-tooltip-arrow { - border-bottom: 6px solid #444; border-left: 6px solid transparent; border-right: 6px solid transparent; content: " "; @@ -836,8 +871,15 @@ left: 50%; margin-left: -6px; position: absolute; +} +.ql-bubble .ql-tooltip:not(.ql-flip) .ql-tooltip-arrow { + border-bottom: 6px solid #444; top: -6px; } +.ql-bubble .ql-tooltip.ql-flip .ql-tooltip-arrow { + border-top: 6px solid #444; + bottom: -6px; +} .ql-bubble .ql-tooltip.ql-editing .ql-tooltip-editor { display: block; } @@ -869,3 +911,42 @@ font-size: 16px; font-weight: bold; } +.ql-container.ql-bubble:not(.ql-disabled) a { + position: relative; + white-space: nowrap; +} +.ql-container.ql-bubble:not(.ql-disabled) a::before { + background-color: #444; + border-radius: 15px; + top: -5px; + font-size: 12px; + color: #fff; + content: attr(href); + font-weight: normal; + overflow: hidden; + padding: 5px 15px; + text-decoration: none; + z-index: 1; +} +.ql-container.ql-bubble:not(.ql-disabled) a::after { + border-top: 6px solid #444; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + top: 0; + content: " "; + height: 0; + width: 0; +} +.ql-container.ql-bubble:not(.ql-disabled) a::before, +.ql-container.ql-bubble:not(.ql-disabled) a::after { + left: 0; + margin-left: 50%; + position: absolute; + transform: translate(-50%, -100%); + transition: visibility 0s ease 200ms; + visibility: hidden; +} +.ql-container.ql-bubble:not(.ql-disabled) a:hover::before, +.ql-container.ql-bubble:not(.ql-disabled) a:hover::after { + visibility: visible; +} diff -Nru bibledit-5.0.912/quill/quill.core.css bibledit-5.0.922/quill/quill.core.css --- bibledit-5.0.912/quill/quill.core.css 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/quill/quill.core.css 2018-03-12 06:39:22.000000000 +0000 @@ -1,36 +1,8 @@ /*! - * Quill Editor v1.1.5 + * Quill Editor v1.3.6 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ .ql-container { box-sizing: border-box; @@ -43,6 +15,9 @@ .ql-container.ql-disabled .ql-tooltip { visibility: hidden; } +.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before { + pointer-events: none; +} .ql-clipboard { left: -100000px; height: 1px; @@ -56,7 +31,6 @@ } .ql-editor { box-sizing: border-box; - cursor: text; line-height: 1.42; height: 100%; outline: none; @@ -68,6 +42,9 @@ white-space: pre-wrap; word-wrap: break-word; } +.ql-editor > * { + cursor: text; +} .ql-editor p, .ql-editor ol, .ql-editor ul, @@ -92,28 +69,56 @@ list-style-type: none; } .ql-editor ul > li::before { - content: '\25CF'; + content: '\2022'; +} +.ql-editor ul[data-checked=true], +.ql-editor ul[data-checked=false] { + pointer-events: none; +} +.ql-editor ul[data-checked=true] > li *, +.ql-editor ul[data-checked=false] > li * { + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before, +.ql-editor ul[data-checked=false] > li::before { + color: #777; + cursor: pointer; + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before { + content: '\2611'; +} +.ql-editor ul[data-checked=false] > li::before { + content: '\2610'; } .ql-editor li::before { display: inline-block; - margin-right: 0.3em; - text-align: right; white-space: nowrap; width: 1.2em; } .ql-editor li:not(.ql-direction-rtl)::before { margin-left: -1.5em; + margin-right: 0.3em; + text-align: right; } -.ql-editor ol li, -.ql-editor ul li { +.ql-editor li.ql-direction-rtl::before { + margin-left: 0.3em; + margin-right: -1.5em; +} +.ql-editor ol li:not(.ql-direction-rtl), +.ql-editor ul li:not(.ql-direction-rtl) { padding-left: 1.5em; } +.ql-editor ol li.ql-direction-rtl, +.ql-editor ul li.ql-direction-rtl { + padding-right: 1.5em; +} .ql-editor ol li { counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; - counter-increment: list-num; + counter-increment: list-0; } .ql-editor ol li:before { - content: counter(list-num, decimal) '. '; + content: counter(list-0, decimal) '. '; } .ql-editor ol li.ql-indent-1 { counter-increment: list-1; @@ -385,6 +390,8 @@ color: rgba(0,0,0,0.6); content: attr(data-placeholder); font-style: italic; + left: 15px; pointer-events: none; position: absolute; + right: 15px; } diff -Nru bibledit-5.0.912/quill/quill.core.js bibledit-5.0.922/quill/quill.core.js --- bibledit-5.0.912/quill/quill.core.js 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/quill/quill.core.js 2018-03-12 06:39:22.000000000 +0000 @@ -1,36 +1,8 @@ /*! - * Quill Editor v1.1.5 + * Quill Editor v1.3.6 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') @@ -41,7869 +13,8510 @@ exports["Quill"] = factory(); else root["Quill"] = factory(); -})(this, function() { +})(typeof self !== 'undefined' ? self : this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; - +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { - +/******/ /******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) +/******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; - +/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} /******/ }; - +/******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - +/******/ /******/ // Flag the module as loaded -/******/ module.loaded = true; - +/******/ module.l = true; +/******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } - - +/******/ +/******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; - +/******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; - +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; - +/******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(0); +/******/ return __webpack_require__(__webpack_require__.s = 110); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = __webpack_require__(1); - - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; +/***/ (function(module, exports, __webpack_require__) { - var _parchment = __webpack_require__(2); +"use strict"; - var _parchment2 = _interopRequireDefault(_parchment); +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var format_1 = __webpack_require__(18); +var leaf_1 = __webpack_require__(19); +var scroll_1 = __webpack_require__(45); +var inline_1 = __webpack_require__(46); +var block_1 = __webpack_require__(47); +var embed_1 = __webpack_require__(48); +var text_1 = __webpack_require__(49); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(32); +var style_1 = __webpack_require__(33); +var store_1 = __webpack_require__(31); +var Registry = __webpack_require__(1); +var Parchment = { + Scope: Registry.Scope, + create: Registry.create, + find: Registry.find, + query: Registry.query, + register: Registry.register, + Container: container_1.default, + Format: format_1.default, + Leaf: leaf_1.default, + Embed: embed_1.default, + Scroll: scroll_1.default, + Block: block_1.default, + Inline: inline_1.default, + Text: text_1.default, + Attributor: { + Attribute: attributor_1.default, + Class: class_1.default, + Style: style_1.default, + Store: store_1.default, + }, +}; +exports.default = Parchment; - var _quill = __webpack_require__(18); - var _quill2 = _interopRequireDefault(_quill); +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { - var _block = __webpack_require__(29); +"use strict"; - var _block2 = _interopRequireDefault(_block); +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var ParchmentError = /** @class */ (function (_super) { + __extends(ParchmentError, _super); + function ParchmentError(message) { + var _this = this; + message = '[Parchment] ' + message; + _this = _super.call(this, message) || this; + _this.message = message; + _this.name = _this.constructor.name; + return _this; + } + return ParchmentError; +}(Error)); +exports.ParchmentError = ParchmentError; +var attributes = {}; +var classes = {}; +var tags = {}; +var types = {}; +exports.DATA_KEY = '__blot'; +var Scope; +(function (Scope) { + Scope[Scope["TYPE"] = 3] = "TYPE"; + Scope[Scope["LEVEL"] = 12] = "LEVEL"; + Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; + Scope[Scope["BLOT"] = 14] = "BLOT"; + Scope[Scope["INLINE"] = 7] = "INLINE"; + Scope[Scope["BLOCK"] = 11] = "BLOCK"; + Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; + Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; + Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; + Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; + Scope[Scope["ANY"] = 15] = "ANY"; +})(Scope = exports.Scope || (exports.Scope = {})); +function create(input, value) { + var match = query(input); + if (match == null) { + throw new ParchmentError("Unable to create " + input + " blot"); + } + var BlotClass = match; + var node = + // @ts-ignore + input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value); + return new BlotClass(node, value); +} +exports.create = create; +function find(node, bubble) { + if (bubble === void 0) { bubble = false; } + if (node == null) + return null; + // @ts-ignore + if (node[exports.DATA_KEY] != null) + return node[exports.DATA_KEY].blot; + if (bubble) + return find(node.parentNode, bubble); + return null; +} +exports.find = find; +function query(query, scope) { + if (scope === void 0) { scope = Scope.ANY; } + var match; + if (typeof query === 'string') { + match = types[query] || attributes[query]; + // @ts-ignore + } + else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) { + match = types['text']; + } + else if (typeof query === 'number') { + if (query & Scope.LEVEL & Scope.BLOCK) { + match = types['block']; + } + else if (query & Scope.LEVEL & Scope.INLINE) { + match = types['inline']; + } + } + else if (query instanceof HTMLElement) { + var names = (query.getAttribute('class') || '').split(/\s+/); + for (var i in names) { + match = classes[names[i]]; + if (match) + break; + } + match = match || tags[query.tagName]; + } + if (match == null) + return null; + // @ts-ignore + if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) + return match; + return null; +} +exports.query = query; +function register() { + var Definitions = []; + for (var _i = 0; _i < arguments.length; _i++) { + Definitions[_i] = arguments[_i]; + } + if (Definitions.length > 1) { + return Definitions.map(function (d) { + return register(d); + }); + } + var Definition = Definitions[0]; + if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { + throw new ParchmentError('Invalid definition'); + } + else if (Definition.blotName === 'abstract') { + throw new ParchmentError('Cannot register abstract class'); + } + types[Definition.blotName || Definition.attrName] = Definition; + if (typeof Definition.keyName === 'string') { + attributes[Definition.keyName] = Definition; + } + else { + if (Definition.className != null) { + classes[Definition.className] = Definition; + } + if (Definition.tagName != null) { + if (Array.isArray(Definition.tagName)) { + Definition.tagName = Definition.tagName.map(function (tagName) { + return tagName.toUpperCase(); + }); + } + else { + Definition.tagName = Definition.tagName.toUpperCase(); + } + var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; + tagNames.forEach(function (tag) { + if (tags[tag] == null || Definition.className == null) { + tags[tag] = Definition; + } + }); + } + } + return Definition; +} +exports.register = register; - var _break = __webpack_require__(31); - var _break2 = _interopRequireDefault(_break); +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { - var _container = __webpack_require__(46); +var diff = __webpack_require__(51); +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); +var op = __webpack_require__(20); + + +var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() + + +var Delta = function (ops) { + // Assume we are given a well formed ops + if (Array.isArray(ops)) { + this.ops = ops; + } else if (ops != null && Array.isArray(ops.ops)) { + this.ops = ops.ops; + } else { + this.ops = []; + } +}; + + +Delta.prototype.insert = function (text, attributes) { + var newOp = {}; + if (text.length === 0) return this; + newOp.insert = text; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype['delete'] = function (length) { + if (length <= 0) return this; + return this.push({ 'delete': length }); +}; + +Delta.prototype.retain = function (length, attributes) { + if (length <= 0) return this; + var newOp = { retain: length }; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype.push = function (newOp) { + var index = this.ops.length; + var lastOp = this.ops[index - 1]; + newOp = extend(true, {}, newOp); + if (typeof lastOp === 'object') { + if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { + this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; + return this; + } + // Since it does not matter if we insert before or after deleting at the same index, + // always prefer to insert first + if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { + index -= 1; + lastOp = this.ops[index - 1]; + if (typeof lastOp !== 'object') { + this.ops.unshift(newOp); + return this; + } + } + if (equal(newOp.attributes, lastOp.attributes)) { + if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { + this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { + this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } + } + } + if (index === this.ops.length) { + this.ops.push(newOp); + } else { + this.ops.splice(index, 0, newOp); + } + return this; +}; + +Delta.prototype.chop = function () { + var lastOp = this.ops[this.ops.length - 1]; + if (lastOp && lastOp.retain && !lastOp.attributes) { + this.ops.pop(); + } + return this; +}; + +Delta.prototype.filter = function (predicate) { + return this.ops.filter(predicate); +}; + +Delta.prototype.forEach = function (predicate) { + this.ops.forEach(predicate); +}; + +Delta.prototype.map = function (predicate) { + return this.ops.map(predicate); +}; + +Delta.prototype.partition = function (predicate) { + var passed = [], failed = []; + this.forEach(function(op) { + var target = predicate(op) ? passed : failed; + target.push(op); + }); + return [passed, failed]; +}; + +Delta.prototype.reduce = function (predicate, initial) { + return this.ops.reduce(predicate, initial); +}; + +Delta.prototype.changeLength = function () { + return this.reduce(function (length, elem) { + if (elem.insert) { + return length + op.length(elem); + } else if (elem.delete) { + return length - elem.delete; + } + return length; + }, 0); +}; + +Delta.prototype.length = function () { + return this.reduce(function (length, elem) { + return length + op.length(elem); + }, 0); +}; + +Delta.prototype.slice = function (start, end) { + start = start || 0; + if (typeof end !== 'number') end = Infinity; + var ops = []; + var iter = op.iterator(this.ops); + var index = 0; + while (index < end && iter.hasNext()) { + var nextOp; + if (index < start) { + nextOp = iter.next(start - index); + } else { + nextOp = iter.next(end - index); + ops.push(nextOp); + } + index += op.length(nextOp); + } + return new Delta(ops); +}; + + +Delta.prototype.compose = function (other) { + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else if (thisIter.peekType() === 'delete') { + delta.push(thisIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (typeof otherOp.retain === 'number') { + var newOp = {}; + if (typeof thisOp.retain === 'number') { + newOp.retain = length; + } else { + newOp.insert = thisOp.insert; + } + // Preserve null when composing with a retain, otherwise remove it for inserts + var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); + if (attributes) newOp.attributes = attributes; + delta.push(newOp); + // Other op should be delete, we could be an insert or retain + // Insert + delete cancels out + } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { + delta.push(otherOp); + } + } + } + return delta.chop(); +}; + +Delta.prototype.concat = function (other) { + var delta = new Delta(this.ops.slice()); + if (other.ops.length > 0) { + delta.push(other.ops[0]); + delta.ops = delta.ops.concat(other.ops.slice(1)); + } + return delta; +}; + +Delta.prototype.diff = function (other, index) { + if (this.ops === other.ops) { + return new Delta(); + } + var strings = [this, other].map(function (delta) { + return delta.map(function (op) { + if (op.insert != null) { + return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; + } + var prep = (delta === other) ? 'on' : 'with'; + throw new Error('diff() called ' + prep + ' non-document'); + }).join(''); + }); + var delta = new Delta(); + var diffResult = diff(strings[0], strings[1], index); + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + diffResult.forEach(function (component) { + var length = component[1].length; + while (length > 0) { + var opLength = 0; + switch (component[0]) { + case diff.INSERT: + opLength = Math.min(otherIter.peekLength(), length); + delta.push(otherIter.next(opLength)); + break; + case diff.DELETE: + opLength = Math.min(length, thisIter.peekLength()); + thisIter.next(opLength); + delta['delete'](opLength); + break; + case diff.EQUAL: + opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); + var thisOp = thisIter.next(opLength); + var otherOp = otherIter.next(opLength); + if (equal(thisOp.insert, otherOp.insert)) { + delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); + } else { + delta.push(otherOp)['delete'](opLength); + } + break; + } + length -= opLength; + } + }); + return delta.chop(); +}; + +Delta.prototype.eachLine = function (predicate, newline) { + newline = newline || '\n'; + var iter = op.iterator(this.ops); + var line = new Delta(); + var i = 0; + while (iter.hasNext()) { + if (iter.peekType() !== 'insert') return; + var thisOp = iter.peek(); + var start = op.length(thisOp) - iter.peekLength(); + var 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) === false) { + return; + } + i += 1; + line = new Delta(); + } + } + if (line.length() > 0) { + predicate(line, {}, i); + } +}; + +Delta.prototype.transform = function (other, priority) { + priority = !!priority; + if (typeof other === 'number') { + return this.transformPosition(other, priority); + } + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { + delta.retain(op.length(thisIter.next())); + } else if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (thisOp['delete']) { + // Our delete either makes their delete redundant or removes their retain + continue; + } else if (otherOp['delete']) { + delta.push(otherOp); + } else { + // We retain either their retain or insert + delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); + } + } + } + return delta.chop(); +}; + +Delta.prototype.transformPosition = function (index, priority) { + priority = !!priority; + var thisIter = op.iterator(this.ops); + var offset = 0; + while (thisIter.hasNext() && offset <= index) { + var length = thisIter.peekLength(); + var nextType = thisIter.peekType(); + thisIter.next(); + if (nextType === 'delete') { + index -= Math.min(length, index - offset); + continue; + } else if (nextType === 'insert' && (offset < index || !priority)) { + index += length; + } + offset += length; + } + return index; +}; - var _container2 = _interopRequireDefault(_container); - var _cursor = __webpack_require__(35); +module.exports = Delta; - var _cursor2 = _interopRequireDefault(_cursor); - var _embed = __webpack_require__(32); +/***/ }), +/* 3 */ +/***/ (function(module, exports) { - var _embed2 = _interopRequireDefault(_embed); +'use strict'; - var _inline = __webpack_require__(33); +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; - var _inline2 = _interopRequireDefault(_inline); +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } - var _scroll = __webpack_require__(47); + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); - var _scroll2 = _interopRequireDefault(_scroll); + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } - var _text = __webpack_require__(34); + // Return the modified object + return target; +}; - var _text2 = _interopRequireDefault(_text); - var _clipboard = __webpack_require__(48); +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { - var _clipboard2 = _interopRequireDefault(_clipboard); +"use strict"; - var _history = __webpack_require__(55); - var _history2 = _interopRequireDefault(_history); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; - var _keyboard = __webpack_require__(56); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var _keyboard2 = _interopRequireDefault(_keyboard); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _extend = __webpack_require__(3); - _quill2.default.register({ - 'blots/block': _block2.default, - 'blots/block/embed': _block.BlockEmbed, - 'blots/break': _break2.default, - 'blots/container': _container2.default, - 'blots/cursor': _cursor2.default, - 'blots/embed': _embed2.default, - 'blots/inline': _inline2.default, - 'blots/scroll': _scroll2.default, - 'blots/text': _text2.default, +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var NEWLINE_LENGTH = 1; + +var BlockEmbed = function (_Parchment$Embed) { + _inherits(BlockEmbed, _Parchment$Embed); + + function BlockEmbed() { + _classCallCheck(this, BlockEmbed); + + return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); + } + + _createClass(BlockEmbed, [{ + key: 'attach', + value: function attach() { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); + this.attributes = new _parchment2.default.Attributor.Store(this.domNode); + } + }, { + key: 'delta', + value: function delta() { + return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); + } + }, { + key: 'format', + value: function format(name, value) { + var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); + if (attribute != null) { + this.attributes.attribute(attribute, value); + } + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + this.format(name, value); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (typeof value === 'string' && value.endsWith('\n')) { + var block = _parchment2.default.create(Block.blotName); + this.parent.insertBefore(block, index === 0 ? this : this.next); + block.insertAt(0, value.slice(0, -1)); + } else { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); + } + } + }]); + + return BlockEmbed; +}(_parchment2.default.Embed); + +BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; +// It is important for cursor behavior BlockEmbeds use tags that are block level elements + + +var Block = function (_Parchment$Block) { + _inherits(Block, _Parchment$Block); + + function Block(domNode) { + _classCallCheck(this, Block); + + var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); + + _this2.cache = {}; + return _this2; + } + + _createClass(Block, [{ + key: 'delta', + value: function delta() { + if (this.cache.delta == null) { + this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { + if (leaf.length() === 0) { + return delta; + } else { + return delta.insert(leaf.value(), bubbleFormats(leaf)); + } + }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); + } + return this.cache.delta; + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); + this.cache = {}; + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length <= 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + if (index + length === this.length()) { + this.format(name, value); + } + } else { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); + } + this.cache = {}; + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); + if (value.length === 0) return; + var lines = value.split('\n'); + var text = lines.shift(); + if (text.length > 0) { + if (index < this.length() - 1 || this.children.tail == null) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); + } else { + this.children.tail.insertAt(this.children.tail.length(), text); + } + this.cache = {}; + } + var block = this; + lines.reduce(function (index, line) { + block = block.split(index, true); + block.insertAt(0, line); + return line.length; + }, index + text.length); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + var head = this.children.head; + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); + if (head instanceof _break2.default) { + head.remove(); + } + this.cache = {}; + } + }, { + key: 'length', + value: function length() { + if (this.cache.length == null) { + this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; + } + return this.cache.length; + } + }, { + key: 'moveChildren', + value: function moveChildren(target, ref) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); + this.cache = {}; + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context); + this.cache = {}; + } + }, { + key: 'path', + value: function path(index) { + return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); + } + }, { + key: 'removeChild', + value: function removeChild(child) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); + this.cache = {}; + } + }, { + key: 'split', + value: function split(index) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { + var clone = this.clone(); + if (index === 0) { + this.parent.insertBefore(clone, this); + return this; + } else { + this.parent.insertBefore(clone, this.next); + return clone; + } + } else { + var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); + this.cache = {}; + return next; + } + } + }]); + + return Block; +}(_parchment2.default.Block); + +Block.blotName = 'block'; +Block.tagName = 'P'; +Block.defaultChild = 'break'; +Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default]; + +function bubbleFormats(blot) { + var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (blot == null) return formats; + if (typeof blot.formats === 'function') { + formats = (0, _extend2.default)(formats, blot.formats()); + } + if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { + return formats; + } + return bubbleFormats(blot.parent, formats); +} + +exports.bubbleFormats = bubbleFormats; +exports.BlockEmbed = BlockEmbed; +exports.default = Block; - 'modules/clipboard': _clipboard2.default, - 'modules/history': _history2.default, - 'modules/keyboard': _keyboard2.default - }); +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { - _parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); +"use strict"; - module.exports = _quill2.default; -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.overload = exports.expandConfig = undefined; - "use strict"; - var container_1 = __webpack_require__(3); - var format_1 = __webpack_require__(7); - var leaf_1 = __webpack_require__(12); - var scroll_1 = __webpack_require__(13); - var inline_1 = __webpack_require__(14); - var block_1 = __webpack_require__(15); - var embed_1 = __webpack_require__(16); - var text_1 = __webpack_require__(17); - var attributor_1 = __webpack_require__(8); - var class_1 = __webpack_require__(10); - var style_1 = __webpack_require__(11); - var store_1 = __webpack_require__(9); - var Registry = __webpack_require__(6); - var Parchment = { - Scope: Registry.Scope, - create: Registry.create, - find: Registry.find, - query: Registry.query, - register: Registry.register, - Container: container_1.default, - Format: format_1.default, - Leaf: leaf_1.default, - Embed: embed_1.default, - Scroll: scroll_1.default, - Block: block_1.default, - Inline: inline_1.default, - Text: text_1.default, - Attributor: { - Attribute: attributor_1.default, - Class: class_1.default, - Style: style_1.default, - Store: store_1.default - } - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = Parchment; +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var linked_list_1 = __webpack_require__(4); - var shadow_1 = __webpack_require__(5); - var Registry = __webpack_require__(6); - var ContainerBlot = (function (_super) { - __extends(ContainerBlot, _super); - function ContainerBlot() { - _super.apply(this, arguments); - } - ContainerBlot.prototype.appendChild = function (other) { - this.insertBefore(other); - }; - ContainerBlot.prototype.attach = function () { - var _this = this; - _super.prototype.attach.call(this); - this.children = new linked_list_1.default(); - // Need to be reversed for if DOM nodes already in order - [].slice.call(this.domNode.childNodes).reverse().forEach(function (node) { - try { - var child = makeBlot(node); - _this.insertBefore(child, _this.children.head); - } - catch (err) { - if (err instanceof Registry.ParchmentError) - return; - else - throw err; - } - }); - }; - ContainerBlot.prototype.deleteAt = function (index, length) { - if (index === 0 && length === this.length()) { - return this.remove(); - } - this.children.forEachAt(index, length, function (child, offset, length) { - child.deleteAt(offset, length); - }); - }; - ContainerBlot.prototype.descendant = function (criteria, index) { - var _a = this.children.find(index), child = _a[0], offset = _a[1]; - if ((criteria.blotName == null && criteria(child)) || - (criteria.blotName != null && child instanceof criteria)) { - return [child, offset]; - } - else if (child instanceof ContainerBlot) { - return child.descendant(criteria, offset); - } - else { - return [null, -1]; - } - }; - ContainerBlot.prototype.descendants = function (criteria, index, length) { - if (index === void 0) { index = 0; } - if (length === void 0) { length = Number.MAX_VALUE; } - var descendants = [], lengthLeft = length; - this.children.forEachAt(index, length, function (child, index, length) { - if ((criteria.blotName == null && criteria(child)) || - (criteria.blotName != null && child instanceof criteria)) { - descendants.push(child); - } - if (child instanceof ContainerBlot) { - descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); - } - lengthLeft -= length; - }); - return descendants; - }; - ContainerBlot.prototype.detach = function () { - this.children.forEach(function (child) { - child.detach(); - }); - _super.prototype.detach.call(this); - }; - ContainerBlot.prototype.formatAt = function (index, length, name, value) { - this.children.forEachAt(index, length, function (child, offset, length) { - child.formatAt(offset, length, name, value); - }); - }; - ContainerBlot.prototype.insertAt = function (index, value, def) { - var _a = this.children.find(index), child = _a[0], offset = _a[1]; - if (child) { - child.insertAt(offset, value, def); - } - else { - var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def); - this.appendChild(blot); - } - }; - ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { - if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function (child) { - return childBlot instanceof child; - })) { - throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); - } - childBlot.insertInto(this, refBlot); - }; - ContainerBlot.prototype.length = function () { - return this.children.reduce(function (memo, child) { - return memo + child.length(); - }, 0); - }; - ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { - this.children.forEach(function (child) { - targetParent.insertBefore(child, refNode); - }); - }; - ContainerBlot.prototype.optimize = function () { - _super.prototype.optimize.call(this); - if (this.children.length === 0) { - if (this.statics.defaultChild != null) { - var child = Registry.create(this.statics.defaultChild); - this.appendChild(child); - child.optimize(); - } - else { - this.remove(); - } - } - }; - ContainerBlot.prototype.path = function (index, inclusive) { - if (inclusive === void 0) { inclusive = false; } - var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; - var position = [[this, index]]; - if (child instanceof ContainerBlot) { - return position.concat(child.path(offset, inclusive)); - } - else if (child != null) { - position.push([child, offset]); - } - return position; - }; - ContainerBlot.prototype.removeChild = function (child) { - this.children.remove(child); - }; - ContainerBlot.prototype.replace = function (target) { - if (target instanceof ContainerBlot) { - target.moveChildren(this); - } - _super.prototype.replace.call(this, target); - }; - ContainerBlot.prototype.split = function (index, force) { - if (force === void 0) { force = false; } - if (!force) { - if (index === 0) - return this; - if (index === this.length()) - return this.next; - } - var after = this.clone(); - this.parent.insertBefore(after, this.next); - this.children.forEachAt(index, this.length(), function (child, offset, length) { - child = child.split(offset, force); - after.appendChild(child); - }); - return after; - }; - ContainerBlot.prototype.unwrap = function () { - this.moveChildren(this.parent, this.next); - this.remove(); - }; - ContainerBlot.prototype.update = function (mutations) { - var _this = this; - var addedNodes = [], removedNodes = []; - mutations.forEach(function (mutation) { - if (mutation.target === _this.domNode && mutation.type === 'childList') { - addedNodes.push.apply(addedNodes, mutation.addedNodes); - removedNodes.push.apply(removedNodes, mutation.removedNodes); - } - }); - removedNodes.forEach(function (node) { - if (node.parentNode != null && - (document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY)) { - // Node has not actually been removed - return; - } - var blot = Registry.find(node); - if (blot == null) - return; - if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { - blot.detach(); - } - }); - addedNodes.filter(function (node) { - return node.parentNode == _this.domNode; - }).sort(function (a, b) { - if (a === b) - return 0; - if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { - return 1; - } - return -1; - }).forEach(function (node) { - var refBlot = null; - if (node.nextSibling != null) { - refBlot = Registry.find(node.nextSibling); - } - var blot = makeBlot(node); - if (blot.next != refBlot || blot.next == null) { - if (blot.parent != null) { - blot.parent.removeChild(_this); - } - _this.insertBefore(blot, refBlot); - } - }); - }; - return ContainerBlot; - }(shadow_1.default)); - function makeBlot(node) { - var blot = Registry.find(node); - if (blot == null) { - try { - blot = Registry.create(node); - } - catch (e) { - blot = Registry.create(Registry.Scope.INLINE); - [].slice.call(node.childNodes).forEach(function (child) { - blot.domNode.appendChild(child); - }); - node.parentNode.replaceChild(blot.domNode, node); - blot.attach(); - } - } - return blot; - } - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = ContainerBlot; +__webpack_require__(50); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _editor = __webpack_require__(14); + +var _editor2 = _interopRequireDefault(_editor); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _selection = __webpack_require__(15); + +var _selection2 = _interopRequireDefault(_selection); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _theme = __webpack_require__(34); + +var _theme2 = _interopRequireDefault(_theme); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill'); + +var Quill = function () { + _createClass(Quill, null, [{ + key: 'debug', + value: function debug(limit) { + if (limit === true) { + limit = 'log'; + } + _logger2.default.level(limit); + } + }, { + key: 'find', + value: function find(node) { + return node.__quill || _parchment2.default.find(node); + } + }, { + key: 'import', + value: function _import(name) { + if (this.imports[name] == null) { + debug.error('Cannot import ' + name + '. Are you sure it was registered?'); + } + return this.imports[name]; + } + }, { + key: 'register', + value: function register(path, target) { + var _this = this; + + var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (typeof path !== 'string') { + var name = path.attrName || path.blotName; + if (typeof name === 'string') { + // register(Blot | Attributor, overwrite) + this.register('formats/' + name, path, target); + } else { + Object.keys(path).forEach(function (key) { + _this.register(key, path[key], target); + }); + } + } else { + if (this.imports[path] != null && !overwrite) { + debug.warn('Overwriting ' + path + ' with', target); + } + this.imports[path] = target; + if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { + _parchment2.default.register(target); + } else if (path.startsWith('modules') && typeof target.register === 'function') { + target.register(); + } + } + } + }]); + + function Quill(container) { + var _this2 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Quill); + + this.options = expandConfig(container, options); + this.container = this.options.container; + if (this.container == null) { + return debug.error('Invalid Quill container', container); + } + if (this.options.debug) { + Quill.debug(this.options.debug); + } + var html = this.container.innerHTML.trim(); + this.container.classList.add('ql-container'); + this.container.innerHTML = ''; + this.container.__quill = this; + this.root = this.addContainer('ql-editor'); + this.root.classList.add('ql-blank'); + this.root.setAttribute('data-gramm', false); + this.scrollingContainer = this.options.scrollingContainer || this.root; + this.emitter = new _emitter4.default(); + this.scroll = _parchment2.default.create(this.root, { + emitter: this.emitter, + whitelist: this.options.formats + }); + this.editor = new _editor2.default(this.scroll); + this.selection = new _selection2.default(this.scroll, this.emitter); + this.theme = new this.options.theme(this, this.options); + this.keyboard = this.theme.addModule('keyboard'); + this.clipboard = this.theme.addModule('clipboard'); + this.history = this.theme.addModule('history'); + this.theme.init(); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { + if (type === _emitter4.default.events.TEXT_CHANGE) { + _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { + var range = _this2.selection.lastRange; + var index = range && range.length === 0 ? range.index : undefined; + modify.call(_this2, function () { + return _this2.editor.update(null, mutations, index); + }, source); + }); + var contents = this.clipboard.convert('
    ' + html + '


    '); + this.setContents(contents); + this.history.clear(); + if (this.options.placeholder) { + this.root.setAttribute('data-placeholder', this.options.placeholder); + } + if (this.options.readOnly) { + this.disable(); + } + } + + _createClass(Quill, [{ + key: 'addContainer', + value: function addContainer(container) { + var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (typeof container === 'string') { + var className = container; + container = document.createElement('div'); + container.classList.add(className); + } + this.container.insertBefore(container, refNode); + return container; + } + }, { + key: 'blur', + value: function blur() { + this.selection.setRange(null); + } + }, { + key: 'deleteText', + value: function deleteText(index, length, source) { + var _this3 = this; + + var _overload = overload(index, length, source); + + var _overload2 = _slicedToArray(_overload, 4); + + index = _overload2[0]; + length = _overload2[1]; + source = _overload2[3]; + + return modify.call(this, function () { + return _this3.editor.deleteText(index, length); + }, source, index, -1 * length); + } + }, { + key: 'disable', + value: function disable() { + this.enable(false); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.scroll.enable(enabled); + this.container.classList.toggle('ql-disabled', !enabled); + } + }, { + key: 'focus', + value: function focus() { + var scrollTop = this.scrollingContainer.scrollTop; + this.selection.focus(); + this.scrollingContainer.scrollTop = scrollTop; + this.scrollIntoView(); + } + }, { + key: 'format', + value: function format(name, value) { + var _this4 = this; + + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + return modify.call(this, function () { + var range = _this4.getSelection(true); + var change = new _quillDelta2.default(); + if (range == null) { + return change; + } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); + } else if (range.length === 0) { + _this4.selection.format(name, value); + return change; + } else { + change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); + } + _this4.setSelection(range, _emitter4.default.sources.SILENT); + return change; + }, source); + } + }, { + key: 'formatLine', + value: function formatLine(index, length, name, value, source) { + var _this5 = this; + + var formats = void 0; + + var _overload3 = overload(index, length, name, value, source); + + var _overload4 = _slicedToArray(_overload3, 4); + + index = _overload4[0]; + length = _overload4[1]; + formats = _overload4[2]; + source = _overload4[3]; + + return modify.call(this, function () { + return _this5.editor.formatLine(index, length, formats); + }, source, index, 0); + } + }, { + key: 'formatText', + value: function formatText(index, length, name, value, source) { + var _this6 = this; + + var formats = void 0; + + var _overload5 = overload(index, length, name, value, source); + + var _overload6 = _slicedToArray(_overload5, 4); + + index = _overload6[0]; + length = _overload6[1]; + formats = _overload6[2]; + source = _overload6[3]; + + return modify.call(this, function () { + return _this6.editor.formatText(index, length, formats); + }, source, index, 0); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var bounds = void 0; + if (typeof index === 'number') { + bounds = this.selection.getBounds(index, length); + } else { + bounds = this.selection.getBounds(index.index, index.length); + } + var containerBounds = this.container.getBoundingClientRect(); + return { + bottom: bounds.bottom - containerBounds.top, + height: bounds.height, + left: bounds.left - containerBounds.left, + right: bounds.right - containerBounds.left, + top: bounds.top - containerBounds.top, + width: bounds.width + }; + } + }, { + key: 'getContents', + value: function getContents() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload7 = overload(index, length); + + var _overload8 = _slicedToArray(_overload7, 2); + + index = _overload8[0]; + length = _overload8[1]; + + return this.editor.getContents(index, length); + } + }, { + key: 'getFormat', + value: function getFormat() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true); + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (typeof index === 'number') { + return this.editor.getFormat(index, length); + } else { + return this.editor.getFormat(index.index, index.length); + } + } + }, { + key: 'getIndex', + value: function getIndex(blot) { + return blot.offset(this.scroll); + } + }, { + key: 'getLength', + value: function getLength() { + return this.scroll.length(); + } + }, { + key: 'getLeaf', + value: function getLeaf(index) { + return this.scroll.leaf(index); + } + }, { + key: 'getLine', + value: function getLine(index) { + return this.scroll.line(index); + } + }, { + key: 'getLines', + value: function getLines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + if (typeof index !== 'number') { + return this.scroll.lines(index.index, index.length); + } else { + return this.scroll.lines(index, length); + } + } + }, { + key: 'getModule', + value: function getModule(name) { + return this.theme.modules[name]; + } + }, { + key: 'getSelection', + value: function getSelection() { + var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (focus) this.focus(); + this.update(); // Make sure we access getRange with editor in consistent state + return this.selection.getRange()[0]; + } + }, { + key: 'getText', + value: function getText() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload9 = overload(index, length); + + var _overload10 = _slicedToArray(_overload9, 2); + + index = _overload10[0]; + length = _overload10[1]; + + return this.editor.getText(index, length); + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return this.selection.hasFocus(); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + var _this7 = this; + + var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; + + return modify.call(this, function () { + return _this7.editor.insertEmbed(index, embed, value); + }, source, index); + } + }, { + key: 'insertText', + value: function insertText(index, text, name, value, source) { + var _this8 = this; + + var formats = void 0; + + var _overload11 = overload(index, 0, name, value, source); + + var _overload12 = _slicedToArray(_overload11, 4); + + index = _overload12[0]; + formats = _overload12[2]; + source = _overload12[3]; + + return modify.call(this, function () { + return _this8.editor.insertText(index, text, formats); + }, source, index, text.length); + } + }, { + key: 'isEnabled', + value: function isEnabled() { + return !this.container.classList.contains('ql-disabled'); + } + }, { + key: 'off', + value: function off() { + return this.emitter.off.apply(this.emitter, arguments); + } + }, { + key: 'on', + value: function on() { + return this.emitter.on.apply(this.emitter, arguments); + } + }, { + key: 'once', + value: function once() { + return this.emitter.once.apply(this.emitter, arguments); + } + }, { + key: 'pasteHTML', + value: function pasteHTML(index, html, source) { + this.clipboard.dangerouslyPasteHTML(index, html, source); + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length, source) { + var _this9 = this; + + var _overload13 = overload(index, length, source); + + var _overload14 = _slicedToArray(_overload13, 4); + + index = _overload14[0]; + length = _overload14[1]; + source = _overload14[3]; + + return modify.call(this, function () { + return _this9.editor.removeFormat(index, length); + }, source, index); + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView() { + this.selection.scrollIntoView(this.scrollingContainer); + } + }, { + key: 'setContents', + value: function setContents(delta) { + var _this10 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + var length = _this10.getLength(); + var deleted = _this10.editor.deleteText(0, length); + var applied = _this10.editor.applyDelta(delta); + var lastOp = applied.ops[applied.ops.length - 1]; + if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { + _this10.editor.deleteText(_this10.getLength() - 1, 1); + applied.delete(1); + } + var ret = deleted.compose(applied); + return ret; + }, source); + } + }, { + key: 'setSelection', + value: function setSelection(index, length, source) { + if (index == null) { + this.selection.setRange(null, length || Quill.sources.API); + } else { + var _overload15 = overload(index, length, source); + + var _overload16 = _slicedToArray(_overload15, 4); + + index = _overload16[0]; + length = _overload16[1]; + source = _overload16[3]; + + this.selection.setRange(new _selection.Range(index, length), source); + if (source !== _emitter4.default.sources.SILENT) { + this.selection.scrollIntoView(this.scrollingContainer); + } + } + } + }, { + key: 'setText', + value: function setText(text) { + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + var delta = new _quillDelta2.default().insert(text); + return this.setContents(delta, source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes + this.selection.update(source); + return change; + } + }, { + key: 'updateContents', + value: function updateContents(delta) { + var _this11 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + return _this11.editor.applyDelta(delta, source); + }, source, true); + } + }]); + + return Quill; +}(); + +Quill.DEFAULTS = { + bounds: null, + formats: null, + modules: {}, + placeholder: '', + readOnly: false, + scrollingContainer: null, + strict: true, + theme: 'default' +}; +Quill.events = _emitter4.default.events; +Quill.sources = _emitter4.default.sources; +// eslint-disable-next-line no-undef +Quill.version = false ? 'dev' : "1.3.6"; + +Quill.imports = { + 'delta': _quillDelta2.default, + 'parchment': _parchment2.default, + 'core/module': _module2.default, + 'core/theme': _theme2.default +}; + +function expandConfig(container, userConfig) { + userConfig = (0, _extend2.default)(true, { + container: container, + modules: { + clipboard: true, + keyboard: true, + history: true + } + }, userConfig); + if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { + userConfig.theme = _theme2.default; + } else { + userConfig.theme = Quill.import('themes/' + userConfig.theme); + if (userConfig.theme == null) { + throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); + } + } + var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); + [themeConfig, userConfig].forEach(function (config) { + config.modules = config.modules || {}; + Object.keys(config.modules).forEach(function (module) { + if (config.modules[module] === true) { + config.modules[module] = {}; + } + }); + }); + var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); + var moduleConfig = moduleNames.reduce(function (config, name) { + var moduleClass = Quill.import('modules/' + name); + if (moduleClass == null) { + debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); + } else { + config[name] = moduleClass.DEFAULTS || {}; + } + return config; + }, {}); + // Special case toolbar shorthand + if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { + userConfig.modules.toolbar = { + container: userConfig.modules.toolbar + }; + } + userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); + ['bounds', 'container', 'scrollingContainer'].forEach(function (key) { + if (typeof userConfig[key] === 'string') { + userConfig[key] = document.querySelector(userConfig[key]); + } + }); + userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { + if (userConfig.modules[name]) { + config[name] = userConfig.modules[name]; + } + return config; + }, {}); + return userConfig; +} + +// Handle selection preservation and TEXT_CHANGE emission +// common to modification APIs +function modify(modifier, source, index, shift) { + if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { + return new _quillDelta2.default(); + } + var range = index == null ? null : this.getSelection(); + var oldDelta = this.editor.delta; + var change = modifier(); + if (range != null) { + if (index === true) index = range.index; + if (shift == null) { + range = shiftRange(range, change, source); + } else if (shift !== 0) { + range = shiftRange(range, index, shift, source); + } + this.setSelection(range, _emitter4.default.sources.SILENT); + } + if (change.length() > 0) { + var _emitter; + + var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + return change; +} + +function overload(index, length, name, value, source) { + var formats = {}; + if (typeof index.index === 'number' && typeof index.length === 'number') { + // Allow for throwaway end (used by insertText/insertEmbed) + if (typeof length !== 'number') { + source = value, value = name, name = length, length = index.length, index = index.index; + } else { + length = index.length, index = index.index; + } + } else if (typeof length !== 'number') { + source = value, value = name, name = length, length = 0; + } + // Handle format being object, two format name/value strings or excluded + if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { + formats = name; + source = value; + } else if (typeof name === 'string') { + if (value != null) { + formats[name] = value; + } else { + source = name; + } + } + // Handle optional source + source = source || _emitter4.default.sources.API; + return [index, length, formats, source]; +} + +function shiftRange(range, index, length, source) { + if (range == null) return null; + var start = void 0, + end = void 0; + if (index instanceof _quillDelta2.default) { + var _map = [range.index, range.index + range.length].map(function (pos) { + return index.transformPosition(pos, source !== _emitter4.default.sources.USER); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + } else { + var _map3 = [range.index, range.index + range.length].map(function (pos) { + if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos; + if (length >= 0) { + return pos + length; + } else { + return Math.max(index, pos + length); + } + }); + + var _map4 = _slicedToArray(_map3, 2); + + start = _map4[0]; + end = _map4[1]; + } + return new _selection.Range(start, end - start); +} + +exports.expandConfig = expandConfig; +exports.overload = overload; +exports.default = Quill; +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 4 */ -/***/ function(module, exports) { +"use strict"; - "use strict"; - var LinkedList = (function () { - function LinkedList() { - this.head = this.tail = undefined; - this.length = 0; - } - LinkedList.prototype.append = function () { - var nodes = []; - for (var _i = 0; _i < arguments.length; _i++) { - nodes[_i - 0] = arguments[_i]; - } - this.insertBefore(nodes[0], undefined); - if (nodes.length > 1) { - this.append.apply(this, nodes.slice(1)); - } - }; - LinkedList.prototype.contains = function (node) { - var cur, next = this.iterator(); - while (cur = next()) { - if (cur === node) - return true; - } - return false; - }; - LinkedList.prototype.insertBefore = function (node, refNode) { - node.next = refNode; - if (refNode != null) { - node.prev = refNode.prev; - if (refNode.prev != null) { - refNode.prev.next = node; - } - refNode.prev = node; - if (refNode === this.head) { - this.head = node; - } - } - else if (this.tail != null) { - this.tail.next = node; - node.prev = this.tail; - this.tail = node; - } - else { - node.prev = undefined; - this.head = this.tail = node; - } - this.length += 1; - }; - LinkedList.prototype.offset = function (target) { - var index = 0, cur = this.head; - while (cur != null) { - if (cur === target) - return index; - index += cur.length(); - cur = cur.next; - } - return -1; - }; - LinkedList.prototype.remove = function (node) { - if (!this.contains(node)) - return; - if (node.prev != null) - node.prev.next = node.next; - if (node.next != null) - node.next.prev = node.prev; - if (node === this.head) - this.head = node.next; - if (node === this.tail) - this.tail = node.prev; - this.length -= 1; - }; - LinkedList.prototype.iterator = function (curNode) { - if (curNode === void 0) { curNode = this.head; } - // TODO use yield when we can - return function () { - var ret = curNode; - if (curNode != null) - curNode = curNode.next; - return ret; - }; - }; - LinkedList.prototype.find = function (index, inclusive) { - if (inclusive === void 0) { inclusive = false; } - var cur, next = this.iterator(); - while (cur = next()) { - var length_1 = cur.length(); - if (index < length_1 || (inclusive && index === length_1 && (cur.next == null || cur.next.length() !== 0))) { - return [cur, index]; - } - index -= length_1; - } - return [null, 0]; - }; - LinkedList.prototype.forEach = function (callback) { - var cur, next = this.iterator(); - while (cur = next()) { - callback(cur); - } - }; - LinkedList.prototype.forEachAt = function (index, length, callback) { - if (length <= 0) - return; - var _a = this.find(index), startNode = _a[0], offset = _a[1]; - var cur, curIndex = index - offset, next = this.iterator(startNode); - while ((cur = next()) && curIndex < index + length) { - var curLength = cur.length(); - if (index > curIndex) { - callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); - } - else { - callback(cur, 0, Math.min(curLength, index + length - curIndex)); - } - curIndex += curLength; - } - }; - LinkedList.prototype.map = function (callback) { - return this.reduce(function (memo, cur) { - memo.push(callback(cur)); - return memo; - }, []); - }; - LinkedList.prototype.reduce = function (callback, memo) { - var cur, next = this.iterator(); - while (cur = next()) { - memo = callback(memo, cur); - } - return memo; - }; - return LinkedList; - }()); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = LinkedList; +Object.defineProperty(exports, "__esModule", { + value: true +}); -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - "use strict"; - var Registry = __webpack_require__(6); - var ShadowBlot = (function () { - function ShadowBlot(domNode) { - this.domNode = domNode; - this.attach(); - } - Object.defineProperty(ShadowBlot.prototype, "statics", { - // Hack for accessing inherited static methods - get: function () { - return this.constructor; - }, - enumerable: true, - configurable: true - }); - ShadowBlot.create = function (value) { - if (this.tagName == null) { - throw new Registry.ParchmentError('Blot definition missing tagName'); - } - var node; - if (Array.isArray(this.tagName)) { - if (typeof value === 'string') { - value = value.toUpperCase(); - if (parseInt(value).toString() === value) { - value = parseInt(value); - } - } - if (typeof value === 'number') { - node = document.createElement(this.tagName[value - 1]); - } - else if (this.tagName.indexOf(value) > -1) { - node = document.createElement(value); - } - else { - node = document.createElement(this.tagName[0]); - } - } - else { - node = document.createElement(this.tagName); - } - if (this.className) { - node.classList.add(this.className); - } - return node; - }; - ShadowBlot.prototype.attach = function () { - this.domNode[Registry.DATA_KEY] = { blot: this }; - }; - ShadowBlot.prototype.clone = function () { - var domNode = this.domNode.cloneNode(); - return Registry.create(domNode); - }; - ShadowBlot.prototype.detach = function () { - if (this.parent != null) - this.parent.removeChild(this); - delete this.domNode[Registry.DATA_KEY]; - }; - ShadowBlot.prototype.deleteAt = function (index, length) { - var blot = this.isolate(index, length); - blot.remove(); - }; - ShadowBlot.prototype.formatAt = function (index, length, name, value) { - var blot = this.isolate(index, length); - if (Registry.query(name, Registry.Scope.BLOT) != null && value) { - blot.wrap(name, value); - } - else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { - var parent_1 = Registry.create(this.statics.scope); - blot.wrap(parent_1); - parent_1.format(name, value); - } - }; - ShadowBlot.prototype.insertAt = function (index, value, def) { - var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def); - var ref = this.split(index); - this.parent.insertBefore(blot, ref); - }; - ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { - if (this.parent != null) { - this.parent.children.remove(this); - } - parentBlot.children.insertBefore(this, refBlot); - if (refBlot != null) { - var refDomNode = refBlot.domNode; - } - if (this.next == null || this.domNode.nextSibling != refDomNode) { - parentBlot.domNode.insertBefore(this.domNode, refDomNode); - } - this.parent = parentBlot; - }; - ShadowBlot.prototype.isolate = function (index, length) { - var target = this.split(index); - target.split(length); - return target; - }; - ShadowBlot.prototype.length = function () { - return 1; - }; - ; - ShadowBlot.prototype.offset = function (root) { - if (root === void 0) { root = this.parent; } - if (this.parent == null || this == root) - return 0; - return this.parent.children.offset(this) + this.parent.offset(root); - }; - ShadowBlot.prototype.optimize = function () { - // TODO clean up once we use WeakMap - if (this.domNode[Registry.DATA_KEY] != null) { - delete this.domNode[Registry.DATA_KEY].mutations; - } - }; - ShadowBlot.prototype.remove = function () { - if (this.domNode.parentNode != null) { - this.domNode.parentNode.removeChild(this.domNode); - } - this.detach(); - }; - ShadowBlot.prototype.replace = function (target) { - if (target.parent == null) - return; - target.parent.insertBefore(this, target.next); - target.remove(); - }; - ShadowBlot.prototype.replaceWith = function (name, value) { - var replacement = typeof name === 'string' ? Registry.create(name, value) : name; - replacement.replace(this); - return replacement; - }; - ShadowBlot.prototype.split = function (index, force) { - return index === 0 ? this : this.next; - }; - ShadowBlot.prototype.update = function (mutations) { - if (mutations === void 0) { mutations = []; } - // Nothing to do by default - }; - ShadowBlot.prototype.wrap = function (name, value) { - var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; - if (this.parent != null) { - this.parent.insertBefore(wrapper, this.next); - } - wrapper.appendChild(this); - return wrapper; - }; - ShadowBlot.blotName = 'abstract'; - return ShadowBlot; - }()); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = ShadowBlot; +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +var _text = __webpack_require__(7); -/***/ }, -/* 6 */ -/***/ function(module, exports) { +var _text2 = _interopRequireDefault(_text); - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var ParchmentError = (function (_super) { - __extends(ParchmentError, _super); - function ParchmentError(message) { - message = '[Parchment] ' + message; - _super.call(this, message); - this.message = message; - this.name = this.constructor.name; - } - return ParchmentError; - }(Error)); - exports.ParchmentError = ParchmentError; - var attributes = {}; - var classes = {}; - var tags = {}; - var types = {}; - exports.DATA_KEY = '__blot'; - (function (Scope) { - Scope[Scope["TYPE"] = 3] = "TYPE"; - Scope[Scope["LEVEL"] = 12] = "LEVEL"; - Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; - Scope[Scope["BLOT"] = 14] = "BLOT"; - Scope[Scope["INLINE"] = 7] = "INLINE"; - Scope[Scope["BLOCK"] = 11] = "BLOCK"; - Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; - Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; - Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; - Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; - Scope[Scope["ANY"] = 15] = "ANY"; - })(exports.Scope || (exports.Scope = {})); - var Scope = exports.Scope; - ; - function create(input, value) { - var match = query(input); - if (match == null) { - throw new ParchmentError("Unable to create " + input + " blot"); - } - var BlotClass = match; - var node = input instanceof Node ? input : BlotClass.create(value); - return new BlotClass(node, value); - } - exports.create = create; - function find(node, bubble) { - if (bubble === void 0) { bubble = false; } - if (node == null) - return null; - if (node[exports.DATA_KEY] != null) - return node[exports.DATA_KEY].blot; - if (bubble) - return find(node.parentNode, bubble); - return null; - } - exports.find = find; - function query(query, scope) { - if (scope === void 0) { scope = Scope.ANY; } - var match; - if (typeof query === 'string') { - match = types[query] || attributes[query]; - } - else if (query instanceof Text) { - match = types['text']; - } - else if (typeof query === 'number') { - if (query & Scope.LEVEL & Scope.BLOCK) { - match = types['block']; - } - else if (query & Scope.LEVEL & Scope.INLINE) { - match = types['inline']; - } - } - else if (query instanceof HTMLElement) { - var names = (query.getAttribute('class') || '').split(/\s+/); - for (var i in names) { - match = classes[names[i]]; - if (match) - break; - } - match = match || tags[query.tagName]; - } - if (match == null) { - if (query instanceof Node) { - console.log(query.nodeType); - } - } - if (match == null) - return null; - if ((scope & Scope.LEVEL & match.scope) && (scope & Scope.TYPE & match.scope)) - return match; - return null; - } - exports.query = query; - function register() { - var Definitions = []; - for (var _i = 0; _i < arguments.length; _i++) { - Definitions[_i - 0] = arguments[_i]; - } - if (Definitions.length > 1) { - return Definitions.map(function (d) { - return register(d); - }); - } - var Definition = Definitions[0]; - if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { - throw new ParchmentError('Invalid definition'); - } - else if (Definition.blotName === 'abstract') { - throw new ParchmentError('Cannot register abstract class'); - } - types[Definition.blotName || Definition.attrName] = Definition; - if (typeof Definition.keyName === 'string') { - attributes[Definition.keyName] = Definition; - } - else { - if (Definition.className != null) { - classes[Definition.className] = Definition; - } - if (Definition.tagName != null) { - if (Array.isArray(Definition.tagName)) { - Definition.tagName = Definition.tagName.map(function (tagName) { - return tagName.toUpperCase(); - }); - } - else { - Definition.tagName = Definition.tagName.toUpperCase(); - } - var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; - tagNames.forEach(function (tag) { - if (tags[tag] == null || Definition.className == null) { - tags[tag] = Definition; - } - }); - } - } - return Definition; - } - exports.register = register; +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Inline = function (_Parchment$Inline) { + _inherits(Inline, _Parchment$Inline); + + function Inline() { + _classCallCheck(this, Inline); + + return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); + } + + _createClass(Inline, [{ + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { + var blot = this.isolate(index, length); + if (value) { + blot.wrap(name, value); + } + } else { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context); + if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { + var parent = this.parent.isolate(this.offset(), this.length()); + this.moveChildren(parent); + parent.wrap(this); + } + } + }], [{ + key: 'compare', + value: function compare(self, other) { + var selfIndex = Inline.order.indexOf(self); + var otherIndex = Inline.order.indexOf(other); + if (selfIndex >= 0 || otherIndex >= 0) { + return selfIndex - otherIndex; + } else if (self === other) { + return 0; + } else if (self < other) { + return -1; + } else { + return 1; + } + } + }]); + + return Inline; +}(_parchment2.default.Inline); + +Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default]; +// Lower index means deeper in the DOM tree, since not found (-1) is for embeds +Inline.order = ['cursor', 'inline', // Must be lower +'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher +]; +exports.default = Inline; -/***/ }, +/***/ }), /* 7 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var attributor_1 = __webpack_require__(8); - var store_1 = __webpack_require__(9); - var container_1 = __webpack_require__(3); - var Registry = __webpack_require__(6); - var FormatBlot = (function (_super) { - __extends(FormatBlot, _super); - function FormatBlot() { - _super.apply(this, arguments); - } - FormatBlot.formats = function (domNode) { - if (typeof this.tagName === 'string') { - return true; - } - else if (Array.isArray(this.tagName)) { - return domNode.tagName.toLowerCase(); - } - return undefined; - }; - FormatBlot.prototype.attach = function () { - _super.prototype.attach.call(this); - this.attributes = new store_1.default(this.domNode); - }; - FormatBlot.prototype.format = function (name, value) { - var format = Registry.query(name); - if (format instanceof attributor_1.default) { - this.attributes.attribute(format, value); - } - else if (value) { - if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { - this.replaceWith(name, value); - } - } - }; - FormatBlot.prototype.formats = function () { - var formats = this.attributes.values(); - var format = this.statics.formats(this.domNode); - if (format != null) { - formats[this.statics.blotName] = format; - } - return formats; - }; - FormatBlot.prototype.replaceWith = function (name, value) { - var replacement = _super.prototype.replaceWith.call(this, name, value); - this.attributes.copy(replacement); - return replacement; - }; - FormatBlot.prototype.update = function (mutations) { - var _this = this; - _super.prototype.update.call(this, mutations); - if (mutations.some(function (mutation) { - return mutation.target === _this.domNode && mutation.type === 'attributes'; - })) { - this.attributes.build(); - } - }; - FormatBlot.prototype.wrap = function (name, value) { - var wrapper = _super.prototype.wrap.call(this, name, value); - if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { - this.attributes.move(wrapper); - } - return wrapper; - }; - return FormatBlot; - }(container_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = FormatBlot; +"use strict"; -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { +Object.defineProperty(exports, "__esModule", { + value: true +}); - "use strict"; - var Registry = __webpack_require__(6); - var Attributor = (function () { - function Attributor(attrName, keyName, options) { - if (options === void 0) { options = {}; } - this.attrName = attrName; - this.keyName = keyName; - var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; - if (options.scope != null) { - // Ignore type bits, force attribute bit - this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; - } - else { - this.scope = Registry.Scope.ATTRIBUTE; - } - if (options.whitelist != null) - this.whitelist = options.whitelist; - } - Attributor.keys = function (node) { - return [].map.call(node.attributes, function (item) { - return item.name; - }); - }; - Attributor.prototype.add = function (node, value) { - if (!this.canAdd(node, value)) - return false; - node.setAttribute(this.keyName, value); - return true; - }; - Attributor.prototype.canAdd = function (node, value) { - var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); - if (match != null && (this.whitelist == null || this.whitelist.indexOf(value) > -1)) { - return true; - } - return false; - }; - Attributor.prototype.remove = function (node) { - node.removeAttribute(this.keyName); - }; - Attributor.prototype.value = function (node) { - return node.getAttribute(this.keyName); - }; - return Attributor; - }()); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = Attributor; +var _parchment = __webpack_require__(0); +var _parchment2 = _interopRequireDefault(_parchment); -/***/ }, -/* 9 */ -/***/ function(module, exports, __webpack_require__) { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - "use strict"; - var attributor_1 = __webpack_require__(8); - var class_1 = __webpack_require__(10); - var style_1 = __webpack_require__(11); - var Registry = __webpack_require__(6); - var AttributorStore = (function () { - function AttributorStore(domNode) { - this.attributes = {}; - this.domNode = domNode; - this.build(); - } - AttributorStore.prototype.attribute = function (attribute, value) { - if (value) { - if (attribute.add(this.domNode, value)) { - if (attribute.value(this.domNode) != null) { - this.attributes[attribute.attrName] = attribute; - } - else { - delete this.attributes[attribute.attrName]; - } - } - } - else { - attribute.remove(this.domNode); - delete this.attributes[attribute.attrName]; - } - }; - AttributorStore.prototype.build = function () { - var _this = this; - this.attributes = {}; - var attributes = attributor_1.default.keys(this.domNode); - var classes = class_1.default.keys(this.domNode); - var styles = style_1.default.keys(this.domNode); - attributes.concat(classes).concat(styles).forEach(function (name) { - var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); - if (attr instanceof attributor_1.default) { - _this.attributes[attr.attrName] = attr; - } - }); - }; - AttributorStore.prototype.copy = function (target) { - var _this = this; - Object.keys(this.attributes).forEach(function (key) { - var value = _this.attributes[key].value(_this.domNode); - target.format(key, value); - }); - }; - AttributorStore.prototype.move = function (target) { - var _this = this; - this.copy(target); - Object.keys(this.attributes).forEach(function (key) { - _this.attributes[key].remove(_this.domNode); - }); - this.attributes = {}; - }; - AttributorStore.prototype.values = function () { - var _this = this; - return Object.keys(this.attributes).reduce(function (attributes, name) { - attributes[name] = _this.attributes[name].value(_this.domNode); - return attributes; - }, {}); - }; - return AttributorStore; - }()); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = AttributorStore; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -/***/ }, -/* 10 */ -/***/ function(module, exports, __webpack_require__) { +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var attributor_1 = __webpack_require__(8); - function match(node, prefix) { - var className = node.getAttribute('class') || ''; - return className.split(/\s+/).filter(function (name) { - return name.indexOf(prefix + "-") === 0; - }); - } - var ClassAttributor = (function (_super) { - __extends(ClassAttributor, _super); - function ClassAttributor() { - _super.apply(this, arguments); - } - ClassAttributor.keys = function (node) { - return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { - return name.split('-').slice(0, -1).join('-'); - }); - }; - ClassAttributor.prototype.add = function (node, value) { - if (!this.canAdd(node, value)) - return false; - this.remove(node); - node.classList.add(this.keyName + "-" + value); - return true; - }; - ClassAttributor.prototype.remove = function (node) { - var matches = match(node, this.keyName); - matches.forEach(function (name) { - node.classList.remove(name); - }); - if (node.classList.length === 0) { - node.removeAttribute('class'); - } - }; - ClassAttributor.prototype.value = function (node) { - var result = match(node, this.keyName)[0] || ''; - return result.slice(this.keyName.length + 1); // +1 for hyphen - }; - return ClassAttributor; - }(attributor_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = ClassAttributor; +var TextBlot = function (_Parchment$Text) { + _inherits(TextBlot, _Parchment$Text); + function TextBlot() { + _classCallCheck(this, TextBlot); -/***/ }, -/* 11 */ -/***/ function(module, exports, __webpack_require__) { + return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); + } - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var attributor_1 = __webpack_require__(8); - function camelize(name) { - var parts = name.split('-'); - var rest = parts.slice(1).map(function (part) { - return part[0].toUpperCase() + part.slice(1); - }).join(''); - return parts[0] + rest; - } - var StyleAttributor = (function (_super) { - __extends(StyleAttributor, _super); - function StyleAttributor() { - _super.apply(this, arguments); - } - StyleAttributor.keys = function (node) { - return (node.getAttribute('style') || '').split(';').map(function (value) { - var arr = value.split(':'); - return arr[0].trim(); - }); - }; - StyleAttributor.prototype.add = function (node, value) { - if (!this.canAdd(node, value)) - return false; - node.style[camelize(this.keyName)] = value; - return true; - }; - StyleAttributor.prototype.remove = function (node) { - node.style[camelize(this.keyName)] = ''; - if (!node.getAttribute('style')) { - node.removeAttribute('style'); - } - }; - StyleAttributor.prototype.value = function (node) { - return node.style[camelize(this.keyName)]; - }; - return StyleAttributor; - }(attributor_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = StyleAttributor; + return TextBlot; +}(_parchment2.default.Text); +exports.default = TextBlot; -/***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var shadow_1 = __webpack_require__(5); - var Registry = __webpack_require__(6); - var LeafBlot = (function (_super) { - __extends(LeafBlot, _super); - function LeafBlot() { - _super.apply(this, arguments); - } - LeafBlot.value = function (domNode) { - return true; - }; - LeafBlot.prototype.index = function (node, offset) { - if (node !== this.domNode) - return -1; - return Math.min(offset, 1); - }; - LeafBlot.prototype.position = function (index, inclusive) { - var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); - if (index > 0) - offset += 1; - return [this.parent.domNode, offset]; - }; - LeafBlot.prototype.value = function () { - return (_a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a); - var _a; - }; - LeafBlot.scope = Registry.Scope.INLINE_BLOT; - return LeafBlot; - }(shadow_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = LeafBlot; +"use strict"; -/***/ }, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { +Object.defineProperty(exports, "__esModule", { + value: true +}); - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var container_1 = __webpack_require__(3); - var Registry = __webpack_require__(6); - var OBSERVER_CONFIG = { - attributes: true, - characterData: true, - characterDataOldValue: true, - childList: true, - subtree: true - }; - var MAX_OPTIMIZE_ITERATIONS = 100; - var ScrollBlot = (function (_super) { - __extends(ScrollBlot, _super); - function ScrollBlot(node) { - var _this = this; - _super.call(this, node); - this.parent = null; - this.observer = new MutationObserver(function (mutations) { - _this.update(mutations); - }); - this.observer.observe(this.domNode, OBSERVER_CONFIG); - } - ScrollBlot.prototype.detach = function () { - _super.prototype.detach.call(this); - this.observer.disconnect(); - }; - ScrollBlot.prototype.deleteAt = function (index, length) { - this.update(); - if (index === 0 && length === this.length()) { - this.children.forEach(function (child) { - child.remove(); - }); - } - else { - _super.prototype.deleteAt.call(this, index, length); - } - }; - ScrollBlot.prototype.formatAt = function (index, length, name, value) { - this.update(); - _super.prototype.formatAt.call(this, index, length, name, value); - }; - ScrollBlot.prototype.insertAt = function (index, value, def) { - this.update(); - _super.prototype.insertAt.call(this, index, value, def); - }; - ScrollBlot.prototype.optimize = function (mutations) { - var _this = this; - if (mutations === void 0) { mutations = []; } - _super.prototype.optimize.call(this); - mutations.push.apply(mutations, this.observer.takeRecords()); - // TODO use WeakMap - var mark = function (blot, markParent) { - if (markParent === void 0) { markParent = true; } - if (blot == null || blot === _this) - return; - if (blot.domNode.parentNode == null) - return; - if (blot.domNode[Registry.DATA_KEY].mutations == null) { - blot.domNode[Registry.DATA_KEY].mutations = []; - } - if (markParent) - mark(blot.parent); - }; - var optimize = function (blot) { - if (blot.domNode[Registry.DATA_KEY] == null || blot.domNode[Registry.DATA_KEY].mutations == null) { - return; - } - if (blot instanceof container_1.default) { - blot.children.forEach(optimize); - } - blot.optimize(); - }; - var remaining = mutations; - for (var i = 0; remaining.length > 0; i += 1) { - if (i >= MAX_OPTIMIZE_ITERATIONS) { - throw new Error('[Parchment] Maximum optimize iterations reached'); - } - remaining.forEach(function (mutation) { - var blot = Registry.find(mutation.target, true); - if (blot == null) - return; - if (blot.domNode === mutation.target) { - if (mutation.type === 'childList') { - mark(Registry.find(mutation.previousSibling, false)); - [].forEach.call(mutation.addedNodes, function (node) { - var child = Registry.find(node, false); - mark(child, false); - if (child instanceof container_1.default) { - child.children.forEach(function (grandChild) { - mark(grandChild, false); - }); - } - }); - } - else if (mutation.type === 'attributes') { - mark(blot.prev); - } - } - mark(blot); - }); - this.children.forEach(optimize); - remaining = this.observer.takeRecords(); - mutations.push.apply(mutations, remaining); - } - }; - ScrollBlot.prototype.update = function (mutations) { - var _this = this; - mutations = mutations || this.observer.takeRecords(); - // TODO use WeakMap - mutations.map(function (mutation) { - var blot = Registry.find(mutation.target, true); - if (blot == null) - return; - if (blot.domNode[Registry.DATA_KEY].mutations == null) { - blot.domNode[Registry.DATA_KEY].mutations = [mutation]; - return blot; - } - else { - blot.domNode[Registry.DATA_KEY].mutations.push(mutation); - return null; - } - }).forEach(function (blot) { - if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null) - return; - blot.update(blot.domNode[Registry.DATA_KEY].mutations || []); - }); - if (this.domNode[Registry.DATA_KEY].mutations != null) { - _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations); - } - this.optimize(mutations); - }; - ScrollBlot.blotName = 'scroll'; - ScrollBlot.defaultChild = 'block'; - ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; - ScrollBlot.tagName = 'DIV'; - return ScrollBlot; - }(container_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = ScrollBlot; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -/***/ }, -/* 14 */ -/***/ function(module, exports, __webpack_require__) { +var _eventemitter = __webpack_require__(54); - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var format_1 = __webpack_require__(7); - var Registry = __webpack_require__(6); - // Shallow object comparison - function isEqual(obj1, obj2) { - if (Object.keys(obj1).length !== Object.keys(obj2).length) - return false; - for (var prop in obj1) { - if (obj1[prop] !== obj2[prop]) - return false; - } - return true; - } - var InlineBlot = (function (_super) { - __extends(InlineBlot, _super); - function InlineBlot() { - _super.apply(this, arguments); - } - InlineBlot.formats = function (domNode) { - if (domNode.tagName === InlineBlot.tagName) - return undefined; - return _super.formats.call(this, domNode); - }; - InlineBlot.prototype.format = function (name, value) { - var _this = this; - if (name === this.statics.blotName && !value) { - this.children.forEach(function (child) { - if (!(child instanceof format_1.default)) { - child = child.wrap(InlineBlot.blotName, true); - } - _this.attributes.copy(child); - }); - this.unwrap(); - } - else { - _super.prototype.format.call(this, name, value); - } - }; - InlineBlot.prototype.formatAt = function (index, length, name, value) { - if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { - var blot = this.isolate(index, length); - blot.format(name, value); - } - else { - _super.prototype.formatAt.call(this, index, length, name, value); - } - }; - InlineBlot.prototype.optimize = function () { - _super.prototype.optimize.call(this); - var formats = this.formats(); - if (Object.keys(formats).length === 0) { - return this.unwrap(); // unformatted span - } - var next = this.next; - if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { - next.moveChildren(this); - next.remove(); - } - }; - InlineBlot.blotName = 'inline'; - InlineBlot.scope = Registry.Scope.INLINE_BLOT; - InlineBlot.tagName = 'SPAN'; - return InlineBlot; - }(format_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = InlineBlot; +var _eventemitter2 = _interopRequireDefault(_eventemitter); +var _logger = __webpack_require__(10); -/***/ }, -/* 15 */ -/***/ function(module, exports, __webpack_require__) { +var _logger2 = _interopRequireDefault(_logger); - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var format_1 = __webpack_require__(7); - var Registry = __webpack_require__(6); - var BlockBlot = (function (_super) { - __extends(BlockBlot, _super); - function BlockBlot() { - _super.apply(this, arguments); - } - BlockBlot.formats = function (domNode) { - var tagName = Registry.query(BlockBlot.blotName).tagName; - if (domNode.tagName === tagName) - return undefined; - return _super.formats.call(this, domNode); - }; - BlockBlot.prototype.format = function (name, value) { - if (Registry.query(name, Registry.Scope.BLOCK) == null) { - return; - } - else if (name === this.statics.blotName && !value) { - this.replaceWith(BlockBlot.blotName); - } - else { - _super.prototype.format.call(this, name, value); - } - }; - BlockBlot.prototype.formatAt = function (index, length, name, value) { - if (Registry.query(name, Registry.Scope.BLOCK) != null) { - this.format(name, value); - } - else { - _super.prototype.formatAt.call(this, index, length, name, value); - } - }; - BlockBlot.prototype.insertAt = function (index, value, def) { - if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { - // Insert text or inline - _super.prototype.insertAt.call(this, index, value, def); - } - else { - var after = this.split(index); - var blot = Registry.create(value, def); - after.parent.insertBefore(blot, after); - } - }; - BlockBlot.blotName = 'block'; - BlockBlot.scope = Registry.Scope.BLOCK_BLOT; - BlockBlot.tagName = 'P'; - return BlockBlot; - }(format_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = BlockBlot; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -/***/ }, -/* 16 */ -/***/ function(module, exports, __webpack_require__) { +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var leaf_1 = __webpack_require__(12); - var EmbedBlot = (function (_super) { - __extends(EmbedBlot, _super); - function EmbedBlot() { - _super.apply(this, arguments); - } - EmbedBlot.formats = function (domNode) { - return undefined; - }; - EmbedBlot.prototype.format = function (name, value) { - // super.formatAt wraps, which is what we want in general, - // but this allows subclasses to overwrite for formats - // that just apply to particular embeds - _super.prototype.formatAt.call(this, 0, this.length(), name, value); - }; - EmbedBlot.prototype.formatAt = function (index, length, name, value) { - if (index === 0 && length === this.length()) { - this.format(name, value); - } - else { - _super.prototype.formatAt.call(this, index, length, name, value); - } - }; - EmbedBlot.prototype.formats = function () { - return this.statics.formats(this.domNode); - }; - return EmbedBlot; - }(leaf_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = EmbedBlot; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var debug = (0, _logger2.default)('quill:events'); -/***/ }, -/* 17 */ -/***/ function(module, exports, __webpack_require__) { +var EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click']; - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var leaf_1 = __webpack_require__(12); - var Registry = __webpack_require__(6); - var TextBlot = (function (_super) { - __extends(TextBlot, _super); - function TextBlot(node) { - _super.call(this, node); - this.text = this.statics.value(this.domNode); - } - TextBlot.create = function (value) { - return document.createTextNode(value); - }; - TextBlot.value = function (domNode) { - return domNode.data; - }; - TextBlot.prototype.deleteAt = function (index, length) { - this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); - }; - TextBlot.prototype.index = function (node, offset) { - if (this.domNode === node) { - return offset; - } - return -1; - }; - TextBlot.prototype.insertAt = function (index, value, def) { - if (def == null) { - this.text = this.text.slice(0, index) + value + this.text.slice(index); - this.domNode.data = this.text; - } - else { - _super.prototype.insertAt.call(this, index, value, def); - } - }; - TextBlot.prototype.length = function () { - return this.text.length; - }; - TextBlot.prototype.optimize = function () { - _super.prototype.optimize.call(this); - this.text = this.statics.value(this.domNode); - if (this.text.length === 0) { - this.remove(); - } - else if (this.next instanceof TextBlot && this.next.prev === this) { - this.insertAt(this.length(), this.next.value()); - this.next.remove(); - } - }; - TextBlot.prototype.position = function (index, inclusive) { - if (inclusive === void 0) { inclusive = false; } - return [this.domNode, index]; - }; - TextBlot.prototype.split = function (index, force) { - if (force === void 0) { force = false; } - if (!force) { - if (index === 0) - return this; - if (index === this.length()) - return this.next; - } - var after = Registry.create(this.domNode.splitText(index)); - this.parent.insertBefore(after, this.next); - this.text = this.statics.value(this.domNode); - return after; - }; - TextBlot.prototype.update = function (mutations) { - var _this = this; - if (mutations.some(function (mutation) { - return mutation.type === 'characterData' && mutation.target === _this.domNode; - })) { - this.text = this.statics.value(this.domNode); - } - }; - TextBlot.prototype.value = function () { - return this.text; - }; - TextBlot.blotName = 'text'; - TextBlot.scope = Registry.Scope.INLINE_BLOT; - return TextBlot; - }(leaf_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = TextBlot; +EVENTS.forEach(function (eventName) { + document.addEventListener(eventName, function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) { + // TODO use WeakMap + if (node.__quill && node.__quill.emitter) { + var _node$__quill$emitter; -/***/ }, -/* 18 */ -/***/ function(module, exports, __webpack_require__) { + (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args); + } + }); + }); +}); - 'use strict'; +var Emitter = function (_EventEmitter) { + _inherits(Emitter, _EventEmitter); - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.overload = exports.expandConfig = undefined; - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - __webpack_require__(19); - - var _quillDelta = __webpack_require__(20); - - var _quillDelta2 = _interopRequireDefault(_quillDelta); - - var _editor = __webpack_require__(27); - - var _editor2 = _interopRequireDefault(_editor); - - var _emitter3 = __webpack_require__(36); - - var _emitter4 = _interopRequireDefault(_emitter3); - - var _module = __webpack_require__(43); - - var _module2 = _interopRequireDefault(_module); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _selection = __webpack_require__(44); - - var _selection2 = _interopRequireDefault(_selection); - - var _extend = __webpack_require__(30); - - var _extend2 = _interopRequireDefault(_extend); - - var _logger = __webpack_require__(38); - - var _logger2 = _interopRequireDefault(_logger); - - var _theme = __webpack_require__(45); - - var _theme2 = _interopRequireDefault(_theme); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var debug = (0, _logger2.default)('quill'); - - var Quill = function () { - _createClass(Quill, null, [{ - key: 'debug', - value: function debug(limit) { - if (limit === true) { - limit = 'log'; - } - _logger2.default.level(limit); - } - }, { - key: 'import', - value: function _import(name) { - if (this.imports[name] == null) { - debug.error('Cannot import ' + name + '. Are you sure it was registered?'); - } - return this.imports[name]; - } - }, { - key: 'register', - value: function register(path, target) { - var _this = this; - - var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (typeof path !== 'string') { - var name = path.attrName || path.blotName; - if (typeof name === 'string') { - // register(Blot | Attributor, overwrite) - this.register('formats/' + name, path, target); - } else { - Object.keys(path).forEach(function (key) { - _this.register(key, path[key], target); - }); - } - } else { - if (this.imports[path] != null && !overwrite) { - debug.warn('Overwriting ' + path + ' with', target); - } - this.imports[path] = target; - if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { - _parchment2.default.register(target); - } - } - } - }]); - - function Quill(container) { - var _this2 = this; - - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, Quill); - - this.options = expandConfig(container, options); - this.container = this.options.container; - if (this.container == null) { - return debug.error('Invalid Quill container', container); - } - if (this.options.debug) { - Quill.debug(this.options.debug); - } - var html = this.container.innerHTML.trim(); - this.container.classList.add('ql-container'); - this.container.innerHTML = ''; - this.root = this.addContainer('ql-editor'); - this.root.classList.add('ql-blank'); - this.emitter = new _emitter4.default(); - this.scroll = _parchment2.default.create(this.root, { - emitter: this.emitter, - whitelist: this.options.formats - }); - this.editor = new _editor2.default(this.scroll); - this.selection = new _selection2.default(this.scroll, this.emitter); - this.theme = new this.options.theme(this, this.options); - this.keyboard = this.theme.addModule('keyboard'); - this.clipboard = this.theme.addModule('clipboard'); - this.history = this.theme.addModule('history'); - this.theme.init(); - this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { - if (type === _emitter4.default.events.TEXT_CHANGE) { - _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); - } - }); - this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { - var range = _this2.selection.lastRange; - var index = range && range.length === 0 ? range.index : undefined; - modify.call(_this2, function () { - return _this2.editor.update(null, mutations, index); - }, source); - }); - var contents = this.clipboard.convert('
    ' + html + '


    '); - this.setContents(contents); - this.history.clear(); - if (this.options.placeholder) { - this.root.setAttribute('data-placeholder', this.options.placeholder); - } - if (this.options.readOnly) { - this.disable(); - } - } - - _createClass(Quill, [{ - key: 'addContainer', - value: function addContainer(container) { - var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - if (typeof container === 'string') { - var className = container; - container = document.createElement('div'); - container.classList.add(className); - } - this.container.insertBefore(container, refNode); - return container; - } - }, { - key: 'blur', - value: function blur() { - this.selection.setRange(null); - } - }, { - key: 'deleteText', - value: function deleteText(index, length, source) { - var _this3 = this; - - var _overload = overload(index, length, source); - - var _overload2 = _slicedToArray(_overload, 4); - - index = _overload2[0]; - length = _overload2[1]; - source = _overload2[3]; - - return modify.call(this, function () { - return _this3.editor.deleteText(index, length); - }, source, index, -1 * length); - } - }, { - key: 'disable', - value: function disable() { - this.enable(false); - } - }, { - key: 'enable', - value: function enable() { - var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - - this.scroll.enable(enabled); - this.container.classList.toggle('ql-disabled', !enabled); - if (!enabled) { - this.blur(); - } - } - }, { - key: 'focus', - value: function focus() { - this.selection.focus(); - this.selection.scrollIntoView(); - } - }, { - key: 'format', - value: function format(name, value) { - var _this4 = this; - - var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; - - return modify.call(this, function () { - var range = _this4.getSelection(true); - var change = new _quillDelta2.default(); - if (range == null) { - return change; - } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { - change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); - } else if (range.length === 0) { - _this4.selection.format(name, value); - return change; - } else { - change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); - } - _this4.setSelection(range, _emitter4.default.sources.SILENT); - return change; - }, source); - } - }, { - key: 'formatLine', - value: function formatLine(index, length, name, value, source) { - var _this5 = this; - - var formats = void 0; - - var _overload3 = overload(index, length, name, value, source); - - var _overload4 = _slicedToArray(_overload3, 4); - - index = _overload4[0]; - length = _overload4[1]; - formats = _overload4[2]; - source = _overload4[3]; - - return modify.call(this, function () { - return _this5.editor.formatLine(index, length, formats); - }, source, index, 0); - } - }, { - key: 'formatText', - value: function formatText(index, length, name, value, source) { - var _this6 = this; - - var formats = void 0; - - var _overload5 = overload(index, length, name, value, source); - - var _overload6 = _slicedToArray(_overload5, 4); - - index = _overload6[0]; - length = _overload6[1]; - formats = _overload6[2]; - source = _overload6[3]; - - return modify.call(this, function () { - return _this6.editor.formatText(index, length, formats); - }, source, index, 0); - } - }, { - key: 'getBounds', - value: function getBounds(index) { - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - if (typeof index === 'number') { - return this.selection.getBounds(index, length); - } else { - return this.selection.getBounds(index.index, index.length); - } - } - }, { - key: 'getContents', - value: function getContents() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; - - var _overload7 = overload(index, length); - - var _overload8 = _slicedToArray(_overload7, 2); - - index = _overload8[0]; - length = _overload8[1]; - - return this.editor.getContents(index, length); - } - }, { - key: 'getFormat', - value: function getFormat() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(); - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - if (typeof index === 'number') { - return this.editor.getFormat(index, length); - } else { - return this.editor.getFormat(index.index, index.length); - } - } - }, { - key: 'getLength', - value: function getLength() { - return this.scroll.length(); - } - }, { - key: 'getModule', - value: function getModule(name) { - return this.theme.modules[name]; - } - }, { - key: 'getSelection', - value: function getSelection() { - var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - - if (focus) this.focus(); - this.update(); // Make sure we access getRange with editor in consistent state - return this.selection.getRange()[0]; - } - }, { - key: 'getText', - value: function getText() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; - - var _overload9 = overload(index, length); - - var _overload10 = _slicedToArray(_overload9, 2); - - index = _overload10[0]; - length = _overload10[1]; - - return this.editor.getText(index, length); - } - }, { - key: 'hasFocus', - value: function hasFocus() { - return this.selection.hasFocus(); - } - }, { - key: 'insertEmbed', - value: function insertEmbed(index, embed, value) { - var _this7 = this; - - var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; - - return modify.call(this, function () { - return _this7.editor.insertEmbed(index, embed, value); - }, source, index); - } - }, { - key: 'insertText', - value: function insertText(index, text, name, value, source) { - var _this8 = this; - - var formats = void 0; - - var _overload11 = overload(index, 0, name, value, source); - - var _overload12 = _slicedToArray(_overload11, 4); - - index = _overload12[0]; - formats = _overload12[2]; - source = _overload12[3]; - - return modify.call(this, function () { - return _this8.editor.insertText(index, text, formats); - }, source, index, text.length); - } - }, { - key: 'isEnabled', - value: function isEnabled() { - return !this.container.classList.contains('ql-disabled'); - } - }, { - key: 'off', - value: function off() { - return this.emitter.off.apply(this.emitter, arguments); - } - }, { - key: 'on', - value: function on() { - return this.emitter.on.apply(this.emitter, arguments); - } - }, { - key: 'once', - value: function once() { - return this.emitter.once.apply(this.emitter, arguments); - } - }, { - key: 'pasteHTML', - value: function pasteHTML(index, html, source) { - this.clipboard.dangerouslyPasteHTML(index, html, source); - } - }, { - key: 'removeFormat', - value: function removeFormat(index, length, source) { - var _this9 = this; - - var _overload13 = overload(index, length, source); - - var _overload14 = _slicedToArray(_overload13, 4); - - index = _overload14[0]; - length = _overload14[1]; - source = _overload14[3]; - - return modify.call(this, function () { - return _this9.editor.removeFormat(index, length); - }, source, index); - } - }, { - key: 'setContents', - value: function setContents(delta) { - var _this10 = this; - - var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; - - return modify.call(this, function () { - delta = new _quillDelta2.default(delta); - var length = _this10.getLength(); - var deleted = _this10.editor.deleteText(0, length); - var applied = _this10.editor.applyDelta(delta); - var lastOp = applied.ops[applied.ops.length - 1]; - if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { - _this10.editor.deleteText(_this10.getLength() - 1, 1); - applied.delete(1); - } - var ret = deleted.compose(applied); - return ret; - }, source); - } - }, { - key: 'setSelection', - value: function setSelection(index, length, source) { - if (index == null) { - this.selection.setRange(null, length || Quill.sources.API); - } else { - var _overload15 = overload(index, length, source); - - var _overload16 = _slicedToArray(_overload15, 4); - - index = _overload16[0]; - length = _overload16[1]; - source = _overload16[3]; - - this.selection.setRange(new _selection.Range(index, length), source); - } - this.selection.scrollIntoView(); - } - }, { - key: 'setText', - value: function setText(text) { - var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; - - var delta = new _quillDelta2.default().insert(text); - return this.setContents(delta, source); - } - }, { - key: 'update', - value: function update() { - var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; - - var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes - this.selection.update(source); - return change; - } - }, { - key: 'updateContents', - value: function updateContents(delta) { - var _this11 = this; - - var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; - - return modify.call(this, function () { - delta = new _quillDelta2.default(delta); - return _this11.editor.applyDelta(delta, source); - }, source, true); - } - }]); - - return Quill; - }(); - - Quill.DEFAULTS = { - bounds: null, - formats: null, - modules: {}, - placeholder: '', - readOnly: false, - strict: true, - theme: 'default' - }; - Quill.events = _emitter4.default.events; - Quill.sources = _emitter4.default.sources; - // eslint-disable-next-line no-undef - Quill.version = false ? 'dev' : ("1.1.5"); - - Quill.imports = { - 'delta': _quillDelta2.default, - 'parchment': _parchment2.default, - 'core/module': _module2.default, - 'core/theme': _theme2.default - }; - - function expandConfig(container, userConfig) { - userConfig = (0, _extend2.default)(true, { - container: container, - modules: { - clipboard: true, - keyboard: true, - history: true - } - }, userConfig); - if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { - userConfig.theme = _theme2.default; - } else { - userConfig.theme = Quill.import('themes/' + userConfig.theme); - if (userConfig.theme == null) { - throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); - } - } - var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); - [themeConfig, userConfig].forEach(function (config) { - config.modules = config.modules || {}; - Object.keys(config.modules).forEach(function (module) { - if (config.modules[module] === true) { - config.modules[module] = {}; - } - }); - }); - var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); - var moduleConfig = moduleNames.reduce(function (config, name) { - var moduleClass = Quill.import('modules/' + name); - if (moduleClass == null) { - debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); - } else { - config[name] = moduleClass.DEFAULTS || {}; - } - return config; - }, {}); - // Special case toolbar shorthand - if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { - userConfig.modules.toolbar = { - container: userConfig.modules.toolbar - }; - } - userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); - ['bounds', 'container'].forEach(function (key) { - if (typeof userConfig[key] === 'string') { - userConfig[key] = document.querySelector(userConfig[key]); - } - }); - userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { - if (userConfig.modules[name]) { - config[name] = userConfig.modules[name]; - } - return config; - }, {}); - return userConfig; - } + function Emitter() { + _classCallCheck(this, Emitter); - // Handle selection preservation and TEXT_CHANGE emission - // common to modification APIs - function modify(modifier, source, index, shift) { - if (!this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { - return new _quillDelta2.default(); - } - var range = index == null ? null : this.getSelection(); - var oldDelta = this.editor.delta; - var change = modifier(); - if (range != null) { - if (index === true) index = range.index; - if (shift == null) { - range = shiftRange(range, change, source); - } else if (shift !== 0) { - range = shiftRange(range, index, shift, source); - } - this.setSelection(range, _emitter4.default.sources.SILENT); - } - if (change.length() > 0) { - var _emitter; - - var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; - (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); - if (source !== _emitter4.default.sources.SILENT) { - var _emitter2; - - (_emitter2 = this.emitter).emit.apply(_emitter2, args); - } - } - return change; - } - - function overload(index, length, name, value, source) { - var formats = {}; - if (typeof index.index === 'number' && typeof index.length === 'number') { - // Allow for throwaway end (used by insertText/insertEmbed) - if (typeof length !== 'number') { - source = value, value = name, name = length, length = index.length, index = index.index; - } else { - length = index.length, index = index.index; - } - } else if (typeof length !== 'number') { - source = value, value = name, name = length, length = 0; - } - // Handle format being object, two format name/value strings or excluded - if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { - formats = name; - source = value; - } else if (typeof name === 'string') { - if (value != null) { - formats[name] = value; - } else { - source = name; - } - } - // Handle optional source - source = source || _emitter4.default.sources.API; - return [index, length, formats, source]; - } + var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); - function shiftRange(range, index, length, source) { - if (range == null) return null; - var start = void 0, - end = void 0; - if (index instanceof _quillDelta2.default) { - var _map = [range.index, range.index + range.length].map(function (pos) { - return index.transformPosition(pos, source === _emitter4.default.sources.USER); - }); - - var _map2 = _slicedToArray(_map, 2); - - start = _map2[0]; - end = _map2[1]; - } else { - var _map3 = [range.index, range.index + range.length].map(function (pos) { - if (pos < index || pos === index && source !== _emitter4.default.sources.USER) return pos; - if (length >= 0) { - return pos + length; - } else { - return Math.max(index, pos + length); - } - }); - - var _map4 = _slicedToArray(_map3, 2); - - start = _map4[0]; - end = _map4[1]; - } - return new _selection.Range(start, end - start); - } + _this.listeners = {}; + _this.on('error', debug.error); + return _this; + } + + _createClass(Emitter, [{ + key: 'emit', + value: function emit() { + debug.log.apply(debug, arguments); + _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); + } + }, { + key: 'handleDOM', + value: function handleDOM(event) { + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + (this.listeners[event.type] || []).forEach(function (_ref) { + var node = _ref.node, + handler = _ref.handler; + + if (event.target === node || node.contains(event.target)) { + handler.apply(undefined, [event].concat(args)); + } + }); + } + }, { + key: 'listenDOM', + value: function listenDOM(eventName, node, handler) { + if (!this.listeners[eventName]) { + this.listeners[eventName] = []; + } + this.listeners[eventName].push({ node: node, handler: handler }); + } + }]); + + return Emitter; +}(_eventemitter2.default); + +Emitter.events = { + EDITOR_CHANGE: 'editor-change', + SCROLL_BEFORE_UPDATE: 'scroll-before-update', + SCROLL_OPTIMIZE: 'scroll-optimize', + SCROLL_UPDATE: 'scroll-update', + SELECTION_CHANGE: 'selection-change', + TEXT_CHANGE: 'text-change' +}; +Emitter.sources = { + API: 'api', + SILENT: 'silent', + USER: 'user' +}; - exports.expandConfig = expandConfig; - exports.overload = overload; - exports.default = Quill; +exports.default = Emitter; -/***/ }, -/* 19 */ -/***/ function(module, exports) { +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - var elem = document.createElement('div'); - elem.classList.toggle('test-class', false); - if (elem.classList.contains('test-class')) { - (function () { - var _toggle = DOMTokenList.prototype.toggle; - DOMTokenList.prototype.toggle = function (token, force) { - if (arguments.length > 1 && !this.contains(token) === !force) { - return force; - } else { - return _toggle.call(this, token); - } - }; - })(); - } - if (!String.prototype.startsWith) { - String.prototype.startsWith = function (searchString, position) { - position = position || 0; - return this.substr(position, searchString.length) === searchString; - }; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); - if (!String.prototype.endsWith) { - String.prototype.endsWith = function (searchString, position) { - var subjectString = this.toString(); - if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - var lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, "find", { - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; - } - } - return undefined; - } - }); - } +var Module = function Module(quill) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - // Disable resizing in Firefox - document.addEventListener("DOMContentLoaded", function () { - document.execCommand("enableObjectResizing", false, false); - }); + _classCallCheck(this, Module); -/***/ }, -/* 20 */ -/***/ function(module, exports, __webpack_require__) { + this.quill = quill; + this.options = options; +}; - var diff = __webpack_require__(21); - var equal = __webpack_require__(22); - var extend = __webpack_require__(25); - var op = __webpack_require__(26); - - - var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() - - - var Delta = function (ops) { - // Assume we are given a well formed ops - if (Array.isArray(ops)) { - this.ops = ops; - } else if (ops != null && Array.isArray(ops.ops)) { - this.ops = ops.ops; - } else { - this.ops = []; - } - }; - - - Delta.prototype.insert = function (text, attributes) { - var newOp = {}; - if (text.length === 0) return this; - newOp.insert = text; - if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { - newOp.attributes = attributes; - } - return this.push(newOp); - }; - - Delta.prototype['delete'] = function (length) { - if (length <= 0) return this; - return this.push({ 'delete': length }); - }; - - Delta.prototype.retain = function (length, attributes) { - if (length <= 0) return this; - var newOp = { retain: length }; - if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { - newOp.attributes = attributes; - } - return this.push(newOp); - }; - - Delta.prototype.push = function (newOp) { - var index = this.ops.length; - var lastOp = this.ops[index - 1]; - newOp = extend(true, {}, newOp); - if (typeof lastOp === 'object') { - if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { - this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; - return this; - } - // Since it does not matter if we insert before or after deleting at the same index, - // always prefer to insert first - if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { - index -= 1; - lastOp = this.ops[index - 1]; - if (typeof lastOp !== 'object') { - this.ops.unshift(newOp); - return this; - } - } - if (equal(newOp.attributes, lastOp.attributes)) { - if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { - this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; - if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes - return this; - } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { - this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; - if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes - return this; - } - } - } - if (index === this.ops.length) { - this.ops.push(newOp); - } else { - this.ops.splice(index, 0, newOp); - } - return this; - }; - - Delta.prototype.filter = function (predicate) { - return this.ops.filter(predicate); - }; - - Delta.prototype.forEach = function (predicate) { - this.ops.forEach(predicate); - }; - - Delta.prototype.map = function (predicate) { - return this.ops.map(predicate); - }; - - Delta.prototype.partition = function (predicate) { - var passed = [], failed = []; - this.forEach(function(op) { - var target = predicate(op) ? passed : failed; - target.push(op); - }); - return [passed, failed]; - }; - - Delta.prototype.reduce = function (predicate, initial) { - return this.ops.reduce(predicate, initial); - }; - - Delta.prototype.chop = function () { - var lastOp = this.ops[this.ops.length - 1]; - if (lastOp && lastOp.retain && !lastOp.attributes) { - this.ops.pop(); - } - return this; - }; - - Delta.prototype.length = function () { - return this.reduce(function (length, elem) { - return length + op.length(elem); - }, 0); - }; - - Delta.prototype.slice = function (start, end) { - start = start || 0; - if (typeof end !== 'number') end = Infinity; - var ops = []; - var iter = op.iterator(this.ops); - var index = 0; - while (index < end && iter.hasNext()) { - var nextOp; - if (index < start) { - nextOp = iter.next(start - index); - } else { - nextOp = iter.next(end - index); - ops.push(nextOp); - } - index += op.length(nextOp); - } - return new Delta(ops); - }; - - - Delta.prototype.compose = function (other) { - var thisIter = op.iterator(this.ops); - var otherIter = op.iterator(other.ops); - var delta = new Delta(); - while (thisIter.hasNext() || otherIter.hasNext()) { - if (otherIter.peekType() === 'insert') { - delta.push(otherIter.next()); - } else if (thisIter.peekType() === 'delete') { - delta.push(thisIter.next()); - } else { - var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); - var thisOp = thisIter.next(length); - var otherOp = otherIter.next(length); - if (typeof otherOp.retain === 'number') { - var newOp = {}; - if (typeof thisOp.retain === 'number') { - newOp.retain = length; - } else { - newOp.insert = thisOp.insert; - } - // Preserve null when composing with a retain, otherwise remove it for inserts - var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); - if (attributes) newOp.attributes = attributes; - delta.push(newOp); - // Other op should be delete, we could be an insert or retain - // Insert + delete cancels out - } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { - delta.push(otherOp); - } - } - } - return delta.chop(); - }; - - Delta.prototype.concat = function (other) { - var delta = new Delta(this.ops.slice()); - if (other.ops.length > 0) { - delta.push(other.ops[0]); - delta.ops = delta.ops.concat(other.ops.slice(1)); - } - return delta; - }; - - Delta.prototype.diff = function (other, index) { - if (this.ops === other.ops) { - return new Delta(); - } - var strings = [this, other].map(function (delta) { - return delta.map(function (op) { - if (op.insert != null) { - return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; - } - var prep = (delta === other) ? 'on' : 'with'; - throw new Error('diff() called ' + prep + ' non-document'); - }).join(''); - }); - var delta = new Delta(); - var diffResult = diff(strings[0], strings[1], index); - var thisIter = op.iterator(this.ops); - var otherIter = op.iterator(other.ops); - diffResult.forEach(function (component) { - var length = component[1].length; - while (length > 0) { - var opLength = 0; - switch (component[0]) { - case diff.INSERT: - opLength = Math.min(otherIter.peekLength(), length); - delta.push(otherIter.next(opLength)); - break; - case diff.DELETE: - opLength = Math.min(length, thisIter.peekLength()); - thisIter.next(opLength); - delta['delete'](opLength); - break; - case diff.EQUAL: - opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); - var thisOp = thisIter.next(opLength); - var otherOp = otherIter.next(opLength); - if (equal(thisOp.insert, otherOp.insert)) { - delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); - } else { - delta.push(otherOp)['delete'](opLength); - } - break; - } - length -= opLength; - } - }); - return delta.chop(); - }; - - Delta.prototype.eachLine = function (predicate, newline) { - newline = newline || '\n'; - var iter = op.iterator(this.ops); - var line = new Delta(); - while (iter.hasNext()) { - if (iter.peekType() !== 'insert') return; - var thisOp = iter.peek(); - var start = op.length(thisOp) - iter.peekLength(); - var 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 { - predicate(line, iter.next(1).attributes || {}); - line = new Delta(); - } - } - if (line.length() > 0) { - predicate(line, {}); - } - }; - - Delta.prototype.transform = function (other, priority) { - priority = !!priority; - if (typeof other === 'number') { - return this.transformPosition(other, priority); - } - var thisIter = op.iterator(this.ops); - var otherIter = op.iterator(other.ops); - var delta = new Delta(); - while (thisIter.hasNext() || otherIter.hasNext()) { - if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { - delta.retain(op.length(thisIter.next())); - } else if (otherIter.peekType() === 'insert') { - delta.push(otherIter.next()); - } else { - var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); - var thisOp = thisIter.next(length); - var otherOp = otherIter.next(length); - if (thisOp['delete']) { - // Our delete either makes their delete redundant or removes their retain - continue; - } else if (otherOp['delete']) { - delta.push(otherOp); - } else { - // We retain either their retain or insert - delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); - } - } - } - return delta.chop(); - }; - - Delta.prototype.transformPosition = function (index, priority) { - priority = !!priority; - var thisIter = op.iterator(this.ops); - var offset = 0; - while (thisIter.hasNext() && offset <= index) { - var length = thisIter.peekLength(); - var nextType = thisIter.peekType(); - thisIter.next(); - if (nextType === 'delete') { - index -= Math.min(length, index - offset); - continue; - } else if (nextType === 'insert' && (offset < index || !priority)) { - index += length; - } - offset += length; - } - return index; - }; +Module.DEFAULTS = {}; +exports.default = Module; - module.exports = Delta; +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; -/***/ }, -/* 21 */ -/***/ function(module, exports) { - /** - * This library modifies the diff-patch-match library by Neil Fraser - * by removing the patch and match functionality and certain advanced - * options in the diff function. The original license is as follows: - * - * === - * - * Diff Match and Patch - * - * Copyright 2006 Google Inc. - * http://code.google.com/p/google-diff-match-patch/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - /** - * The data structure representing a diff is an array of tuples: - * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] - * which means: delete 'Hello', add 'Goodbye' and keep ' world.' - */ - var DIFF_DELETE = -1; - var DIFF_INSERT = 1; - var DIFF_EQUAL = 0; - - - /** - * Find the differences between two texts. Simplifies the problem by stripping - * any common prefix or suffix off the texts before diffing. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {Int} cursor_pos Expected edit position in text1 (optional) - * @return {Array} Array of diff tuples. - */ - function diff_main(text1, text2, cursor_pos) { - // Check for equality (speedup). - if (text1 == text2) { - if (text1) { - return [[DIFF_EQUAL, text1]]; - } - return []; - } - - // Check cursor_pos within bounds - if (cursor_pos < 0 || text1.length < cursor_pos) { - cursor_pos = null; - } - - // Trim off common prefix (speedup). - var commonlength = diff_commonPrefix(text1, text2); - var commonprefix = text1.substring(0, commonlength); - text1 = text1.substring(commonlength); - text2 = text2.substring(commonlength); - - // Trim off common suffix (speedup). - 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); - - // Compute the diff on the middle block. - var diffs = diff_compute_(text1, text2); - - // Restore the prefix and suffix. - if (commonprefix) { - diffs.unshift([DIFF_EQUAL, commonprefix]); - } - if (commonsuffix) { - diffs.push([DIFF_EQUAL, commonsuffix]); - } - diff_cleanupMerge(diffs); - if (cursor_pos != null) { - diffs = fix_cursor(diffs, cursor_pos); - } - return diffs; - }; - - - /** - * Find the differences between two texts. Assumes that the texts do not - * have any common prefix or suffix. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @return {Array} Array of diff tuples. - */ - function diff_compute_(text1, text2) { - var diffs; - - if (!text1) { - // Just add some text (speedup). - return [[DIFF_INSERT, text2]]; - } - - if (!text2) { - // Just delete some text (speedup). - return [[DIFF_DELETE, text1]]; - } - - var longtext = text1.length > text2.length ? text1 : text2; - var shorttext = text1.length > text2.length ? text2 : text1; - var i = longtext.indexOf(shorttext); - if (i != -1) { - // Shorter text is inside the longer text (speedup). - diffs = [[DIFF_INSERT, longtext.substring(0, i)], - [DIFF_EQUAL, shorttext], - [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; - // Swap insertions for deletions if diff is reversed. - if (text1.length > text2.length) { - diffs[0][0] = diffs[2][0] = DIFF_DELETE; - } - return diffs; - } - - if (shorttext.length == 1) { - // Single character string. - // After the previous speedup, the character can't be an equality. - return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; - } - - // Check to see if the problem can be split in two. - var hm = diff_halfMatch_(text1, text2); - if (hm) { - // A half-match was found, sort out the return data. - var text1_a = hm[0]; - var text1_b = hm[1]; - var text2_a = hm[2]; - var text2_b = hm[3]; - var mid_common = hm[4]; - // Send both pairs off for separate processing. - var diffs_a = diff_main(text1_a, text2_a); - var diffs_b = diff_main(text1_b, text2_b); - // Merge the results. - return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); - } - - return diff_bisect_(text1, text2); - }; - - - /** - * Find the 'middle snake' of a diff, split the problem in two - * and return the recursively constructed diff. - * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @return {Array} Array of diff tuples. - * @private - */ - function diff_bisect_(text1, text2) { - // Cache the text lengths to prevent multiple calls. - var text1_length = text1.length; - var text2_length = text2.length; - var max_d = Math.ceil((text1_length + text2_length) / 2); - var v_offset = max_d; - var v_length = 2 * max_d; - var v1 = new Array(v_length); - var v2 = new Array(v_length); - // Setting all elements to -1 is faster in Chrome & Firefox than mixing - // integers and undefined. - for (var x = 0; x < v_length; x++) { - v1[x] = -1; - v2[x] = -1; - } - v1[v_offset + 1] = 0; - v2[v_offset + 1] = 0; - var delta = text1_length - text2_length; - // If the total number of characters is odd, then the front path will collide - // with the reverse path. - var front = (delta % 2 != 0); - // Offsets for start and end of k loop. - // Prevents mapping of space beyond the grid. - var k1start = 0; - var k1end = 0; - var k2start = 0; - var k2end = 0; - for (var d = 0; d < max_d; d++) { - // Walk the front path one step. - for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { - var k1_offset = v_offset + k1; - var x1; - if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { - x1 = v1[k1_offset + 1]; - } else { - x1 = v1[k1_offset - 1] + 1; - } - var y1 = x1 - k1; - while (x1 < text1_length && y1 < text2_length && - text1.charAt(x1) == text2.charAt(y1)) { - x1++; - y1++; - } - v1[k1_offset] = x1; - if (x1 > text1_length) { - // Ran off the right of the graph. - k1end += 2; - } else if (y1 > text2_length) { - // Ran off the bottom of the graph. - k1start += 2; - } else if (front) { - var k2_offset = v_offset + delta - k1; - if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { - // Mirror x2 onto top-left coordinate system. - var x2 = text1_length - v2[k2_offset]; - if (x1 >= x2) { - // Overlap detected. - return diff_bisectSplit_(text1, text2, x1, y1); - } - } - } - } - - // Walk the reverse path one step. - for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { - var k2_offset = v_offset + k2; - var x2; - if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { - x2 = v2[k2_offset + 1]; - } else { - x2 = v2[k2_offset - 1] + 1; - } - var y2 = x2 - k2; - while (x2 < text1_length && y2 < text2_length && - text1.charAt(text1_length - x2 - 1) == - text2.charAt(text2_length - y2 - 1)) { - x2++; - y2++; - } - v2[k2_offset] = x2; - if (x2 > text1_length) { - // Ran off the left of the graph. - k2end += 2; - } else if (y2 > text2_length) { - // Ran off the top of the graph. - 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]; - var y1 = v_offset + x1 - k1_offset; - // Mirror x2 onto top-left coordinate system. - x2 = text1_length - x2; - if (x1 >= x2) { - // Overlap detected. - return diff_bisectSplit_(text1, text2, x1, y1); - } - } - } - } - } - // Diff took too long and hit the deadline or - // number of diffs equals number of characters, no commonality at all. - return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; - }; - - - /** - * Given the location of the 'middle snake', split the diff in two parts - * and recurse. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {number} x Index of split point in text1. - * @param {number} y Index of split point in text2. - * @return {Array} Array of diff tuples. - */ - function diff_bisectSplit_(text1, text2, x, y) { - var text1a = text1.substring(0, x); - var text2a = text2.substring(0, y); - var text1b = text1.substring(x); - var text2b = text2.substring(y); - - // Compute both diffs serially. - var diffs = diff_main(text1a, text2a); - var diffsb = diff_main(text1b, text2b); - - return diffs.concat(diffsb); - }; - - - /** - * Determine the common prefix of two strings. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {number} The number of characters common to the start of each - * string. - */ - function diff_commonPrefix(text1, text2) { - // Quick check for common null cases. - if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { - return 0; - } - // Binary search. - // Performance analysis: http://neil.fraser.name/news/2007/10/09/ - var pointermin = 0; - var pointermax = Math.min(text1.length, text2.length); - var pointermid = pointermax; - var pointerstart = 0; - while (pointermin < pointermid) { - if (text1.substring(pointerstart, pointermid) == - text2.substring(pointerstart, pointermid)) { - pointermin = pointermid; - pointerstart = pointermin; - } else { - pointermax = pointermid; - } - pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); - } - return pointermid; - }; - - - /** - * Determine the common suffix of two strings. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {number} The number of characters common to the end of each string. - */ - function diff_commonSuffix(text1, text2) { - // Quick check for common null cases. - if (!text1 || !text2 || - text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { - return 0; - } - // Binary search. - // Performance analysis: http://neil.fraser.name/news/2007/10/09/ - var pointermin = 0; - var pointermax = Math.min(text1.length, text2.length); - var pointermid = pointermax; - var pointerend = 0; - while (pointermin < pointermid) { - if (text1.substring(text1.length - pointermid, text1.length - pointerend) == - text2.substring(text2.length - pointermid, text2.length - pointerend)) { - pointermin = pointermid; - pointerend = pointermin; - } else { - pointermax = pointermid; - } - pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); - } - return pointermid; - }; - - - /** - * Do the two texts share a substring which is at least half the length of the - * longer text? - * This speedup can produce non-minimal diffs. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {Array.} Five element Array, containing the prefix of - * text1, the suffix of text1, the prefix of text2, the suffix of - * text2 and the common middle. Or null if there was no match. - */ - function diff_halfMatch_(text1, text2) { - var longtext = text1.length > text2.length ? text1 : text2; - var shorttext = text1.length > text2.length ? text2 : text1; - if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { - return null; // Pointless. - } - - /** - * Does a substring of shorttext exist within longtext such that the substring - * is at least half the length of longtext? - * Closure, but does not reference any external variables. - * @param {string} longtext Longer string. - * @param {string} shorttext Shorter string. - * @param {number} i Start index of quarter length substring within longtext. - * @return {Array.} Five element Array, containing the prefix of - * longtext, the suffix of longtext, the prefix of shorttext, the suffix - * of shorttext and the common middle. Or null if there was no match. - * @private - */ - function diff_halfMatchI_(longtext, shorttext, i) { - // Start with a 1/4 length substring at position i as a seed. - var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); - var j = -1; - var best_common = ''; - var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; - while ((j = shorttext.indexOf(seed, j + 1)) != -1) { - var prefixLength = diff_commonPrefix(longtext.substring(i), - shorttext.substring(j)); - var suffixLength = diff_commonSuffix(longtext.substring(0, i), - shorttext.substring(0, j)); - if (best_common.length < suffixLength + prefixLength) { - best_common = shorttext.substring(j - suffixLength, j) + - shorttext.substring(j, j + prefixLength); - best_longtext_a = longtext.substring(0, i - suffixLength); - best_longtext_b = longtext.substring(i + prefixLength); - best_shorttext_a = shorttext.substring(0, j - suffixLength); - best_shorttext_b = shorttext.substring(j + prefixLength); - } - } - if (best_common.length * 2 >= longtext.length) { - return [best_longtext_a, best_longtext_b, - best_shorttext_a, best_shorttext_b, best_common]; - } else { - return null; - } - } - - // First check if the second quarter is the seed for a half-match. - var hm1 = diff_halfMatchI_(longtext, shorttext, - Math.ceil(longtext.length / 4)); - // Check again based on the third quarter. - var hm2 = diff_halfMatchI_(longtext, shorttext, - Math.ceil(longtext.length / 2)); - var hm; - if (!hm1 && !hm2) { - return null; - } else if (!hm2) { - hm = hm1; - } else if (!hm1) { - hm = hm2; - } else { - // Both matched. Select the longest. - hm = hm1[4].length > hm2[4].length ? hm1 : hm2; - } - - // A half-match was found, sort out the return data. - var text1_a, text1_b, text2_a, text2_b; - if (text1.length > text2.length) { - text1_a = hm[0]; - text1_b = hm[1]; - text2_a = hm[2]; - text2_b = hm[3]; - } else { - 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]; - }; - - - /** - * Reorder and merge like edit sections. Merge equalities. - * Any edit section can move as long as it doesn't cross an equality. - * @param {Array} diffs Array of diff tuples. - */ - function diff_cleanupMerge(diffs) { - diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. - var pointer = 0; - var count_delete = 0; - var count_insert = 0; - var text_delete = ''; - var text_insert = ''; - var commonlength; - while (pointer < diffs.length) { - 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: - // Upon reaching an equality, check for prior redundancies. - if (count_delete + count_insert > 1) { - if (count_delete !== 0 && count_insert !== 0) { - // Factor out any common prefixies. - commonlength = diff_commonPrefix(text_insert, text_delete); - if (commonlength !== 0) { - if ((pointer - count_delete - count_insert) > 0 && - diffs[pointer - count_delete - count_insert - 1][0] == - DIFF_EQUAL) { - diffs[pointer - count_delete - count_insert - 1][1] += - text_insert.substring(0, commonlength); - } else { - diffs.splice(0, 0, [DIFF_EQUAL, - text_insert.substring(0, commonlength)]); - pointer++; - } - text_insert = text_insert.substring(commonlength); - text_delete = text_delete.substring(commonlength); - } - // Factor out any common suffixies. - commonlength = diff_commonSuffix(text_insert, text_delete); - if (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); - } - } - // Delete the offending records and add the merged ones. - if (count_delete === 0) { - diffs.splice(pointer - count_insert, - count_delete + count_insert, [DIFF_INSERT, text_insert]); - } else if (count_insert === 0) { - diffs.splice(pointer - count_delete, - count_delete + count_insert, [DIFF_DELETE, text_delete]); - } else { - diffs.splice(pointer - count_delete - count_insert, - count_delete + count_insert, [DIFF_DELETE, text_delete], - [DIFF_INSERT, text_insert]); - } - pointer = pointer - count_delete - count_insert + - (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; - } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { - // Merge this equality with the previous one. - diffs[pointer - 1][1] += diffs[pointer][1]; - diffs.splice(pointer, 1); - } else { - pointer++; - } - count_insert = 0; - count_delete = 0; - text_delete = ''; - text_insert = ''; - break; - } - } - if (diffs[diffs.length - 1][1] === '') { - diffs.pop(); // Remove the dummy entry at the end. - } - - // Second pass: look for single edits surrounded on both sides by equalities - // which can be shifted sideways to eliminate an equality. - // e.g: ABAC -> ABAC - var changes = false; - pointer = 1; - // Intentionally ignore the first and last element (don't need checking). - while (pointer < diffs.length - 1) { - if (diffs[pointer - 1][0] == DIFF_EQUAL && - diffs[pointer + 1][0] == DIFF_EQUAL) { - // This is a single edit surrounded by equalities. - if (diffs[pointer][1].substring(diffs[pointer][1].length - - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { - // Shift the edit over the previous equality. - 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 = true; - } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == - diffs[pointer + 1][1]) { - // Shift the edit over the next equality. - 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 = true; - } - } - pointer++; - } - // If shifts were made, the diff needs reordering and another shift sweep. - if (changes) { - diff_cleanupMerge(diffs); - } - }; - - - var diff = diff_main; - diff.INSERT = DIFF_INSERT; - diff.DELETE = DIFF_DELETE; - diff.EQUAL = DIFF_EQUAL; - - module.exports = diff; - - /* - * Modify a diff such that the cursor position points to the start of a change: - * E.g. - * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) - * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] - * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) - * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] - * - * @param {Array} diffs Array of diff tuples - * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! - * @return {Array} A tuple [cursor location in the modified diff, modified diff] - */ - function cursor_normalize_diff (diffs, cursor_pos) { - if (cursor_pos === 0) { - return [DIFF_EQUAL, diffs]; - } - for (var current_pos = 0, i = 0; i < diffs.length; i++) { - var d = diffs[i]; - if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { - var next_pos = current_pos + d[1].length; - if (cursor_pos === next_pos) { - return [i + 1, diffs]; - } else if (cursor_pos < next_pos) { - // copy to prevent side effects - diffs = diffs.slice(); - // split d into two diff changes - var split_pos = cursor_pos - current_pos; - var d_left = [d[0], d[1].slice(0, split_pos)]; - var d_right = [d[0], d[1].slice(split_pos)]; - diffs.splice(i, 1, d_left, d_right); - return [i + 1, diffs]; - } else { - current_pos = next_pos; - } - } - } - throw new Error('cursor_pos is out of bounds!') - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +var levels = ['error', 'warn', 'log', 'info']; +var level = 'warn'; - /* - * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). - * - * Case 1) - * Check if a naive shift is possible: - * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) - * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result - * Case 2) - * Check if the following shifts are possible: - * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] - * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] - * ^ ^ - * d d_next - * - * @param {Array} diffs Array of diff tuples - * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! - * @return {Array} Array of diff tuples - */ - function fix_cursor (diffs, cursor_pos) { - var norm = cursor_normalize_diff(diffs, cursor_pos); - var ndiffs = norm[1]; - var cursor_pointer = norm[0]; - var d = ndiffs[cursor_pointer]; - var d_next = ndiffs[cursor_pointer + 1]; - - if (d == null) { - // Text was deleted from end of original string, - // cursor is now out of bounds in new string - return diffs; - } else if (d[0] !== DIFF_EQUAL) { - // A modification happened at the cursor location. - // This is the expected outcome, so we can return the original diff. - return diffs; - } else { - if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { - // Case 1) - // It is possible to perform a naive shift - ndiffs.splice(cursor_pointer, 2, d_next, d) - return merge_tuples(ndiffs, cursor_pointer, 2) - } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { - // Case 2) - // d[1] is a prefix of d_next[1] - // We can assume that d_next[0] !== 0, since d[0] === 0 - // Shift edit locations.. - ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); - var suffix = d_next[1].slice(d[1].length); - if (suffix.length > 0) { - ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); - } - return merge_tuples(ndiffs, cursor_pointer, 3) - } else { - // Not possible to perform any modification - return diffs; - } - } +function debug(method) { + if (levels.indexOf(method) <= levels.indexOf(level)) { + var _console; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + (_console = console)[method].apply(_console, args); // eslint-disable-line no-console + } +} + +function namespace(ns) { + return levels.reduce(function (logger, method) { + logger[method] = debug.bind(console, method, ns); + return logger; + }, {}); +} + +debug.level = namespace.level = function (newLevel) { + level = newLevel; +}; - } +exports.default = namespace; - /* - * Try to merge tuples with their neigbors in a given range. - * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] - * - * @param {Array} diffs Array of diff tuples. - * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). - * @param {Int} length Number of consecutive elements to check. - * @return {Array} Array of merged diff tuples. - */ - function merge_tuples (diffs, start, length) { - // Check from (start-1) to (start+length). - for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { - if (i + 1 < diffs.length) { - var left_d = diffs[i]; - var right_d = diffs[i+1]; - if (left_d[0] === right_d[1]) { - diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); - } - } - } - return diffs; - } +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { +var pSlice = Array.prototype.slice; +var objectKeys = __webpack_require__(52); +var isArguments = __webpack_require__(53); + +var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } +} + +function isUndefinedOrNull(value) { + return value === null || value === undefined; +} + +function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; +} + +function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; +} -/***/ }, -/* 22 */ -/***/ function(module, exports, __webpack_require__) { - var pSlice = Array.prototype.slice; - var objectKeys = __webpack_require__(23); - var isArguments = __webpack_require__(24); - - var deepEqual = module.exports = function (actual, expected, opts) { - if (!opts) opts = {}; - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { - return opts.strict ? actual === expected : actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected, opts); - } - } +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { - function isUndefinedOrNull(value) { - return value === null || value === undefined; - } +"use strict"; - function isBuffer (x) { - if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; - if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { - return false; - } - if (x.length > 0 && typeof x[0] !== 'number') return false; - return true; - } +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var Attributor = /** @class */ (function () { + function Attributor(attrName, keyName, options) { + if (options === void 0) { options = {}; } + this.attrName = attrName; + this.keyName = keyName; + var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; + if (options.scope != null) { + // Ignore type bits, force attribute bit + this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; + } + else { + this.scope = Registry.Scope.ATTRIBUTE; + } + if (options.whitelist != null) + this.whitelist = options.whitelist; + } + Attributor.keys = function (node) { + return [].map.call(node.attributes, function (item) { + return item.name; + }); + }; + Attributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + node.setAttribute(this.keyName, value); + return true; + }; + Attributor.prototype.canAdd = function (node, value) { + var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); + if (match == null) + return false; + if (this.whitelist == null) + return true; + if (typeof value === 'string') { + return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1; + } + else { + return this.whitelist.indexOf(value) > -1; + } + }; + Attributor.prototype.remove = function (node) { + node.removeAttribute(this.keyName); + }; + Attributor.prototype.value = function (node) { + var value = node.getAttribute(this.keyName); + if (this.canAdd(node, value) && value) { + return value; + } + return ''; + }; + return Attributor; +}()); +exports.default = Attributor; - function objEquiv(a, b, opts) { - var i, key; - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return deepEqual(a, b, opts); - } - if (isBuffer(a)) { - if (!isBuffer(b)) { - return false; - } - if (a.length !== b.length) return false; - for (i = 0; i < a.length; i++) { - if (a[i] !== b[i]) return false; - } - return true; - } - try { - var ka = objectKeys(a), - kb = objectKeys(b); - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!deepEqual(a[key], b[key], opts)) return false; - } - return typeof a === typeof b; - } +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 23 */ -/***/ function(module, exports) { +"use strict"; - exports = module.exports = typeof Object.keys === 'function' - ? Object.keys : shim; - exports.shim = shim; - function shim (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Code = undefined; +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); -/***/ }, -/* 24 */ -/***/ function(module, exports) { +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var supportsArgumentsClass = (function(){ - return Object.prototype.toString.call(arguments) - })() == '[object Arguments]'; - - exports = module.exports = supportsArgumentsClass ? supported : unsupported; - - exports.supported = supported; - function supported(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; - }; - - exports.unsupported = unsupported; - function unsupported(object){ - return object && - typeof object == 'object' && - typeof object.length == 'number' && - Object.prototype.hasOwnProperty.call(object, 'callee') && - !Object.prototype.propertyIsEnumerable.call(object, 'callee') || - false; - }; +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Code = function (_Inline) { + _inherits(Code, _Inline); + + function Code() { + _classCallCheck(this, Code); + + return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); + } + + return Code; +}(_inline2.default); + +Code.blotName = 'code'; +Code.tagName = 'CODE'; + +var CodeBlock = function (_Block) { + _inherits(CodeBlock, _Block); + + function CodeBlock() { + _classCallCheck(this, CodeBlock); + + return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); + } + + _createClass(CodeBlock, [{ + key: 'delta', + value: function delta() { + var _this3 = this; + + var text = this.domNode.textContent; + if (text.endsWith('\n')) { + // Should always be true + text = text.slice(0, -1); + } + return text.split('\n').reduce(function (delta, frag) { + return delta.insert(frag).insert('\n', _this3.formats()); + }, new _quillDelta2.default()); + } + }, { + key: 'format', + value: function format(name, value) { + if (name === this.statics.blotName && value) return; + + var _descendant = this.descendant(_text2.default, this.length() - 1), + _descendant2 = _slicedToArray(_descendant, 1), + text = _descendant2[0]; + + if (text != null) { + text.deleteAt(text.length() - 1, 1); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length === 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { + return; + } + var nextNewline = this.newlineIndex(index); + if (nextNewline < 0 || nextNewline >= index + length) return; + var prevNewline = this.newlineIndex(index, true) + 1; + var isolateLength = nextNewline - prevNewline + 1; + var blot = this.isolate(prevNewline, isolateLength); + var next = blot.next; + blot.format(name, value); + if (next instanceof CodeBlock) { + next.formatAt(0, index - prevNewline + length - isolateLength, name, value); + } + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return; + + var _descendant3 = this.descendant(_text2.default, index), + _descendant4 = _slicedToArray(_descendant3, 2), + text = _descendant4[0], + offset = _descendant4[1]; + + text.insertAt(offset, value); + } + }, { + key: 'length', + value: function length() { + var length = this.domNode.textContent.length; + if (!this.domNode.textContent.endsWith('\n')) { + return length + 1; + } + return length; + } + }, { + key: 'newlineIndex', + value: function newlineIndex(searchIndex) { + var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (!reverse) { + var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); + return offset > -1 ? searchIndex + offset : -1; + } else { + return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + if (!this.domNode.textContent.endsWith('\n')) { + this.appendChild(_parchment2.default.create('text', '\n')); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { + next.optimize(context); + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); + [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { + var blot = _parchment2.default.find(node); + if (blot == null) { + node.parentNode.removeChild(node); + } else if (blot instanceof _parchment2.default.Embed) { + blot.remove(); + } else { + blot.unwrap(); + } + }); + } + }], [{ + key: 'create', + value: function create(value) { + var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); + domNode.setAttribute('spellcheck', false); + return domNode; + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return CodeBlock; +}(_block2.default); + +CodeBlock.blotName = 'code-block'; +CodeBlock.tagName = 'PRE'; +CodeBlock.TAB = ' '; -/***/ }, -/* 25 */ -/***/ function(module, exports) { +exports.Code = Code; +exports.default = CodeBlock; - 'use strict'; +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { - var hasOwn = Object.prototype.hasOwnProperty; - var toStr = Object.prototype.toString; +"use strict"; - var isArray = function isArray(arr) { - if (typeof Array.isArray === 'function') { - return Array.isArray(arr); - } - return toStr.call(arr) === '[object Array]'; - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); - var isPlainObject = function isPlainObject(obj) { - if (!obj || toStr.call(obj) !== '[object Object]') { - return false; - } +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - var hasOwnConstructor = hasOwn.call(obj, 'constructor'); - var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); - // Not own constructor property must be Object - if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { - return false; - } +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - var key; - for (key in obj) {/**/} - - return typeof key === 'undefined' || hasOwn.call(obj, key); - }; - - module.exports = function extend() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0], - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if (typeof target === 'boolean') { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) { - target = {}; - } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - for (; i < length; ++i) { - options = arguments[i]; - // Only deal with non-null/undefined values - if (options != null) { - // Extend the base object - for (name in options) { - src = target[name]; - copy = options[name]; - - // Prevent never-ending loop - if (target !== copy) { - // Recurse if we're merging plain objects or arrays - if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { - if (copyIsArray) { - copyIsArray = false; - clone = src && isArray(src) ? src : []; - } else { - clone = src && isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[name] = extend(deep, clone, copy); - - // Don't bring in undefined values - } else if (typeof copy !== 'undefined') { - target[name] = copy; - } - } - } - } - } +var _quillDelta = __webpack_require__(2); - // Return the modified object - return target; - }; +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _cursor = __webpack_require__(24); + +var _cursor2 = _interopRequireDefault(_cursor); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var ASCII = /^[ -~]*$/; + +var Editor = function () { + function Editor(scroll) { + _classCallCheck(this, Editor); + + this.scroll = scroll; + this.delta = this.getDelta(); + } + + _createClass(Editor, [{ + key: 'applyDelta', + value: function applyDelta(delta) { + var _this = this; + + var consumeNextNewline = false; + this.scroll.update(); + var scrollLength = this.scroll.length(); + this.scroll.batchStart(); + delta = normalizeDelta(delta); + delta.reduce(function (index, op) { + var length = op.retain || op.delete || op.insert.length || 1; + var attributes = op.attributes || {}; + if (op.insert != null) { + if (typeof op.insert === 'string') { + var text = op.insert; + if (text.endsWith('\n') && consumeNextNewline) { + consumeNextNewline = false; + text = text.slice(0, -1); + } + if (index >= scrollLength && !text.endsWith('\n')) { + consumeNextNewline = true; + } + _this.scroll.insertAt(index, text); + + var _scroll$line = _this.scroll.line(index), + _scroll$line2 = _slicedToArray(_scroll$line, 2), + line = _scroll$line2[0], + offset = _scroll$line2[1]; + + var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); + if (line instanceof _block2.default) { + var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), + _line$descendant2 = _slicedToArray(_line$descendant, 1), + leaf = _line$descendant2[0]; + + formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); + } + attributes = _op2.default.attributes.diff(formats, attributes) || {}; + } else if (_typeof(op.insert) === 'object') { + var key = Object.keys(op.insert)[0]; // There should only be one key + if (key == null) return index; + _this.scroll.insertAt(index, key, op.insert[key]); + } + scrollLength += length; + } + Object.keys(attributes).forEach(function (name) { + _this.scroll.formatAt(index, length, name, attributes[name]); + }); + return index + length; + }, 0); + delta.reduce(function (index, op) { + if (typeof op.delete === 'number') { + _this.scroll.deleteAt(index, op.delete); + return index; + } + return index + (op.retain || op.insert.length || 1); + }, 0); + this.scroll.batchEnd(); + return this.update(delta); + } + }, { + key: 'deleteText', + value: function deleteText(index, length) { + this.scroll.deleteAt(index, length); + return this.update(new _quillDelta2.default().retain(index).delete(length)); + } + }, { + key: 'formatLine', + value: function formatLine(index, length) { + var _this2 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + this.scroll.update(); + Object.keys(formats).forEach(function (format) { + if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return; + var lines = _this2.scroll.lines(index, Math.max(length, 1)); + var lengthRemaining = length; + lines.forEach(function (line) { + var lineLength = line.length(); + if (!(line instanceof _code2.default)) { + line.format(format, formats[format]); + } else { + var codeIndex = index - line.offset(_this2.scroll); + var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; + line.formatAt(codeIndex, codeLength, format, formats[format]); + } + lengthRemaining -= lineLength; + }); + }); + this.scroll.optimize(); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'formatText', + value: function formatText(index, length) { + var _this3 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + Object.keys(formats).forEach(function (format) { + _this3.scroll.formatAt(index, length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'getContents', + value: function getContents(index, length) { + return this.delta.slice(index, index + length); + } + }, { + key: 'getDelta', + value: function getDelta() { + return this.scroll.lines().reduce(function (delta, line) { + return delta.concat(line.delta()); + }, new _quillDelta2.default()); + } + }, { + key: 'getFormat', + value: function getFormat(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var lines = [], + leaves = []; + if (length === 0) { + this.scroll.path(index).forEach(function (path) { + var _path = _slicedToArray(path, 1), + blot = _path[0]; + + if (blot instanceof _block2.default) { + lines.push(blot); + } else if (blot instanceof _parchment2.default.Leaf) { + leaves.push(blot); + } + }); + } else { + lines = this.scroll.lines(index, length); + leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); + } + var formatsArr = [lines, leaves].map(function (blots) { + if (blots.length === 0) return {}; + var formats = (0, _block.bubbleFormats)(blots.shift()); + while (Object.keys(formats).length > 0) { + var blot = blots.shift(); + if (blot == null) return formats; + formats = combineFormats((0, _block.bubbleFormats)(blot), formats); + } + return formats; + }); + return _extend2.default.apply(_extend2.default, formatsArr); + } + }, { + key: 'getText', + value: function getText(index, length) { + return this.getContents(index, length).filter(function (op) { + return typeof op.insert === 'string'; + }).map(function (op) { + return op.insert; + }).join(''); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + this.scroll.insertAt(index, embed, value); + return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); + } + }, { + key: 'insertText', + value: function insertText(index, text) { + var _this4 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + this.scroll.insertAt(index, text); + Object.keys(formats).forEach(function (format) { + _this4.scroll.formatAt(index, text.length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); + } + }, { + key: 'isBlank', + value: function isBlank() { + if (this.scroll.children.length == 0) return true; + if (this.scroll.children.length > 1) return false; + var block = this.scroll.children.head; + if (block.statics.blotName !== _block2.default.blotName) return false; + if (block.children.length > 1) return false; + return block.children.head instanceof _break2.default; + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length) { + var text = this.getText(index, length); + + var _scroll$line3 = this.scroll.line(index + length), + _scroll$line4 = _slicedToArray(_scroll$line3, 2), + line = _scroll$line4[0], + offset = _scroll$line4[1]; + + var suffixLength = 0, + suffix = new _quillDelta2.default(); + if (line != null) { + if (!(line instanceof _code2.default)) { + suffixLength = line.length() - offset; + } else { + suffixLength = line.newlineIndex(offset) - offset + 1; + } + suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); + } + var contents = this.getContents(index, length + suffixLength); + var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); + var delta = new _quillDelta2.default().retain(index).concat(diff); + return this.applyDelta(delta); + } + }, { + key: 'update', + value: function update(change) { + var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + + var oldDelta = this.delta; + if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) { + // Optimization for character changes + var textBlot = _parchment2.default.find(mutations[0].target); + var formats = (0, _block.bubbleFormats)(textBlot); + var index = textBlot.offset(this.scroll); + var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); + var oldText = new _quillDelta2.default().insert(oldValue); + var newText = new _quillDelta2.default().insert(textBlot.value()); + var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); + change = diffDelta.reduce(function (delta, op) { + if (op.insert) { + return delta.insert(op.insert, formats); + } else { + return delta.push(op); + } + }, new _quillDelta2.default()); + this.delta = oldDelta.compose(change); + } else { + this.delta = this.getDelta(); + if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { + change = oldDelta.diff(this.delta, cursorIndex); + } + } + return change; + } + }]); + + return Editor; +}(); + +function combineFormats(formats, combined) { + return Object.keys(combined).reduce(function (merged, name) { + if (formats[name] == null) return merged; + if (combined[name] === formats[name]) { + merged[name] = combined[name]; + } else if (Array.isArray(combined[name])) { + if (combined[name].indexOf(formats[name]) < 0) { + merged[name] = combined[name].concat([formats[name]]); + } + } else { + merged[name] = [combined[name], formats[name]]; + } + return merged; + }, {}); +} + +function normalizeDelta(delta) { + return delta.reduce(function (delta, op) { + if (op.insert === 1) { + var attributes = (0, _clone2.default)(op.attributes); + delete attributes['image']; + return delta.insert({ image: op.attributes.image }, attributes); + } + if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { + op = (0, _clone2.default)(op); + if (op.attributes.list) { + op.attributes.list = 'ordered'; + } else { + op.attributes.list = 'bullet'; + delete op.attributes.bullet; + } + } + if (typeof op.insert === 'string') { + var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + return delta.insert(text, op.attributes); + } + return delta.push(op); + }, new _quillDelta2.default()); +} +exports.default = Editor; +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 26 */ -/***/ function(module, exports, __webpack_require__) { +"use strict"; - var equal = __webpack_require__(22); - var extend = __webpack_require__(25); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Range = undefined; - var lib = { - attributes: { - compose: function (a, b, keepNull) { - if (typeof a !== 'object') a = {}; - if (typeof b !== 'object') b = {}; - var attributes = extend(true, {}, b); - if (!keepNull) { - attributes = Object.keys(attributes).reduce(function (copy, key) { - if (attributes[key] != null) { - copy[key] = attributes[key]; - } - return copy; - }, {}); - } - for (var key in a) { - if (a[key] !== undefined && b[key] === undefined) { - attributes[key] = a[key]; - } - } - return Object.keys(attributes).length > 0 ? attributes : undefined; - }, - - diff: function(a, b) { - if (typeof a !== 'object') a = {}; - if (typeof b !== 'object') b = {}; - var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { - if (!equal(a[key], b[key])) { - attributes[key] = b[key] === undefined ? null : b[key]; - } - return attributes; - }, {}); - return Object.keys(attributes).length > 0 ? attributes : undefined; - }, - - transform: function (a, b, priority) { - if (typeof a !== 'object') return b; - if (typeof b !== 'object') return undefined; - if (!priority) return b; // b simply overwrites us without priority - var attributes = Object.keys(b).reduce(function (attributes, key) { - if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value - return attributes; - }, {}); - return Object.keys(attributes).length > 0 ? attributes : undefined; - } - }, - - iterator: function (ops) { - return new Iterator(ops); - }, - - length: function (op) { - if (typeof op['delete'] === 'number') { - return op['delete']; - } else if (typeof op.retain === 'number') { - return op.retain; - } else { - return typeof op.insert === 'string' ? op.insert.length : 1; - } - } - }; - - - function Iterator(ops) { - this.ops = ops; - this.index = 0; - this.offset = 0; - }; - - Iterator.prototype.hasNext = function () { - return this.peekLength() < Infinity; - }; - - Iterator.prototype.next = function (length) { - if (!length) length = Infinity; - var nextOp = this.ops[this.index]; - if (nextOp) { - var offset = this.offset; - var opLength = lib.length(nextOp) - if (length >= opLength - offset) { - length = opLength - offset; - this.index += 1; - this.offset = 0; - } else { - this.offset += length; - } - if (typeof nextOp['delete'] === 'number') { - return { 'delete': length }; - } else { - var retOp = {}; - if (nextOp.attributes) { - retOp.attributes = nextOp.attributes; - } - if (typeof nextOp.retain === 'number') { - retOp.retain = length; - } else if (typeof nextOp.insert === 'string') { - retOp.insert = nextOp.insert.substr(offset, length); - } else { - // offset should === 0, length should === 1 - retOp.insert = nextOp.insert; - } - return retOp; - } - } else { - return { retain: Infinity }; - } - }; - - Iterator.prototype.peek = function () { - return this.ops[this.index]; - }; - - Iterator.prototype.peekLength = function () { - if (this.ops[this.index]) { - // Should never return 0 if our index is being managed correctly - return lib.length(this.ops[this.index]) - this.offset; - } else { - return Infinity; - } - }; - - Iterator.prototype.peekType = function () { - if (this.ops[this.index]) { - if (typeof this.ops[this.index]['delete'] === 'number') { - return 'delete'; - } else if (typeof this.ops[this.index].retain === 'number') { - return 'retain'; - } else { - return 'insert'; - } - } - return 'retain'; - }; - - - module.exports = lib; - - -/***/ }, -/* 27 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _quillDelta = __webpack_require__(20); - - var _quillDelta2 = _interopRequireDefault(_quillDelta); - - var _op = __webpack_require__(26); - - var _op2 = _interopRequireDefault(_op); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _code = __webpack_require__(28); - - var _code2 = _interopRequireDefault(_code); - - var _cursor = __webpack_require__(35); - - var _cursor2 = _interopRequireDefault(_cursor); - - var _block = __webpack_require__(29); - - var _block2 = _interopRequireDefault(_block); - - var _clone = __webpack_require__(39); - - var _clone2 = _interopRequireDefault(_clone); - - var _deepEqual = __webpack_require__(40); - - var _deepEqual2 = _interopRequireDefault(_deepEqual); - - var _extend = __webpack_require__(30); - - var _extend2 = _interopRequireDefault(_extend); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var Editor = function () { - function Editor(scroll) { - _classCallCheck(this, Editor); - - this.scroll = scroll; - this.delta = this.getDelta(); - } - - _createClass(Editor, [{ - key: 'applyDelta', - value: function applyDelta(delta) { - var _this = this; - - var consumeNextNewline = false; - this.scroll.update(); - var scrollLength = this.scroll.length(); - this.scroll.batch = true; - delta = normalizeDelta(delta); - delta.reduce(function (index, op) { - var length = op.retain || op.delete || op.insert.length || 1; - var attributes = op.attributes || {}; - if (op.insert != null) { - if (typeof op.insert === 'string') { - var text = op.insert; - if (text.endsWith('\n') && consumeNextNewline) { - consumeNextNewline = false; - text = text.slice(0, -1); - } - if (index >= scrollLength && !text.endsWith('\n')) { - consumeNextNewline = true; - } - _this.scroll.insertAt(index, text); - - var _scroll$line = _this.scroll.line(index), - _scroll$line2 = _slicedToArray(_scroll$line, 2), - line = _scroll$line2[0], - offset = _scroll$line2[1]; - - var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); - if (line instanceof _block2.default) { - var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), - _line$descendant2 = _slicedToArray(_line$descendant, 1), - leaf = _line$descendant2[0]; - - formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); - } - attributes = _op2.default.attributes.diff(formats, attributes) || {}; - } else if (_typeof(op.insert) === 'object') { - var key = Object.keys(op.insert)[0]; // There should only be one key - if (key == null) return index; - _this.scroll.insertAt(index, key, op.insert[key]); - } - scrollLength += length; - } - Object.keys(attributes).forEach(function (name) { - _this.scroll.formatAt(index, length, name, attributes[name]); - }); - return index + length; - }, 0); - delta.reduce(function (index, op) { - if (typeof op.delete === 'number') { - _this.scroll.deleteAt(index, op.delete); - return index; - } - return index + (op.retain || op.insert.length || 1); - }, 0); - this.scroll.batch = false; - this.scroll.optimize(); - return this.update(delta); - } - }, { - key: 'deleteText', - value: function deleteText(index, length) { - this.scroll.deleteAt(index, length); - return this.update(new _quillDelta2.default().retain(index).delete(length)); - } - }, { - key: 'formatLine', - value: function formatLine(index, length) { - var _this2 = this; - - var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - this.scroll.update(); - Object.keys(formats).forEach(function (format) { - var lines = _this2.scroll.lines(index, Math.max(length, 1)); - var lengthRemaining = length; - lines.forEach(function (line) { - var lineLength = line.length(); - if (!(line instanceof _code2.default)) { - line.format(format, formats[format]); - } else { - var codeIndex = index - line.offset(_this2.scroll); - var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; - line.formatAt(codeIndex, codeLength, format, formats[format]); - } - lengthRemaining -= lineLength; - }); - }); - this.scroll.optimize(); - return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); - } - }, { - key: 'formatText', - value: function formatText(index, length) { - var _this3 = this; - - var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - Object.keys(formats).forEach(function (format) { - _this3.scroll.formatAt(index, length, format, formats[format]); - }); - return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); - } - }, { - key: 'getContents', - value: function getContents(index, length) { - return this.delta.slice(index, index + length); - } - }, { - key: 'getDelta', - value: function getDelta() { - return this.scroll.lines().reduce(function (delta, line) { - return delta.concat(line.delta()); - }, new _quillDelta2.default()); - } - }, { - key: 'getFormat', - value: function getFormat(index) { - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var lines = [], - leaves = []; - if (length === 0) { - this.scroll.path(index).forEach(function (path) { - var _path = _slicedToArray(path, 1), - blot = _path[0]; - - if (blot instanceof _block2.default) { - lines.push(blot); - } else if (blot instanceof _parchment2.default.Leaf) { - leaves.push(blot); - } - }); - } else { - lines = this.scroll.lines(index, length); - leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); - } - var formatsArr = [lines, leaves].map(function (blots) { - if (blots.length === 0) return {}; - var formats = (0, _block.bubbleFormats)(blots.shift()); - while (Object.keys(formats).length > 0) { - var blot = blots.shift(); - if (blot == null) return formats; - formats = combineFormats((0, _block.bubbleFormats)(blot), formats); - } - return formats; - }); - return _extend2.default.apply(_extend2.default, formatsArr); - } - }, { - key: 'getText', - value: function getText(index, length) { - return this.getContents(index, length).filter(function (op) { - return typeof op.insert === 'string'; - }).map(function (op) { - return op.insert; - }).join(''); - } - }, { - key: 'insertEmbed', - value: function insertEmbed(index, embed, value) { - this.scroll.insertAt(index, embed, value); - return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); - } - }, { - key: 'insertText', - value: function insertText(index, text) { - var _this4 = this; - - var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); - this.scroll.insertAt(index, text); - Object.keys(formats).forEach(function (format) { - _this4.scroll.formatAt(index, text.length, format, formats[format]); - }); - return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); - } - }, { - key: 'isBlank', - value: function isBlank() { - if (this.scroll.children.length == 0) return true; - if (this.scroll.children.length > 1) return false; - var child = this.scroll.children.head; - return child.length() <= 1 && Object.keys(child.formats()).length == 0; - } - }, { - key: 'removeFormat', - value: function removeFormat(index, length) { - var text = this.getText(index, length); - - var _scroll$line3 = this.scroll.line(index + length), - _scroll$line4 = _slicedToArray(_scroll$line3, 2), - line = _scroll$line4[0], - offset = _scroll$line4[1]; - - var suffixLength = 0, - suffix = new _quillDelta2.default(); - if (line != null) { - if (!(line instanceof _code2.default)) { - suffixLength = line.length() - offset; - } else { - suffixLength = line.newlineIndex(offset) - offset + 1; - } - suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); - } - var contents = this.getContents(index, length + suffixLength); - var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); - var delta = new _quillDelta2.default().retain(index).concat(diff); - return this.applyDelta(delta); - } - }, { - key: 'update', - value: function update(change) { - var _this5 = this; - - var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; - - var oldDelta = this.delta; - if (mutations.length === 1 && mutations[0].type === 'characterData' && _parchment2.default.find(mutations[0].target)) { - (function () { - // Optimization for character changes - var textBlot = _parchment2.default.find(mutations[0].target); - var formats = (0, _block.bubbleFormats)(textBlot); - var index = textBlot.offset(_this5.scroll); - var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); - var oldText = new _quillDelta2.default().insert(oldValue); - var newText = new _quillDelta2.default().insert(textBlot.value()); - var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); - change = diffDelta.reduce(function (delta, op) { - if (op.insert) { - return delta.insert(op.insert, formats); - } else { - return delta.push(op); - } - }, new _quillDelta2.default()); - _this5.delta = oldDelta.compose(change); - })(); - } else { - this.delta = this.getDelta(); - if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { - change = oldDelta.diff(this.delta, cursorIndex); - } - } - return change; - } - }]); - - return Editor; - }(); - - function combineFormats(formats, combined) { - return Object.keys(combined).reduce(function (merged, name) { - if (formats[name] == null) return merged; - if (combined[name] === formats[name]) { - merged[name] = combined[name]; - } else if (Array.isArray(combined[name])) { - if (combined[name].indexOf(formats[name]) < 0) { - merged[name] = combined[name].concat([formats[name]]); - } - } else { - merged[name] = [combined[name], formats[name]]; - } - return merged; - }, {}); - } +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - function normalizeDelta(delta) { - return delta.reduce(function (delta, op) { - if (op.insert === 1) { - var attributes = (0, _clone2.default)(op.attributes); - delete attributes['image']; - return delta.insert({ image: op.attributes.image }, attributes); - } - if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { - op = (0, _clone2.default)(op); - if (op.attributes.list) { - op.attributes.list = 'ordered'; - } else { - op.attributes.list = 'bullet'; - delete op.attributes.bullet; - } - } - if (typeof op.insert === 'string') { - var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); - return delta.insert(text, op.attributes); - } - return delta.push(op); - }, new _quillDelta2.default()); - } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - exports.default = Editor; +var _parchment = __webpack_require__(0); -/***/ }, -/* 28 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.Code = undefined; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _quillDelta = __webpack_require__(20); - - var _quillDelta2 = _interopRequireDefault(_quillDelta); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _block = __webpack_require__(29); - - var _block2 = _interopRequireDefault(_block); - - var _inline = __webpack_require__(33); - - var _inline2 = _interopRequireDefault(_inline); - - var _text = __webpack_require__(34); - - var _text2 = _interopRequireDefault(_text); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var Code = function (_Inline) { - _inherits(Code, _Inline); - - function Code() { - _classCallCheck(this, Code); - - return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); - } - - return Code; - }(_inline2.default); - - Code.blotName = 'code'; - Code.tagName = 'CODE'; - - var CodeBlock = function (_Block) { - _inherits(CodeBlock, _Block); - - function CodeBlock() { - _classCallCheck(this, CodeBlock); - - return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); - } - - _createClass(CodeBlock, [{ - key: 'delta', - value: function delta() { - var _this3 = this; - - var text = this.domNode.textContent; - if (text.endsWith('\n')) { - // Should always be true - text = text.slice(0, -1); - } - return text.split('\n').reduce(function (delta, frag) { - return delta.insert(frag).insert('\n', _this3.formats()); - }, new _quillDelta2.default()); - } - }, { - key: 'format', - value: function format(name, value) { - if (name === this.statics.blotName && value) return; - - var _descendant = this.descendant(_text2.default, this.length() - 1), - _descendant2 = _slicedToArray(_descendant, 1), - text = _descendant2[0]; - - if (text != null) { - text.deleteAt(text.length() - 1, 1); - } - _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); - } - }, { - key: 'formatAt', - value: function formatAt(index, length, name, value) { - if (length === 0) return; - if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { - return; - } - var nextNewline = this.newlineIndex(index); - if (nextNewline < 0 || nextNewline >= index + length) return; - var prevNewline = this.newlineIndex(index, true) + 1; - var isolateLength = nextNewline - prevNewline + 1; - var blot = this.isolate(prevNewline, isolateLength); - var next = blot.next; - blot.format(name, value); - if (next instanceof CodeBlock) { - next.formatAt(0, index - prevNewline + length - isolateLength, name, value); - } - } - }, { - key: 'insertAt', - value: function insertAt(index, value, def) { - if (def != null) return; - - var _descendant3 = this.descendant(_text2.default, index), - _descendant4 = _slicedToArray(_descendant3, 2), - text = _descendant4[0], - offset = _descendant4[1]; - - text.insertAt(offset, value); - } - }, { - key: 'length', - value: function length() { - var length = this.domNode.textContent.length; - if (!this.domNode.textContent.endsWith('\n')) { - return length + 1; - } - return length; - } - }, { - key: 'newlineIndex', - value: function newlineIndex(searchIndex) { - var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (!reverse) { - var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); - return offset > -1 ? searchIndex + offset : -1; - } else { - return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); - } - } - }, { - key: 'optimize', - value: function optimize() { - if (!this.domNode.textContent.endsWith('\n')) { - this.appendChild(_parchment2.default.create('text', '\n')); - } - _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this); - var next = this.next; - if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { - next.optimize(); - next.moveChildren(this); - next.remove(); - } - } - }, { - key: 'replace', - value: function replace(target) { - _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); - [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { - var blot = _parchment2.default.find(node); - if (blot == null) { - node.parentNode.removeChild(node); - } else if (blot instanceof _parchment2.default.Embed) { - blot.remove(); - } else { - blot.unwrap(); - } - }); - } - }], [{ - key: 'create', - value: function create(value) { - var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); - domNode.setAttribute('spellcheck', false); - return domNode; - } - }, { - key: 'formats', - value: function formats() { - return true; - } - }]); - - return CodeBlock; - }(_block2.default); - - CodeBlock.blotName = 'code-block'; - CodeBlock.tagName = 'PRE'; - CodeBlock.TAB = ' '; +var _parchment2 = _interopRequireDefault(_parchment); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill:selection'); + +var Range = function Range(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + _classCallCheck(this, Range); + + this.index = index; + this.length = length; +}; + +var Selection = function () { + function Selection(scroll, emitter) { + var _this = this; + + _classCallCheck(this, Selection); + + this.emitter = emitter; + this.scroll = scroll; + this.composing = false; + this.mouseDown = false; + this.root = this.scroll.domNode; + this.cursor = _parchment2.default.create('cursor', this); + // savedRange is last non-null range + this.lastRange = this.savedRange = new Range(0, 0); + this.handleComposition(); + this.handleDragging(); + this.emitter.listenDOM('selectionchange', document, function () { + if (!_this.mouseDown) { + setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1); + } + }); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { + if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { + _this.update(_emitter4.default.sources.SILENT); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { + if (!_this.hasFocus()) return; + var native = _this.getNativeRange(); + if (native == null) return; + if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle + // TODO unclear if this has negative side effects + _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { + try { + _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); + } catch (ignored) {} + }); + }); + this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) { + if (context.range) { + var _context$range = context.range, + startNode = _context$range.startNode, + startOffset = _context$range.startOffset, + endNode = _context$range.endNode, + endOffset = _context$range.endOffset; + + _this.setNativeRange(startNode, startOffset, endNode, endOffset); + } + }); + this.update(_emitter4.default.sources.SILENT); + } + + _createClass(Selection, [{ + key: 'handleComposition', + value: function handleComposition() { + var _this2 = this; + + this.root.addEventListener('compositionstart', function () { + _this2.composing = true; + }); + this.root.addEventListener('compositionend', function () { + _this2.composing = false; + if (_this2.cursor.parent) { + var range = _this2.cursor.restore(); + if (!range) return; + setTimeout(function () { + _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset); + }, 1); + } + }); + } + }, { + key: 'handleDragging', + value: function handleDragging() { + var _this3 = this; + + this.emitter.listenDOM('mousedown', document.body, function () { + _this3.mouseDown = true; + }); + this.emitter.listenDOM('mouseup', document.body, function () { + _this3.mouseDown = false; + _this3.update(_emitter4.default.sources.USER); + }); + } + }, { + key: 'focus', + value: function focus() { + if (this.hasFocus()) return; + this.root.focus(); + this.setRange(this.savedRange); + } + }, { + key: 'format', + value: function format(_format, value) { + if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return; + this.scroll.update(); + var nativeRange = this.getNativeRange(); + if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; + if (nativeRange.start.node !== this.cursor.textNode) { + var blot = _parchment2.default.find(nativeRange.start.node, false); + if (blot == null) return; + // TODO Give blot ability to not split + if (blot instanceof _parchment2.default.Leaf) { + var after = blot.split(nativeRange.start.offset); + blot.parent.insertBefore(this.cursor, after); + } else { + blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen + } + this.cursor.attach(); + } + this.cursor.format(_format, value); + this.scroll.optimize(); + this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); + this.update(); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var scrollLength = this.scroll.length(); + index = Math.min(index, scrollLength - 1); + length = Math.min(index + length, scrollLength - 1) - index; + var node = void 0, + _scroll$leaf = this.scroll.leaf(index), + _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), + leaf = _scroll$leaf2[0], + offset = _scroll$leaf2[1]; + if (leaf == null) return null; + + var _leaf$position = leaf.position(offset, true); + + var _leaf$position2 = _slicedToArray(_leaf$position, 2); + + node = _leaf$position2[0]; + offset = _leaf$position2[1]; + + var range = document.createRange(); + if (length > 0) { + range.setStart(node, offset); + + var _scroll$leaf3 = this.scroll.leaf(index + length); + + var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); + + leaf = _scroll$leaf4[0]; + offset = _scroll$leaf4[1]; + + if (leaf == null) return null; + + var _leaf$position3 = leaf.position(offset, true); + + var _leaf$position4 = _slicedToArray(_leaf$position3, 2); + + node = _leaf$position4[0]; + offset = _leaf$position4[1]; + + range.setEnd(node, offset); + return range.getBoundingClientRect(); + } else { + var side = 'left'; + var rect = void 0; + if (node instanceof Text) { + if (offset < node.data.length) { + range.setStart(node, offset); + range.setEnd(node, offset + 1); + } else { + range.setStart(node, offset - 1); + range.setEnd(node, offset); + side = 'right'; + } + rect = range.getBoundingClientRect(); + } else { + rect = leaf.domNode.getBoundingClientRect(); + if (offset > 0) side = 'right'; + } + return { + bottom: rect.top + rect.height, + height: rect.height, + left: rect[side], + right: rect[side], + top: rect.top, + width: 0 + }; + } + } + }, { + key: 'getNativeRange', + value: function getNativeRange() { + var selection = document.getSelection(); + if (selection == null || selection.rangeCount <= 0) return null; + var nativeRange = selection.getRangeAt(0); + if (nativeRange == null) return null; + var range = this.normalizeNative(nativeRange); + debug.info('getNativeRange', range); + return range; + } + }, { + key: 'getRange', + value: function getRange() { + var normalized = this.getNativeRange(); + if (normalized == null) return [null, null]; + var range = this.normalizedToRange(normalized); + return [range, normalized]; + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return document.activeElement === this.root; + } + }, { + key: 'normalizedToRange', + value: function normalizedToRange(range) { + var _this4 = this; + + var positions = [[range.start.node, range.start.offset]]; + if (!range.native.collapsed) { + positions.push([range.end.node, range.end.offset]); + } + var indexes = positions.map(function (position) { + var _position = _slicedToArray(position, 2), + node = _position[0], + offset = _position[1]; + + var blot = _parchment2.default.find(node, true); + var index = blot.offset(_this4.scroll); + if (offset === 0) { + return index; + } else if (blot instanceof _parchment2.default.Container) { + return index + blot.length(); + } else { + return index + blot.index(node, offset); + } + }); + var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1); + var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes))); + return new Range(start, end - start); + } + }, { + key: 'normalizeNative', + value: function normalizeNative(nativeRange) { + if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { + return null; + } + var range = { + start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, + end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, + native: nativeRange + }; + [range.start, range.end].forEach(function (position) { + var node = position.node, + offset = position.offset; + while (!(node instanceof Text) && node.childNodes.length > 0) { + if (node.childNodes.length > offset) { + node = node.childNodes[offset]; + offset = 0; + } else if (node.childNodes.length === offset) { + node = node.lastChild; + offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; + } else { + break; + } + } + position.node = node, position.offset = offset; + }); + return range; + } + }, { + key: 'rangeToNative', + value: function rangeToNative(range) { + var _this5 = this; + + var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; + var args = []; + var scrollLength = this.scroll.length(); + indexes.forEach(function (index, i) { + index = Math.min(scrollLength - 1, index); + var node = void 0, + _scroll$leaf5 = _this5.scroll.leaf(index), + _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), + leaf = _scroll$leaf6[0], + offset = _scroll$leaf6[1]; + var _leaf$position5 = leaf.position(offset, i !== 0); + + var _leaf$position6 = _slicedToArray(_leaf$position5, 2); + + node = _leaf$position6[0]; + offset = _leaf$position6[1]; + + args.push(node, offset); + }); + if (args.length < 2) { + args = args.concat(args); + } + return args; + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView(scrollingContainer) { + var range = this.lastRange; + if (range == null) return; + var bounds = this.getBounds(range.index, range.length); + if (bounds == null) return; + var limit = this.scroll.length() - 1; + + var _scroll$line = this.scroll.line(Math.min(range.index, limit)), + _scroll$line2 = _slicedToArray(_scroll$line, 1), + first = _scroll$line2[0]; + + var last = first; + if (range.length > 0) { + var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit)); + + var _scroll$line4 = _slicedToArray(_scroll$line3, 1); + + last = _scroll$line4[0]; + } + if (first == null || last == null) return; + var scrollBounds = scrollingContainer.getBoundingClientRect(); + if (bounds.top < scrollBounds.top) { + scrollingContainer.scrollTop -= scrollBounds.top - bounds.top; + } else if (bounds.bottom > scrollBounds.bottom) { + scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom; + } + } + }, { + key: 'setNativeRange', + value: function setNativeRange(startNode, startOffset) { + var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; + var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; + var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); + if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { + return; + } + var selection = document.getSelection(); + if (selection == null) return; + if (startNode != null) { + if (!this.hasFocus()) this.root.focus(); + var native = (this.getNativeRange() || {}).native; + if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) { + + if (startNode.tagName == "BR") { + startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode); + startNode = startNode.parentNode; + } + if (endNode.tagName == "BR") { + endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode); + endNode = endNode.parentNode; + } + var range = document.createRange(); + range.setStart(startNode, startOffset); + range.setEnd(endNode, endOffset); + selection.removeAllRanges(); + selection.addRange(range); + } + } else { + selection.removeAllRanges(); + this.root.blur(); + document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) + } + } + }, { + key: 'setRange', + value: function setRange(range) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + if (typeof force === 'string') { + source = force; + force = false; + } + debug.info('setRange', range); + if (range != null) { + var args = this.rangeToNative(range); + this.setNativeRange.apply(this, _toConsumableArray(args).concat([force])); + } else { + this.setNativeRange(null); + } + this.update(source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var oldRange = this.lastRange; + + var _getRange = this.getRange(), + _getRange2 = _slicedToArray(_getRange, 2), + lastRange = _getRange2[0], + nativeRange = _getRange2[1]; + + this.lastRange = lastRange; + if (this.lastRange != null) { + this.savedRange = this.lastRange; + } + if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { + var _emitter; + + if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { + this.cursor.restore(); + } + var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + } + }]); + + return Selection; +}(); + +function contains(parent, descendant) { + try { + // Firefox inserts inaccessible nodes around video elements + descendant.parentNode; + } catch (e) { + return false; + } + // IE11 has bug with Text nodes + // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect + if (descendant instanceof Text) { + descendant = descendant.parentNode; + } + return parent.contains(descendant); +} - exports.Code = Code; - exports.default = CodeBlock; +exports.Range = Range; +exports.default = Selection; -/***/ }, -/* 29 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _extend = __webpack_require__(30); - - var _extend2 = _interopRequireDefault(_extend); - - var _quillDelta = __webpack_require__(20); - - var _quillDelta2 = _interopRequireDefault(_quillDelta); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _break = __webpack_require__(31); - - var _break2 = _interopRequireDefault(_break); - - var _embed = __webpack_require__(32); - - var _embed2 = _interopRequireDefault(_embed); - - var _inline = __webpack_require__(33); - - var _inline2 = _interopRequireDefault(_inline); - - var _text = __webpack_require__(34); - - var _text2 = _interopRequireDefault(_text); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var NEWLINE_LENGTH = 1; - - var BlockEmbed = function (_Embed) { - _inherits(BlockEmbed, _Embed); - - function BlockEmbed() { - _classCallCheck(this, BlockEmbed); - - return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); - } - - _createClass(BlockEmbed, [{ - key: 'attach', - value: function attach() { - _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); - this.attributes = new _parchment2.default.Attributor.Store(this.domNode); - } - }, { - key: 'delta', - value: function delta() { - return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); - } - }, { - key: 'format', - value: function format(name, value) { - var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); - if (attribute != null) { - this.attributes.attribute(attribute, value); - } - } - }, { - key: 'formatAt', - value: function formatAt(index, length, name, value) { - this.format(name, value); - } - }, { - key: 'insertAt', - value: function insertAt(index, value, def) { - if (typeof value === 'string' && value.endsWith('\n')) { - var block = _parchment2.default.create(Block.blotName); - this.parent.insertBefore(block, index === 0 ? this : this.next); - block.insertAt(0, value.slice(0, -1)); - } else { - _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); - } - } - }]); - - return BlockEmbed; - }(_embed2.default); - - BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; - // It is important for cursor behavior BlockEmbeds use tags that are block level elements - - - var Block = function (_Parchment$Block) { - _inherits(Block, _Parchment$Block); - - function Block(domNode) { - _classCallCheck(this, Block); - - var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); - - _this2.cache = {}; - return _this2; - } - - _createClass(Block, [{ - key: 'delta', - value: function delta() { - if (this.cache.delta == null) { - this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { - if (leaf.length() === 0) { - return delta; - } else { - return delta.insert(leaf.value(), bubbleFormats(leaf)); - } - }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); - } - return this.cache.delta; - } - }, { - key: 'deleteAt', - value: function deleteAt(index, length) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); - this.cache = {}; - } - }, { - key: 'formatAt', - value: function formatAt(index, length, name, value) { - if (length <= 0) return; - if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { - if (index + length === this.length()) { - this.format(name, value); - } - } else { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); - } - this.cache = {}; - } - }, { - key: 'insertAt', - value: function insertAt(index, value, def) { - if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); - if (value.length === 0) return; - var lines = value.split('\n'); - var text = lines.shift(); - if (text.length > 0) { - if (index < this.length() - 1 || this.children.tail == null) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); - } else { - this.children.tail.insertAt(this.children.tail.length(), text); - } - this.cache = {}; - } - var block = this; - lines.reduce(function (index, line) { - block = block.split(index, true); - block.insertAt(0, line); - return line.length; - }, index + text.length); - } - }, { - key: 'insertBefore', - value: function insertBefore(blot, ref) { - var head = this.children.head; - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); - if (head instanceof _break2.default) { - head.remove(); - } - this.cache = {}; - } - }, { - key: 'length', - value: function length() { - if (this.cache.length == null) { - this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; - } - return this.cache.length; - } - }, { - key: 'moveChildren', - value: function moveChildren(target, ref) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); - this.cache = {}; - } - }, { - key: 'optimize', - value: function optimize() { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this); - this.cache = {}; - } - }, { - key: 'path', - value: function path(index) { - return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); - } - }, { - key: 'removeChild', - value: function removeChild(child) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); - this.cache = {}; - } - }, { - key: 'split', - value: function split(index) { - var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { - var clone = this.clone(); - if (index === 0) { - this.parent.insertBefore(clone, this); - return this; - } else { - this.parent.insertBefore(clone, this.next); - return clone; - } - } else { - var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); - this.cache = {}; - return next; - } - } - }]); - - return Block; - }(_parchment2.default.Block); - - Block.blotName = 'block'; - Block.tagName = 'P'; - Block.defaultChild = 'break'; - Block.allowedChildren = [_inline2.default, _embed2.default, _text2.default]; - - function bubbleFormats(blot) { - var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (blot == null) return formats; - if (typeof blot.formats === 'function') { - formats = (0, _extend2.default)(formats, blot.formats()); - } - if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { - return formats; - } - return bubbleFormats(blot.parent, formats); - } - exports.bubbleFormats = bubbleFormats; - exports.BlockEmbed = BlockEmbed; - exports.default = Block; +Object.defineProperty(exports, "__esModule", { + value: true +}); -/***/ }, -/* 30 */ -/***/ function(module, exports) { +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - 'use strict'; +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - var hasOwn = Object.prototype.hasOwnProperty; - var toStr = Object.prototype.toString; +var _parchment = __webpack_require__(0); - var isArray = function isArray(arr) { - if (typeof Array.isArray === 'function') { - return Array.isArray(arr); - } +var _parchment2 = _interopRequireDefault(_parchment); - return toStr.call(arr) === '[object Array]'; - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Break = function (_Parchment$Embed) { + _inherits(Break, _Parchment$Embed); + + function Break() { + _classCallCheck(this, Break); + + return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); + } + + _createClass(Break, [{ + key: 'insertInto', + value: function insertInto(parent, ref) { + if (parent.children.length === 0) { + _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); + } else { + this.remove(); + } + } + }, { + key: 'length', + value: function length() { + return 0; + } + }, { + key: 'value', + value: function value() { + return ''; + } + }], [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + return Break; +}(_parchment2.default.Embed); - var isPlainObject = function isPlainObject(obj) { - if (!obj || toStr.call(obj) !== '[object Object]') { - return false; - } +Break.blotName = 'break'; +Break.tagName = 'BR'; - var hasOwnConstructor = hasOwn.call(obj, 'constructor'); - var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); - // Not own constructor property must be Object - if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { - return false; - } +exports.default = Break; - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - var key; - for (key in obj) {/**/} - - return typeof key === 'undefined' || hasOwn.call(obj, key); - }; - - module.exports = function extend() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0], - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if (typeof target === 'boolean') { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) { - target = {}; - } +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { - for (; i < length; ++i) { - options = arguments[i]; - // Only deal with non-null/undefined values - if (options != null) { - // Extend the base object - for (name in options) { - src = target[name]; - copy = options[name]; - - // Prevent never-ending loop - if (target !== copy) { - // Recurse if we're merging plain objects or arrays - if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { - if (copyIsArray) { - copyIsArray = false; - clone = src && isArray(src) ? src : []; - } else { - clone = src && isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[name] = extend(deep, clone, copy); - - // Don't bring in undefined values - } else if (typeof copy !== 'undefined') { - target[name] = copy; - } - } - } - } - } +"use strict"; - // Return the modified object - return target; - }; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var linked_list_1 = __webpack_require__(44); +var shadow_1 = __webpack_require__(30); +var Registry = __webpack_require__(1); +var ContainerBlot = /** @class */ (function (_super) { + __extends(ContainerBlot, _super); + function ContainerBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.build(); + return _this; + } + ContainerBlot.prototype.appendChild = function (other) { + this.insertBefore(other); + }; + ContainerBlot.prototype.attach = function () { + _super.prototype.attach.call(this); + this.children.forEach(function (child) { + child.attach(); + }); + }; + ContainerBlot.prototype.build = function () { + var _this = this; + this.children = new linked_list_1.default(); + // Need to be reversed for if DOM nodes already in order + [].slice + .call(this.domNode.childNodes) + .reverse() + .forEach(function (node) { + try { + var child = makeBlot(node); + _this.insertBefore(child, _this.children.head || undefined); + } + catch (err) { + if (err instanceof Registry.ParchmentError) + return; + else + throw err; + } + }); + }; + ContainerBlot.prototype.deleteAt = function (index, length) { + if (index === 0 && length === this.length()) { + return this.remove(); + } + this.children.forEachAt(index, length, function (child, offset, length) { + child.deleteAt(offset, length); + }); + }; + ContainerBlot.prototype.descendant = function (criteria, index) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + return [child, offset]; + } + else if (child instanceof ContainerBlot) { + return child.descendant(criteria, offset); + } + else { + return [null, -1]; + } + }; + ContainerBlot.prototype.descendants = function (criteria, index, length) { + if (index === void 0) { index = 0; } + if (length === void 0) { length = Number.MAX_VALUE; } + var descendants = []; + var lengthLeft = length; + this.children.forEachAt(index, length, function (child, index, length) { + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + descendants.push(child); + } + if (child instanceof ContainerBlot) { + descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); + } + lengthLeft -= length; + }); + return descendants; + }; + ContainerBlot.prototype.detach = function () { + this.children.forEach(function (child) { + child.detach(); + }); + _super.prototype.detach.call(this); + }; + ContainerBlot.prototype.formatAt = function (index, length, name, value) { + this.children.forEachAt(index, length, function (child, offset, length) { + child.formatAt(offset, length, name, value); + }); + }; + ContainerBlot.prototype.insertAt = function (index, value, def) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if (child) { + child.insertAt(offset, value, def); + } + else { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + this.appendChild(blot); + } + }; + ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { + if (this.statics.allowedChildren != null && + !this.statics.allowedChildren.some(function (child) { + return childBlot instanceof child; + })) { + throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); + } + childBlot.insertInto(this, refBlot); + }; + ContainerBlot.prototype.length = function () { + return this.children.reduce(function (memo, child) { + return memo + child.length(); + }, 0); + }; + ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { + this.children.forEach(function (child) { + targetParent.insertBefore(child, refNode); + }); + }; + ContainerBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + if (this.children.length === 0) { + if (this.statics.defaultChild != null) { + var child = Registry.create(this.statics.defaultChild); + this.appendChild(child); + child.optimize(context); + } + else { + this.remove(); + } + } + }; + ContainerBlot.prototype.path = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; + var position = [[this, index]]; + if (child instanceof ContainerBlot) { + return position.concat(child.path(offset, inclusive)); + } + else if (child != null) { + position.push([child, offset]); + } + return position; + }; + ContainerBlot.prototype.removeChild = function (child) { + this.children.remove(child); + }; + ContainerBlot.prototype.replace = function (target) { + if (target instanceof ContainerBlot) { + target.moveChildren(this); + } + _super.prototype.replace.call(this, target); + }; + ContainerBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = this.clone(); + this.parent.insertBefore(after, this.next); + this.children.forEachAt(index, this.length(), function (child, offset, length) { + child = child.split(offset, force); + after.appendChild(child); + }); + return after; + }; + ContainerBlot.prototype.unwrap = function () { + this.moveChildren(this.parent, this.next); + this.remove(); + }; + ContainerBlot.prototype.update = function (mutations, context) { + var _this = this; + var addedNodes = []; + var removedNodes = []; + mutations.forEach(function (mutation) { + if (mutation.target === _this.domNode && mutation.type === 'childList') { + addedNodes.push.apply(addedNodes, mutation.addedNodes); + removedNodes.push.apply(removedNodes, mutation.removedNodes); + } + }); + removedNodes.forEach(function (node) { + // Check node has actually been removed + // One exception is Chrome does not immediately remove IFRAMEs + // from DOM but MutationRecord is correct in its reported removal + if (node.parentNode != null && + // @ts-ignore + node.tagName !== 'IFRAME' && + document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return; + } + var blot = Registry.find(node); + if (blot == null) + return; + if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { + blot.detach(); + } + }); + addedNodes + .filter(function (node) { + return node.parentNode == _this.domNode; + }) + .sort(function (a, b) { + if (a === b) + return 0; + if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { + return 1; + } + return -1; + }) + .forEach(function (node) { + var refBlot = null; + if (node.nextSibling != null) { + refBlot = Registry.find(node.nextSibling); + } + var blot = makeBlot(node); + if (blot.next != refBlot || blot.next == null) { + if (blot.parent != null) { + blot.parent.removeChild(_this); + } + _this.insertBefore(blot, refBlot || undefined); + } + }); + }; + return ContainerBlot; +}(shadow_1.default)); +function makeBlot(node) { + var blot = Registry.find(node); + if (blot == null) { + try { + blot = Registry.create(node); + } + catch (e) { + blot = Registry.create(Registry.Scope.INLINE); + [].slice.call(node.childNodes).forEach(function (child) { + // @ts-ignore + blot.domNode.appendChild(child); + }); + if (node.parentNode) { + node.parentNode.replaceChild(blot.domNode, node); + } + blot.attach(); + } + } + return blot; +} +exports.default = ContainerBlot; +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 31 */ -/***/ function(module, exports, __webpack_require__) { +"use strict"; - 'use strict'; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var store_1 = __webpack_require__(31); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var FormatBlot = /** @class */ (function (_super) { + __extends(FormatBlot, _super); + function FormatBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.attributes = new store_1.default(_this.domNode); + return _this; + } + FormatBlot.formats = function (domNode) { + if (typeof this.tagName === 'string') { + return true; + } + else if (Array.isArray(this.tagName)) { + return domNode.tagName.toLowerCase(); + } + return undefined; + }; + FormatBlot.prototype.format = function (name, value) { + var format = Registry.query(name); + if (format instanceof attributor_1.default) { + this.attributes.attribute(format, value); + } + else if (value) { + if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { + this.replaceWith(name, value); + } + } + }; + FormatBlot.prototype.formats = function () { + var formats = this.attributes.values(); + var format = this.statics.formats(this.domNode); + if (format != null) { + formats[this.statics.blotName] = format; + } + return formats; + }; + FormatBlot.prototype.replaceWith = function (name, value) { + var replacement = _super.prototype.replaceWith.call(this, name, value); + this.attributes.copy(replacement); + return replacement; + }; + FormatBlot.prototype.update = function (mutations, context) { + var _this = this; + _super.prototype.update.call(this, mutations, context); + if (mutations.some(function (mutation) { + return mutation.target === _this.domNode && mutation.type === 'attributes'; + })) { + this.attributes.build(); + } + }; + FormatBlot.prototype.wrap = function (name, value) { + var wrapper = _super.prototype.wrap.call(this, name, value); + if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { + this.attributes.move(wrapper); + } + return wrapper; + }; + return FormatBlot; +}(container_1.default)); +exports.default = FormatBlot; - Object.defineProperty(exports, "__esModule", { - value: true - }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +"use strict"; - var _embed = __webpack_require__(32); +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var shadow_1 = __webpack_require__(30); +var Registry = __webpack_require__(1); +var LeafBlot = /** @class */ (function (_super) { + __extends(LeafBlot, _super); + function LeafBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + LeafBlot.value = function (domNode) { + return true; + }; + LeafBlot.prototype.index = function (node, offset) { + if (this.domNode === node || + this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return Math.min(offset, 1); + } + return -1; + }; + LeafBlot.prototype.position = function (index, inclusive) { + var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); + if (index > 0) + offset += 1; + return [this.parent.domNode, offset]; + }; + LeafBlot.prototype.value = function () { + return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a; + var _a; + }; + LeafBlot.scope = Registry.Scope.INLINE_BLOT; + return LeafBlot; +}(shadow_1.default)); +exports.default = LeafBlot; - var _embed2 = _interopRequireDefault(_embed); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var lib = { + attributes: { + compose: function (a, b, keepNull) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = extend(true, {}, b); + if (!keepNull) { + attributes = Object.keys(attributes).reduce(function (copy, key) { + if (attributes[key] != null) { + copy[key] = attributes[key]; + } + return copy; + }, {}); + } + for (var key in a) { + if (a[key] !== undefined && b[key] === undefined) { + attributes[key] = a[key]; + } + } + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + diff: function(a, b) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { + if (!equal(a[key], b[key])) { + attributes[key] = b[key] === undefined ? null : b[key]; + } + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + transform: function (a, b, priority) { + if (typeof a !== 'object') return b; + if (typeof b !== 'object') return undefined; + if (!priority) return b; // b simply overwrites us without priority + var attributes = Object.keys(b).reduce(function (attributes, key) { + if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + } + }, + + iterator: function (ops) { + return new Iterator(ops); + }, + + length: function (op) { + if (typeof op['delete'] === 'number') { + return op['delete']; + } else if (typeof op.retain === 'number') { + return op.retain; + } else { + return typeof op.insert === 'string' ? op.insert.length : 1; + } + } +}; + + +function Iterator(ops) { + this.ops = ops; + this.index = 0; + this.offset = 0; +}; + +Iterator.prototype.hasNext = function () { + return this.peekLength() < Infinity; +}; + +Iterator.prototype.next = function (length) { + if (!length) length = Infinity; + var nextOp = this.ops[this.index]; + if (nextOp) { + var offset = this.offset; + var opLength = lib.length(nextOp) + if (length >= opLength - offset) { + length = opLength - offset; + this.index += 1; + this.offset = 0; + } else { + this.offset += length; + } + if (typeof nextOp['delete'] === 'number') { + return { 'delete': length }; + } else { + var retOp = {}; + if (nextOp.attributes) { + retOp.attributes = nextOp.attributes; + } + if (typeof nextOp.retain === 'number') { + retOp.retain = length; + } else if (typeof nextOp.insert === 'string') { + retOp.insert = nextOp.insert.substr(offset, length); + } else { + // offset should === 0, length should === 1 + retOp.insert = nextOp.insert; + } + return retOp; + } + } else { + return { retain: Infinity }; + } +}; + +Iterator.prototype.peek = function () { + return this.ops[this.index]; +}; + +Iterator.prototype.peekLength = function () { + if (this.ops[this.index]) { + // Should never return 0 if our index is being managed correctly + return lib.length(this.ops[this.index]) - this.offset; + } else { + return Infinity; + } +}; + +Iterator.prototype.peekType = function () { + if (this.ops[this.index]) { + if (typeof this.ops[this.index]['delete'] === 'number') { + return 'delete'; + } else if (typeof this.ops[this.index].retain === 'number') { + return 'retain'; + } else { + return 'insert'; + } + } + return 'retain'; +}; - var Break = function (_Embed) { - _inherits(Break, _Embed); - function Break() { - _classCallCheck(this, Break); +module.exports = lib; - return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); - } - _createClass(Break, [{ - key: 'insertInto', - value: function insertInto(parent, ref) { - if (parent.children.length === 0) { - _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); - } else { - this.remove(); - } - } - }, { - key: 'length', - value: function length() { - return 0; - } - }, { - key: 'value', - value: function value() { - return ''; - } - }], [{ - key: 'value', - value: function value() { - return undefined; - } - }]); +/***/ }), +/* 21 */ +/***/ (function(module, exports) { - return Break; - }(_embed2.default); +var clone = (function() { +'use strict'; - Break.blotName = 'break'; - Break.tagName = 'BR'; +function _instanceof(obj, type) { + return type != null && obj instanceof type; +} + +var nativeMap; +try { + nativeMap = Map; +} catch(_) { + // maybe a reference error because no `Map`. Give it a dummy value that no + // value will ever be an instanceof. + nativeMap = function() {}; +} + +var nativeSet; +try { + nativeSet = Set; +} catch(_) { + nativeSet = function() {}; +} + +var nativePromise; +try { + nativePromise = Promise; +} catch(_) { + nativePromise = function() {}; +} + +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). + * @param `includeNonEnumerable` - set to true if the non-enumerable properties + * should be cloned as well. Non-enumerable properties on the prototype + * chain will be ignored. (optional - false by default) +*/ +function clone(parent, circular, depth, prototype, includeNonEnumerable) { + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + includeNonEnumerable = circular.includeNonEnumerable; + circular = circular.circular; + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth === 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (_instanceof(parent, nativeMap)) { + child = new nativeMap(); + } else if (_instanceof(parent, nativeSet)) { + child = new nativeSet(); + } else if (_instanceof(parent, nativePromise)) { + child = new nativePromise(function (resolve, reject) { + parent.then(function(value) { + resolve(_clone(value, depth - 1)); + }, function(err) { + reject(_clone(err, depth - 1)); + }); + }); + } else if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + child = new Buffer(parent.length); + parent.copy(child); + return child; + } else if (_instanceof(parent, Error)) { + child = Object.create(parent); + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + if (_instanceof(parent, nativeMap)) { + parent.forEach(function(value, key) { + var keyChild = _clone(key, depth - 1); + var valueChild = _clone(value, depth - 1); + child.set(keyChild, valueChild); + }); + } + if (_instanceof(parent, nativeSet)) { + parent.forEach(function(value) { + var entryChild = _clone(value, depth - 1); + child.add(entryChild); + }); + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(parent); + for (var i = 0; i < symbols.length; i++) { + // Don't need to worry about cloning a symbol because it is a primitive, + // like a number or string. + var symbol = symbols[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, symbol); + if (descriptor && !descriptor.enumerable && !includeNonEnumerable) { + continue; + } + child[symbol] = _clone(parent[symbol], depth - 1); + if (!descriptor.enumerable) { + Object.defineProperty(child, symbol, { + enumerable: false + }); + } + } + } + + if (includeNonEnumerable) { + var allPropertyNames = Object.getOwnPropertyNames(parent); + for (var i = 0; i < allPropertyNames.length; i++) { + var propertyName = allPropertyNames[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName); + if (descriptor && descriptor.enumerable) { + continue; + } + child[propertyName] = _clone(parent[propertyName], depth - 1); + Object.defineProperty(child, propertyName, { + enumerable: false + }); + } + } + + return child; + } + + return _clone(parent, depth); +} + +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); +}; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +} +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +} +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +} +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +} +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +} +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} - exports.default = Break; -/***/ }, -/* 32 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - var _parchment = __webpack_require__(2); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _parchment2 = _interopRequireDefault(_parchment); +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var _parchment = __webpack_require__(0); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _parchment2 = _interopRequireDefault(_parchment); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _container = __webpack_require__(25); + +var _container2 = _interopRequireDefault(_container); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function isLine(blot) { + return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; +} + +var Scroll = function (_Parchment$Scroll) { + _inherits(Scroll, _Parchment$Scroll); + + function Scroll(domNode, config) { + _classCallCheck(this, Scroll); + + var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); + + _this.emitter = config.emitter; + if (Array.isArray(config.whitelist)) { + _this.whitelist = config.whitelist.reduce(function (whitelist, format) { + whitelist[format] = true; + return whitelist; + }, {}); + } + // Some reason fixes composition issues with character languages in Windows/Chrome, Safari + _this.domNode.addEventListener('DOMNodeInserted', function () {}); + _this.optimize(); + _this.enable(); + return _this; + } + + _createClass(Scroll, [{ + key: 'batchStart', + value: function batchStart() { + this.batch = true; + } + }, { + key: 'batchEnd', + value: function batchEnd() { + this.batch = false; + this.optimize(); + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + var _line = this.line(index), + _line2 = _slicedToArray(_line, 2), + first = _line2[0], + offset = _line2[1]; + + var _line3 = this.line(index + length), + _line4 = _slicedToArray(_line3, 1), + last = _line4[0]; + + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); + if (last != null && first !== last && offset > 0) { + if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) { + this.optimize(); + return; + } + if (first instanceof _code2.default) { + var newlineIndex = first.newlineIndex(first.length(), true); + if (newlineIndex > -1) { + first = first.split(newlineIndex + 1); + if (first === last) { + this.optimize(); + return; + } + } + } else if (last instanceof _code2.default) { + var _newlineIndex = last.newlineIndex(0); + if (_newlineIndex > -1) { + last.split(_newlineIndex + 1); + } + } + var ref = last.children.head instanceof _break2.default ? null : last.children.head; + first.moveChildren(last, ref); + first.remove(); + } + this.optimize(); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.domNode.setAttribute('contenteditable', enabled); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, format, value) { + if (this.whitelist != null && !this.whitelist[format]) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); + this.optimize(); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null && this.whitelist != null && !this.whitelist[value]) return; + if (index >= this.length()) { + if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { + var blot = _parchment2.default.create(this.statics.defaultChild); + this.appendChild(blot); + if (def == null && value.endsWith('\n')) { + value = value.slice(0, -1); + } + blot.insertAt(0, value, def); + } else { + var embed = _parchment2.default.create(value, def); + this.appendChild(embed); + } + } else { + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); + } + this.optimize(); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { + var wrapper = _parchment2.default.create(this.statics.defaultChild); + wrapper.appendChild(blot); + blot = wrapper; + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); + } + }, { + key: 'leaf', + value: function leaf(index) { + return this.path(index).pop() || [null, -1]; + } + }, { + key: 'line', + value: function line(index) { + if (index === this.length()) { + return this.line(index - 1); + } + return this.descendant(isLine, index); + } + }, { + key: 'lines', + value: function lines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + var getLines = function getLines(blot, index, length) { + var lines = [], + lengthLeft = length; + blot.children.forEachAt(index, length, function (child, index, length) { + if (isLine(child)) { + lines.push(child); + } else if (child instanceof _parchment2.default.Container) { + lines = lines.concat(getLines(child, index, lengthLeft)); + } + lengthLeft -= length; + }); + return lines; + }; + return getLines(this, index, length); + } + }, { + key: 'optimize', + value: function optimize() { + var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (this.batch === true) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context); + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context); + } + } + }, { + key: 'path', + value: function path(index) { + return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self + } + }, { + key: 'update', + value: function update(mutations) { + if (this.batch === true) return; + var source = _emitter2.default.sources.USER; + if (typeof mutations === 'string') { + source = mutations; + } + if (!Array.isArray(mutations)) { + mutations = this.observer.takeRecords(); + } + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); + } + } + }]); + + return Scroll; +}(_parchment2.default.Scroll); + +Scroll.blotName = 'scroll'; +Scroll.className = 'ql-editor'; +Scroll.tagName = 'DIV'; +Scroll.defaultChild = 'block'; +Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; - var Embed = function (_Parchment$Embed) { - _inherits(Embed, _Parchment$Embed); +exports.default = Scroll; - function Embed() { - _classCallCheck(this, Embed); +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { - return _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).apply(this, arguments)); - } +"use strict"; - return Embed; - }(_parchment2.default.Embed); - exports.default = Embed; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SHORTKEY = exports.default = undefined; -/***/ }, -/* 33 */ -/***/ function(module, exports, __webpack_require__) { +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - 'use strict'; +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _embed = __webpack_require__(32); - - var _embed2 = _interopRequireDefault(_embed); - - var _text = __webpack_require__(34); - - var _text2 = _interopRequireDefault(_text); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var Inline = function (_Parchment$Inline) { - _inherits(Inline, _Parchment$Inline); - - function Inline() { - _classCallCheck(this, Inline); - - return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); - } - - _createClass(Inline, [{ - key: 'formatAt', - value: function formatAt(index, length, name, value) { - if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { - var blot = this.isolate(index, length); - if (value) { - blot.wrap(name, value); - } - } else { - _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); - } - } - }, { - key: 'optimize', - value: function optimize() { - _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this); - if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { - var parent = this.parent.isolate(this.offset(), this.length()); - this.moveChildren(parent); - parent.wrap(this); - } - } - }], [{ - key: 'compare', - value: function compare(self, other) { - var selfIndex = Inline.order.indexOf(self); - var otherIndex = Inline.order.indexOf(other); - if (selfIndex >= 0 || otherIndex >= 0) { - return selfIndex - otherIndex; - } else if (self === other) { - return 0; - } else if (self < other) { - return -1; - } else { - return 1; - } - } - }]); - - return Inline; - }(_parchment2.default.Inline); - - Inline.allowedChildren = [Inline, _embed2.default, _text2.default]; - // Lower index means deeper in the DOM tree, since not found (-1) is for embeds - Inline.order = ['cursor', 'inline', // Must be lower - 'code', 'underline', 'strike', 'italic', 'bold', 'script', 'link' // Must be higher - ]; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - exports.default = Inline; +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:keyboard'); + +var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; + +var Keyboard = function (_Module) { + _inherits(Keyboard, _Module); + + _createClass(Keyboard, null, [{ + key: 'match', + value: function match(evt, binding) { + binding = normalize(binding); + if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { + return !!binding[key] !== evt[key] && binding[key] !== null; + })) { + return false; + } + return binding.key === (evt.which || evt.keyCode); + } + }]); + + function Keyboard(quill, options) { + _classCallCheck(this, Keyboard); + + var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); + + _this.bindings = {}; + Object.keys(_this.options.bindings).forEach(function (name) { + if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) { + return; + } + if (_this.options.bindings[name]) { + _this.addBinding(_this.options.bindings[name]); + } + }); + _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); + _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); + if (/Firefox/i.test(navigator.userAgent)) { + // Need to handle delete and backspace for Firefox in the general case #1171 + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete); + } else { + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete); + } + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace); + _this.listen(); + return _this; + } + + _createClass(Keyboard, [{ + key: 'addBinding', + value: function addBinding(key) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var binding = normalize(key); + if (binding == null || binding.key == null) { + return debug.warn('Attempted to add invalid keyboard binding', binding); + } + if (typeof context === 'function') { + context = { handler: context }; + } + if (typeof handler === 'function') { + handler = { handler: handler }; + } + binding = (0, _extend2.default)(binding, context, handler); + this.bindings[binding.key] = this.bindings[binding.key] || []; + this.bindings[binding.key].push(binding); + } + }, { + key: 'listen', + value: function listen() { + var _this2 = this; + + this.quill.root.addEventListener('keydown', function (evt) { + if (evt.defaultPrevented) return; + var which = evt.which || evt.keyCode; + var bindings = (_this2.bindings[which] || []).filter(function (binding) { + return Keyboard.match(evt, binding); + }); + if (bindings.length === 0) return; + var range = _this2.quill.getSelection(); + if (range == null || !_this2.quill.hasFocus()) return; + + var _quill$getLine = _this2.quill.getLine(range.index), + _quill$getLine2 = _slicedToArray(_quill$getLine, 2), + line = _quill$getLine2[0], + offset = _quill$getLine2[1]; + + var _quill$getLeaf = _this2.quill.getLeaf(range.index), + _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), + leafStart = _quill$getLeaf2[0], + offsetStart = _quill$getLeaf2[1]; + + var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), + _ref2 = _slicedToArray(_ref, 2), + leafEnd = _ref2[0], + offsetEnd = _ref2[1]; + + var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; + var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; + var curContext = { + collapsed: range.length === 0, + empty: range.length === 0 && line.length() <= 1, + format: _this2.quill.getFormat(range), + offset: offset, + prefix: prefixText, + suffix: suffixText + }; + var prevented = bindings.some(function (binding) { + if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; + if (binding.empty != null && binding.empty !== curContext.empty) return false; + if (binding.offset != null && binding.offset !== curContext.offset) return false; + if (Array.isArray(binding.format)) { + // any format is present + if (binding.format.every(function (name) { + return curContext.format[name] == null; + })) { + return false; + } + } else if (_typeof(binding.format) === 'object') { + // all formats must match + if (!Object.keys(binding.format).every(function (name) { + if (binding.format[name] === true) return curContext.format[name] != null; + if (binding.format[name] === false) return curContext.format[name] == null; + return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); + })) { + return false; + } + } + if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; + if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; + return binding.handler.call(_this2, range, curContext) !== true; + }); + if (prevented) { + evt.preventDefault(); + } + }); + } + }]); + + return Keyboard; +}(_module2.default); + +Keyboard.keys = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + ESCAPE: 27, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46 +}; + +Keyboard.DEFAULTS = { + bindings: { + 'bold': makeFormatHandler('bold'), + 'italic': makeFormatHandler('italic'), + 'underline': makeFormatHandler('underline'), + 'indent': { + // highlight tab or tab at beginning of list, indent or blockquote + key: Keyboard.keys.TAB, + format: ['blockquote', 'indent', 'list'], + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '+1', _quill2.default.sources.USER); + } + }, + 'outdent': { + key: Keyboard.keys.TAB, + shiftKey: true, + format: ['blockquote', 'indent', 'list'], + // highlight tab or tab at beginning of list, indent or blockquote + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } + }, + 'outdent backspace': { + key: Keyboard.keys.BACKSPACE, + collapsed: true, + shiftKey: null, + metaKey: null, + ctrlKey: null, + altKey: null, + format: ['indent', 'list'], + offset: 0, + handler: function handler(range, context) { + if (context.format.indent != null) { + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } else if (context.format.list != null) { + this.quill.format('list', false, _quill2.default.sources.USER); + } + } + }, + 'indent code-block': makeCodeBlockHandler(true), + 'outdent code-block': makeCodeBlockHandler(false), + 'remove tab': { + key: Keyboard.keys.TAB, + shiftKey: true, + collapsed: true, + prefix: /\t$/, + handler: function handler(range) { + this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); + } + }, + 'tab': { + key: Keyboard.keys.TAB, + handler: function handler(range) { + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\t'); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + } + }, + 'list empty enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['list'], + empty: true, + handler: function handler(range, context) { + this.quill.format('list', false, _quill2.default.sources.USER); + if (context.format.indent) { + this.quill.format('indent', false, _quill2.default.sources.USER); + } + } + }, + 'checklist enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: { list: 'checked' }, + handler: function handler(range) { + var _quill$getLine3 = this.quill.getLine(range.index), + _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), + line = _quill$getLine4[0], + offset = _quill$getLine4[1]; + + var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' }); + var delta = new _quillDelta2.default().retain(range.index).insert('\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'header enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['header'], + suffix: /^$/, + handler: function handler(range, context) { + var _quill$getLine5 = this.quill.getLine(range.index), + _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), + line = _quill$getLine6[0], + offset = _quill$getLine6[1]; + + var delta = new _quillDelta2.default().retain(range.index).insert('\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'list autofill': { + key: ' ', + collapsed: true, + format: { list: false }, + prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/, + handler: function handler(range, context) { + var length = context.prefix.length; + + var _quill$getLine7 = this.quill.getLine(range.index), + _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), + line = _quill$getLine8[0], + offset = _quill$getLine8[1]; + + if (offset > length) return true; + var value = void 0; + switch (context.prefix.trim()) { + case '[]':case '[ ]': + value = 'unchecked'; + break; + case '[x]': + value = 'checked'; + break; + case '-':case '*': + value = 'bullet'; + break; + default: + value = 'ordered'; + } + this.quill.insertText(range.index, ' ', _quill2.default.sources.USER); + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); + } + }, + 'code exit': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['code-block'], + prefix: /\n\n$/, + suffix: /^\s+$/, + handler: function handler(range) { + var _quill$getLine9 = this.quill.getLine(range.index), + _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), + line = _quill$getLine10[0], + offset = _quill$getLine10[1]; + + var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1); + this.quill.updateContents(delta, _quill2.default.sources.USER); + } + }, + 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false), + 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true), + 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false), + 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true) + } +}; + +function makeEmbedArrowHandler(key, shiftKey) { + var _ref3; + + var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix'; + return _ref3 = { + key: key, + shiftKey: shiftKey, + altKey: null + }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) { + var index = range.index; + if (key === Keyboard.keys.RIGHT) { + index += range.length + 1; + } + + var _quill$getLeaf3 = this.quill.getLeaf(index), + _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), + leaf = _quill$getLeaf4[0]; + + if (!(leaf instanceof _parchment2.default.Embed)) return true; + if (key === Keyboard.keys.LEFT) { + if (shiftKey) { + this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index - 1, _quill2.default.sources.USER); + } + } else { + if (shiftKey) { + this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER); + } + } + return false; + }), _ref3; +} + +function handleBackspace(range, context) { + if (range.index === 0 || this.quill.getLength() <= 1) return; + + var _quill$getLine11 = this.quill.getLine(range.index), + _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), + line = _quill$getLine12[0]; + + var formats = {}; + if (context.offset === 0) { + var _quill$getLine13 = this.quill.getLine(range.index - 1), + _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), + prev = _quill$getLine14[0]; + + if (prev != null && prev.length() > 1) { + var curFormats = line.formats(); + var prevFormats = this.quill.getFormat(range.index - 1, 1); + formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; + } + } + // Check for astral symbols + var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1; + this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER); + } + this.quill.focus(); +} + +function handleDelete(range, context) { + // Check for astral symbols + var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1; + if (range.index >= this.quill.getLength() - length) return; + var formats = {}, + nextLength = 0; + + var _quill$getLine15 = this.quill.getLine(range.index), + _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), + line = _quill$getLine16[0]; + + if (context.offset >= line.length() - 1) { + var _quill$getLine17 = this.quill.getLine(range.index + 1), + _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), + next = _quill$getLine18[0]; + + if (next) { + var curFormats = line.formats(); + var nextFormats = this.quill.getFormat(range.index, 1); + formats = _op2.default.attributes.diff(curFormats, nextFormats) || {}; + nextLength = next.length(); + } + } + this.quill.deleteText(range.index, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER); + } +} + +function handleDeleteRange(range) { + var lines = this.quill.getLines(range); + var formats = {}; + if (lines.length > 1) { + var firstFormats = lines[0].formats(); + var lastFormats = lines[lines.length - 1].formats(); + formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {}; + } + this.quill.deleteText(range, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER); + } + this.quill.setSelection(range.index, _quill2.default.sources.SILENT); + this.quill.focus(); +} + +function handleEnter(range, context) { + var _this3 = this; + + if (range.length > 0) { + this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change + } + var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { + if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { + lineFormats[format] = context.format[format]; + } + return lineFormats; + }, {}); + this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); + // Earlier scroll.deleteAt might have messed up our selection, + // so insertText's built in selection preservation is not reliable + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.focus(); + Object.keys(context.format).forEach(function (name) { + if (lineFormats[name] != null) return; + if (Array.isArray(context.format[name])) return; + if (name === 'link') return; + _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); + }); +} + +function makeCodeBlockHandler(indent) { + return { + key: Keyboard.keys.TAB, + shiftKey: !indent, + format: { 'code-block': true }, + handler: function handler(range) { + var CodeBlock = _parchment2.default.query('code-block'); + var index = range.index, + length = range.length; + + var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + block = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (block == null) return; + var scrollIndex = this.quill.getIndex(block); + var start = block.newlineIndex(offset, true) + 1; + var end = block.newlineIndex(scrollIndex + offset + length); + var lines = block.domNode.textContent.slice(start, end).split('\n'); + offset = 0; + lines.forEach(function (line, i) { + if (indent) { + block.insertAt(start + offset, CodeBlock.TAB); + offset += CodeBlock.TAB.length; + if (i === 0) { + index += CodeBlock.TAB.length; + } else { + length += CodeBlock.TAB.length; + } + } else if (line.startsWith(CodeBlock.TAB)) { + block.deleteAt(start + offset, CodeBlock.TAB.length); + offset -= CodeBlock.TAB.length; + if (i === 0) { + index -= CodeBlock.TAB.length; + } else { + length -= CodeBlock.TAB.length; + } + } + offset += line.length + 1; + }); + this.quill.update(_quill2.default.sources.USER); + this.quill.setSelection(index, length, _quill2.default.sources.SILENT); + } + }; +} + +function makeFormatHandler(format) { + return { + key: format[0].toUpperCase(), + shortKey: true, + handler: function handler(range, context) { + this.quill.format(format, !context.format[format], _quill2.default.sources.USER); + } + }; +} + +function normalize(binding) { + if (typeof binding === 'string' || typeof binding === 'number') { + return normalize({ key: binding }); + } + if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { + binding = (0, _clone2.default)(binding, false); + } + if (typeof binding.key === 'string') { + if (Keyboard.keys[binding.key.toUpperCase()] != null) { + binding.key = Keyboard.keys[binding.key.toUpperCase()]; + } else if (binding.key.length === 1) { + binding.key = binding.key.toUpperCase().charCodeAt(0); + } else { + return null; + } + } + if (binding.shortKey) { + binding[SHORTKEY] = binding.shortKey; + delete binding.shortKey; + } + return binding; +} -/***/ }, -/* 34 */ -/***/ function(module, exports, __webpack_require__) { +exports.default = Keyboard; +exports.SHORTKEY = SHORTKEY; - 'use strict'; +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { - Object.defineProperty(exports, "__esModule", { - value: true - }); +"use strict"; - var _parchment = __webpack_require__(2); - var _parchment2 = _interopRequireDefault(_parchment); +Object.defineProperty(exports, "__esModule", { + value: true +}); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _parchment = __webpack_require__(0); - var TextBlot = function (_Parchment$Text) { - _inherits(TextBlot, _Parchment$Text); +var _parchment2 = _interopRequireDefault(_parchment); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Cursor = function (_Parchment$Embed) { + _inherits(Cursor, _Parchment$Embed); + + _createClass(Cursor, null, [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + function Cursor(domNode, selection) { + _classCallCheck(this, Cursor); + + var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); + + _this.selection = selection; + _this.textNode = document.createTextNode(Cursor.CONTENTS); + _this.domNode.appendChild(_this.textNode); + _this._length = 0; + return _this; + } + + _createClass(Cursor, [{ + key: 'detach', + value: function detach() { + // super.detach() will also clear domNode.__blot + if (this.parent != null) this.parent.removeChild(this); + } + }, { + key: 'format', + value: function format(name, value) { + if (this._length !== 0) { + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); + } + var target = this, + index = 0; + while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { + index += target.offset(target.parent); + target = target.parent; + } + if (target != null) { + this._length = Cursor.CONTENTS.length; + target.optimize(); + target.formatAt(index, Cursor.CONTENTS.length, name, value); + this._length = 0; + } + } + }, { + key: 'index', + value: function index(node, offset) { + if (node === this.textNode) return 0; + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'length', + value: function length() { + return this._length; + } + }, { + key: 'position', + value: function position() { + return [this.textNode, this.textNode.data.length]; + } + }, { + key: 'remove', + value: function remove() { + _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); + this.parent = null; + } + }, { + key: 'restore', + value: function restore() { + if (this.selection.composing || this.parent == null) return; + var textNode = this.textNode; + var range = this.selection.getNativeRange(); + var restoreText = void 0, + start = void 0, + end = void 0; + if (range != null && range.start.node === textNode && range.end.node === textNode) { + var _ref = [textNode, range.start.offset, range.end.offset]; + restoreText = _ref[0]; + start = _ref[1]; + end = _ref[2]; + } + // Link format will insert text outside of anchor tag + while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { + this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); + } + if (this.textNode.data !== Cursor.CONTENTS) { + var text = this.textNode.data.split(Cursor.CONTENTS).join(''); + if (this.next instanceof _text2.default) { + restoreText = this.next.domNode; + this.next.insertAt(0, text); + this.textNode.data = Cursor.CONTENTS; + } else { + this.textNode.data = text; + this.parent.insertBefore(_parchment2.default.create(this.textNode), this); + this.textNode = document.createTextNode(Cursor.CONTENTS); + this.domNode.appendChild(this.textNode); + } + } + this.remove(); + if (start != null) { + var _map = [start, end].map(function (offset) { + return Math.max(0, Math.min(restoreText.data.length, offset - 1)); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + + return { + startNode: restoreText, + startOffset: start, + endNode: restoreText, + endOffset: end + }; + } + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this2.textNode; + })) { + var range = this.restore(); + if (range) context.range = range; + } + } + }, { + key: 'value', + value: function value() { + return ''; + } + }]); + + return Cursor; +}(_parchment2.default.Embed); + +Cursor.blotName = 'cursor'; +Cursor.className = 'ql-cursor'; +Cursor.tagName = 'span'; +Cursor.CONTENTS = '\uFEFF'; // Zero width no break space - function TextBlot() { - _classCallCheck(this, TextBlot); - return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); - } +exports.default = Cursor; - return TextBlot; - }(_parchment2.default.Text); +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { - exports.default = TextBlot; +"use strict"; -/***/ }, -/* 35 */ -/***/ function(module, exports, __webpack_require__) { - 'use strict'; +Object.defineProperty(exports, "__esModule", { + value: true +}); - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _embed = __webpack_require__(32); - - var _embed2 = _interopRequireDefault(_embed); - - var _text = __webpack_require__(34); - - var _text2 = _interopRequireDefault(_text); - - var _emitter = __webpack_require__(36); - - var _emitter2 = _interopRequireDefault(_emitter); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var Cursor = function (_Embed) { - _inherits(Cursor, _Embed); - - _createClass(Cursor, null, [{ - key: 'value', - value: function value() { - return undefined; - } - }]); - - function Cursor(domNode, selection) { - _classCallCheck(this, Cursor); - - var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); - - _this.selection = selection; - _this.textNode = document.createTextNode(Cursor.CONTENTS); - _this.domNode.appendChild(_this.textNode); - _this._length = 0; - return _this; - } - - _createClass(Cursor, [{ - key: 'detach', - value: function detach() { - // super.detach() will also clear domNode.__blot - if (this.parent != null) this.parent.removeChild(this); - } - }, { - key: 'format', - value: function format(name, value) { - if (this._length !== 0) { - return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); - } - var target = this, - index = 0; - while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { - index += target.offset(target.parent); - target = target.parent; - } - if (target != null) { - this._length = Cursor.CONTENTS.length; - target.optimize(); - target.formatAt(index, Cursor.CONTENTS.length, name, value); - this._length = 0; - } - } - }, { - key: 'index', - value: function index(node, offset) { - if (node === this.textNode) return 0; - return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); - } - }, { - key: 'length', - value: function length() { - return this._length; - } - }, { - key: 'position', - value: function position() { - return [this.textNode, this.textNode.data.length]; - } - }, { - key: 'remove', - value: function remove() { - _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); - this.parent = null; - } - }, { - key: 'restore', - value: function restore() { - var _this2 = this; - - if (this.selection.composing) return; - if (this.parent == null) return; - var textNode = this.textNode; - var range = this.selection.getNativeRange(); - var restoreText = void 0, - start = void 0, - end = void 0; - if (range != null && range.start.node === textNode && range.end.node === textNode) { - var _ref = [textNode, range.start.offset, range.end.offset]; - restoreText = _ref[0]; - start = _ref[1]; - end = _ref[2]; - } - // Link format will insert text outside of anchor tag - while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { - this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); - } - if (this.textNode.data !== Cursor.CONTENTS) { - var text = this.textNode.data.split(Cursor.CONTENTS).join(''); - if (this.next instanceof _text2.default) { - restoreText = this.next.domNode; - this.next.insertAt(0, text); - this.textNode.data = Cursor.CONTENTS; - } else { - this.textNode.data = text; - this.parent.insertBefore(_parchment2.default.create(this.textNode), this); - this.textNode = document.createTextNode(Cursor.CONTENTS); - this.domNode.appendChild(this.textNode); - } - } - this.remove(); - if (start == null) return; - this.selection.emitter.once(_emitter2.default.events.SCROLL_OPTIMIZE, function () { - var _map = [start, end].map(function (offset) { - return Math.max(0, Math.min(restoreText.data.length, offset - 1)); - }); - - var _map2 = _slicedToArray(_map, 2); - - start = _map2[0]; - end = _map2[1]; - - _this2.selection.setNativeRange(restoreText, start, restoreText, end); - }); - } - }, { - key: 'update', - value: function update(mutations) { - var _this3 = this; - - mutations.forEach(function (mutation) { - if (mutation.type === 'characterData' && mutation.target === _this3.textNode) { - _this3.restore(); - } - }); - } - }, { - key: 'value', - value: function value() { - return ''; - } - }]); - - return Cursor; - }(_embed2.default); - - Cursor.blotName = 'cursor'; - Cursor.className = 'ql-cursor'; - Cursor.tagName = 'span'; - Cursor.CONTENTS = '\uFEFF'; // Zero width no break space +var _parchment = __webpack_require__(0); +var _parchment2 = _interopRequireDefault(_parchment); - exports.default = Cursor; +var _block = __webpack_require__(4); -/***/ }, -/* 36 */ -/***/ function(module, exports, __webpack_require__) { +var _block2 = _interopRequireDefault(_block); - 'use strict'; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - Object.defineProperty(exports, "__esModule", { - value: true - }); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _eventemitter = __webpack_require__(37); +var Container = function (_Parchment$Container) { + _inherits(Container, _Parchment$Container); - var _eventemitter2 = _interopRequireDefault(_eventemitter); + function Container() { + _classCallCheck(this, Container); - var _logger = __webpack_require__(38); + return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); + } - var _logger2 = _interopRequireDefault(_logger); + return Container; +}(_parchment2.default.Container); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +exports.default = Container; - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +"use strict"; - var debug = (0, _logger2.default)('quill:events'); - var Emitter = function (_EventEmitter) { - _inherits(Emitter, _EventEmitter); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; - function Emitter() { - _classCallCheck(this, Emitter); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - _this.on('error', debug.error); - return _this; - } +var _parchment = __webpack_require__(0); - _createClass(Emitter, [{ - key: 'emit', - value: function emit() { - debug.log.apply(debug, arguments); - _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); - } - }]); +var _parchment2 = _interopRequireDefault(_parchment); - return Emitter; - }(_eventemitter2.default); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - Emitter.events = { - EDITOR_CHANGE: 'editor-change', - SCROLL_BEFORE_UPDATE: 'scroll-before-update', - SCROLL_OPTIMIZE: 'scroll-optimize', - SCROLL_UPDATE: 'scroll-update', - SELECTION_CHANGE: 'selection-change', - TEXT_CHANGE: 'text-change' - }; - Emitter.sources = { - API: 'api', - SILENT: 'silent', - USER: 'user' - }; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - exports.default = Emitter; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -/***/ }, -/* 37 */ -/***/ function(module, exports) { +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - 'use strict'; +var ColorAttributor = function (_Parchment$Attributor) { + _inherits(ColorAttributor, _Parchment$Attributor); - var has = Object.prototype.hasOwnProperty - , prefix = '~'; + function ColorAttributor() { + _classCallCheck(this, ColorAttributor); - /** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @api private - */ - function Events() {} - - // - // We try to not inherit from `Object.prototype`. In some engines creating an - // instance in this way is faster than calling `Object.create(null)` directly. - // If `Object.create(null)` is not supported we prefix the event names with a - // character to make sure that the built-in object properties are not - // overridden or used as an attack vector. - // - if (Object.create) { - Events.prototype = Object.create(null); - - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; - } + return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); + } - /** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {Mixed} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @api private - */ - function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; - } + _createClass(ColorAttributor, [{ + key: 'value', + value: function value(domNode) { + var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); + if (!value.startsWith('rgb(')) return value; + value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); + return '#' + value.split(',').map(function (component) { + return ('00' + parseInt(component).toString(16)).slice(-2); + }).join(''); + } + }]); - /** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @api public - */ - function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; - } + return ColorAttributor; +}(_parchment2.default.Attributor.Style); - /** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @api public - */ - EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - - if (this._eventsCount === 0) return names; - - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } - - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - - return names; - }; - - /** - * Return the listeners registered for a given event. - * - * @param {String|Symbol} event The event name. - * @param {Boolean} exists Only check if there are listeners. - * @returns {Array|Boolean} - * @api public - */ - EventEmitter.prototype.listeners = function listeners(event, exists) { - var evt = prefix ? prefix + event : event - , available = this._events[evt]; - - if (exists) return !!available; - if (!available) return []; - if (available.fn) return [available.fn]; - - for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { - ee[i] = available[i].fn; - } - - return ee; - }; - - /** - * Calls each of the listeners registered for a given event. - * - * @param {String|Symbol} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @api public - */ - EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return false; - - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - - 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++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - - switch (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 true; - }; - - /** - * Add a listener for a given event. - * - * @param {String|Symbol} event The event name. - * @param {Function} fn The listener function. - * @param {Mixed} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @api public - */ - EventEmitter.prototype.on = function on(event, fn, context) { - var listener = new EE(fn, context || this) - , evt = prefix ? prefix + event : event; - - if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; - else if (!this._events[evt].fn) this._events[evt].push(listener); - else this._events[evt] = [this._events[evt], listener]; - - return this; - }; - - /** - * Add a one-time listener for a given event. - * - * @param {String|Symbol} event The event name. - * @param {Function} fn The listener function. - * @param {Mixed} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @api public - */ - EventEmitter.prototype.once = function once(event, fn, context) { - var listener = new EE(fn, context || this, true) - , evt = prefix ? prefix + event : event; - - if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; - else if (!this._events[evt].fn) this._events[evt].push(listener); - else this._events[evt] = [this._events[evt], listener]; - - return this; - }; - - /** - * Remove the listeners of a given event. - * - * @param {String|Symbol} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {Mixed} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @api public - */ - EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return this; - if (!fn) { - if (--this._eventsCount === 0) this._events = new Events(); - else delete this._events[evt]; - return this; - } - - var listeners = this._events[evt]; - - if (listeners.fn) { - if ( - listeners.fn === fn - && (!once || listeners.once) - && (!context || listeners.context === context) - ) { - if (--this._eventsCount === 0) this._events = new Events(); - else delete this._events[evt]; - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn - || (once && !listeners[i].once) - || (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else if (--this._eventsCount === 0) this._events = new Events(); - else delete this._events[evt]; - } - - return this; - }; - - /** - * Remove all listeners, or those of the specified event. - * - * @param {String|Symbol} [event] The event name. - * @returns {EventEmitter} `this`. - * @api public - */ - EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) { - if (--this._eventsCount === 0) this._events = new Events(); - else delete this._events[evt]; - } - } else { - this._events = new Events(); - this._eventsCount = 0; - } - - return this; - }; - - // - // Alias methods names because people roll like that. - // - EventEmitter.prototype.off = EventEmitter.prototype.removeListener; - EventEmitter.prototype.addListener = EventEmitter.prototype.on; - - // - // This function doesn't apply anymore. - // - EventEmitter.prototype.setMaxListeners = function setMaxListeners() { - return this; - }; - - // - // Expose the prefix. - // - EventEmitter.prefixed = prefix; - - // - // Allow `EventEmitter` to be imported as module namespace. - // - EventEmitter.EventEmitter = EventEmitter; - - // - // Expose the module. - // - if ('undefined' !== typeof module) { - module.exports = EventEmitter; - } +var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { + scope: _parchment2.default.Scope.INLINE +}); +var ColorStyle = new ColorAttributor('color', 'color', { + scope: _parchment2.default.Scope.INLINE +}); +exports.ColorAttributor = ColorAttributor; +exports.ColorClass = ColorClass; +exports.ColorStyle = ColorStyle; + +/***/ }), +/* 27 */, +/* 28 */, +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 38 */ -/***/ function(module, exports) { +"use strict"; - 'use strict'; - Object.defineProperty(exports, "__esModule", { - value: true - }); - var levels = ['error', 'warn', 'log', 'info']; - var level = 'warn'; - - function debug(method) { - if (levels.indexOf(method) <= levels.indexOf(level)) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); - console[method].apply(console, args); // eslint-disable-line no-console - } - } +var _parchment = __webpack_require__(0); - function namespace(ns) { - return levels.reduce(function (logger, method) { - logger[method] = debug.bind(console, method, ns); - return logger; - }, {}); - } +var _parchment2 = _interopRequireDefault(_parchment); - debug.level = namespace.level = function (newLevel) { - level = newLevel; - }; +var _quill = __webpack_require__(5); - exports.default = namespace; +var _quill2 = _interopRequireDefault(_quill); -/***/ }, -/* 39 */ -/***/ function(module, exports) { +var _block = __webpack_require__(4); - var clone = (function() { - 'use strict'; +var _block2 = _interopRequireDefault(_block); - var nativeMap; - try { - nativeMap = Map; - } catch(_) { - // maybe a reference error because no `Map`. Give it a dummy value that no - // value will ever be an instanceof. - nativeMap = function() {}; - } +var _break = __webpack_require__(16); - var nativeSet; - try { - nativeSet = Set; - } catch(_) { - nativeSet = function() {}; - } +var _break2 = _interopRequireDefault(_break); - var nativePromise; - try { - nativePromise = Promise; - } catch(_) { - nativePromise = function() {}; - } +var _container = __webpack_require__(25); - /** - * Clones (copies) an Object using deep copying. - * - * This function supports circular references by default, but if you are certain - * there are no circular references in your object, you can save some CPU time - * by calling clone(obj, false). - * - * Caution: if `circular` is false and `parent` contains circular references, - * your program may enter an infinite loop and crash. - * - * @param `parent` - the object to be cloned - * @param `circular` - set to true if the object to be cloned may contain - * circular references. (optional - true by default) - * @param `depth` - set to a number if the object is only to be cloned to - * a particular depth. (optional - defaults to Infinity) - * @param `prototype` - sets the prototype to be used when cloning an object. - * (optional - defaults to parent prototype). - */ - function clone(parent, circular, depth, prototype) { - var filter; - if (typeof circular === 'object') { - depth = circular.depth; - prototype = circular.prototype; - filter = circular.filter; - circular = circular.circular; - } - // maintain two arrays for circular references, where corresponding parents - // and children have the same index - var allParents = []; - var allChildren = []; - - var useBuffer = typeof Buffer != 'undefined'; - - if (typeof circular == 'undefined') - circular = true; - - if (typeof depth == 'undefined') - depth = Infinity; - - // recurse this function so we don't reset allParents and allChildren - function _clone(parent, depth) { - // cloning null always returns null - if (parent === null) - return null; - - if (depth === 0) - return parent; - - var child; - var proto; - if (typeof parent != 'object') { - return parent; - } - - if (parent instanceof nativeMap) { - child = new nativeMap(); - } else if (parent instanceof nativeSet) { - child = new nativeSet(); - } else if (parent instanceof nativePromise) { - child = new nativePromise(function (resolve, reject) { - parent.then(function(value) { - resolve(_clone(value, depth - 1)); - }, function(err) { - reject(_clone(err, depth - 1)); - }); - }); - } else if (clone.__isArray(parent)) { - child = []; - } else if (clone.__isRegExp(parent)) { - child = new RegExp(parent.source, __getRegExpFlags(parent)); - if (parent.lastIndex) child.lastIndex = parent.lastIndex; - } else if (clone.__isDate(parent)) { - child = new Date(parent.getTime()); - } else if (useBuffer && Buffer.isBuffer(parent)) { - child = new Buffer(parent.length); - parent.copy(child); - return child; - } else { - if (typeof prototype == 'undefined') { - proto = Object.getPrototypeOf(parent); - child = Object.create(proto); - } - else { - child = Object.create(prototype); - proto = prototype; - } - } - - if (circular) { - var index = allParents.indexOf(parent); - - if (index != -1) { - return allChildren[index]; - } - allParents.push(parent); - allChildren.push(child); - } - - if (parent instanceof nativeMap) { - var keyIterator = parent.keys(); - while(true) { - var next = keyIterator.next(); - if (next.done) { - break; - } - var keyChild = _clone(next.value, depth - 1); - var valueChild = _clone(parent.get(next.value), depth - 1); - child.set(keyChild, valueChild); - } - } - if (parent instanceof nativeSet) { - var iterator = parent.keys(); - while(true) { - var next = iterator.next(); - if (next.done) { - break; - } - var entryChild = _clone(next.value, depth - 1); - child.add(entryChild); - } - } - - for (var i in parent) { - var attrs; - if (proto) { - attrs = Object.getOwnPropertyDescriptor(proto, i); - } - - if (attrs && attrs.set == null) { - continue; - } - child[i] = _clone(parent[i], depth - 1); - } - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(parent); - for (var i = 0; i < symbols.length; i++) { - // Don't need to worry about cloning a symbol because it is a primitive, - // like a number or string. - var symbol = symbols[i]; - child[symbol] = _clone(parent[symbol], depth - 1); - } - } +var _container2 = _interopRequireDefault(_container); - return child; - } +var _cursor = __webpack_require__(24); - return _clone(parent, depth); - } +var _cursor2 = _interopRequireDefault(_cursor); - /** - * Simple flat clone using prototype, accepts only objects, usefull for property - * override on FLAT configuration object (no nested props). - * - * USE WITH CAUTION! This may not behave as you wish if you do not know how this - * works. - */ - clone.clonePrototype = function clonePrototype(parent) { - if (parent === null) - return null; - - var c = function () {}; - c.prototype = parent; - return new c(); - }; +var _embed = __webpack_require__(35); - // private utility functions +var _embed2 = _interopRequireDefault(_embed); - function __objToStr(o) { - return Object.prototype.toString.call(o); - } - clone.__objToStr = __objToStr; +var _inline = __webpack_require__(6); - function __isDate(o) { - return typeof o === 'object' && __objToStr(o) === '[object Date]'; - } - clone.__isDate = __isDate; +var _inline2 = _interopRequireDefault(_inline); - function __isArray(o) { - return typeof o === 'object' && __objToStr(o) === '[object Array]'; - } - clone.__isArray = __isArray; +var _scroll = __webpack_require__(22); - function __isRegExp(o) { - return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; - } - clone.__isRegExp = __isRegExp; +var _scroll2 = _interopRequireDefault(_scroll); - function __getRegExpFlags(re) { - var flags = ''; - if (re.global) flags += 'g'; - if (re.ignoreCase) flags += 'i'; - if (re.multiline) flags += 'm'; - return flags; - } - clone.__getRegExpFlags = __getRegExpFlags; +var _text = __webpack_require__(7); - return clone; - })(); +var _text2 = _interopRequireDefault(_text); - if (typeof module === 'object' && module.exports) { - module.exports = clone; - } +var _clipboard = __webpack_require__(55); +var _clipboard2 = _interopRequireDefault(_clipboard); -/***/ }, -/* 40 */ -/***/ function(module, exports, __webpack_require__) { +var _history = __webpack_require__(42); - var pSlice = Array.prototype.slice; - var objectKeys = __webpack_require__(41); - var isArguments = __webpack_require__(42); - - var deepEqual = module.exports = function (actual, expected, opts) { - if (!opts) opts = {}; - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { - return opts.strict ? actual === expected : actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected, opts); - } - } +var _history2 = _interopRequireDefault(_history); - function isUndefinedOrNull(value) { - return value === null || value === undefined; - } +var _keyboard = __webpack_require__(23); - function isBuffer (x) { - if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; - if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { - return false; - } - if (x.length > 0 && typeof x[0] !== 'number') return false; - return true; - } +var _keyboard2 = _interopRequireDefault(_keyboard); - function objEquiv(a, b, opts) { - var i, key; - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return deepEqual(a, b, opts); - } - if (isBuffer(a)) { - if (!isBuffer(b)) { - return false; - } - if (a.length !== b.length) return false; - for (i = 0; i < a.length; i++) { - if (a[i] !== b[i]) return false; - } - return true; - } - try { - var ka = objectKeys(a), - kb = objectKeys(b); - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!deepEqual(a[key], b[key], opts)) return false; - } - return typeof a === typeof b; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +_quill2.default.register({ + 'blots/block': _block2.default, + 'blots/block/embed': _block.BlockEmbed, + 'blots/break': _break2.default, + 'blots/container': _container2.default, + 'blots/cursor': _cursor2.default, + 'blots/embed': _embed2.default, + 'blots/inline': _inline2.default, + 'blots/scroll': _scroll2.default, + 'blots/text': _text2.default, -/***/ }, -/* 41 */ -/***/ function(module, exports) { - - exports = module.exports = typeof Object.keys === 'function' - ? Object.keys : shim; - - exports.shim = shim; - function shim (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; - } + 'modules/clipboard': _clipboard2.default, + 'modules/history': _history2.default, + 'modules/keyboard': _keyboard2.default +}); +_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); -/***/ }, -/* 42 */ -/***/ function(module, exports) { +exports.default = _quill2.default; - var supportsArgumentsClass = (function(){ - return Object.prototype.toString.call(arguments) - })() == '[object Arguments]'; +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { - exports = module.exports = supportsArgumentsClass ? supported : unsupported; +"use strict"; - exports.supported = supported; - function supported(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; - }; +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var ShadowBlot = /** @class */ (function () { + function ShadowBlot(domNode) { + this.domNode = domNode; + // @ts-ignore + this.domNode[Registry.DATA_KEY] = { blot: this }; + } + Object.defineProperty(ShadowBlot.prototype, "statics", { + // Hack for accessing inherited static methods + get: function () { + return this.constructor; + }, + enumerable: true, + configurable: true + }); + ShadowBlot.create = function (value) { + if (this.tagName == null) { + throw new Registry.ParchmentError('Blot definition missing tagName'); + } + var node; + if (Array.isArray(this.tagName)) { + if (typeof value === 'string') { + value = value.toUpperCase(); + if (parseInt(value).toString() === value) { + value = parseInt(value); + } + } + if (typeof value === 'number') { + node = document.createElement(this.tagName[value - 1]); + } + else if (this.tagName.indexOf(value) > -1) { + node = document.createElement(value); + } + else { + node = document.createElement(this.tagName[0]); + } + } + else { + node = document.createElement(this.tagName); + } + if (this.className) { + node.classList.add(this.className); + } + return node; + }; + ShadowBlot.prototype.attach = function () { + if (this.parent != null) { + this.scroll = this.parent.scroll; + } + }; + ShadowBlot.prototype.clone = function () { + var domNode = this.domNode.cloneNode(false); + return Registry.create(domNode); + }; + ShadowBlot.prototype.detach = function () { + if (this.parent != null) + this.parent.removeChild(this); + // @ts-ignore + delete this.domNode[Registry.DATA_KEY]; + }; + ShadowBlot.prototype.deleteAt = function (index, length) { + var blot = this.isolate(index, length); + blot.remove(); + }; + ShadowBlot.prototype.formatAt = function (index, length, name, value) { + var blot = this.isolate(index, length); + if (Registry.query(name, Registry.Scope.BLOT) != null && value) { + blot.wrap(name, value); + } + else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { + var parent = Registry.create(this.statics.scope); + blot.wrap(parent); + parent.format(name, value); + } + }; + ShadowBlot.prototype.insertAt = function (index, value, def) { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + var ref = this.split(index); + this.parent.insertBefore(blot, ref); + }; + ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { + if (refBlot === void 0) { refBlot = null; } + if (this.parent != null) { + this.parent.children.remove(this); + } + var refDomNode = null; + parentBlot.children.insertBefore(this, refBlot); + if (refBlot != null) { + refDomNode = refBlot.domNode; + } + if (this.domNode.parentNode != parentBlot.domNode || + this.domNode.nextSibling != refDomNode) { + parentBlot.domNode.insertBefore(this.domNode, refDomNode); + } + this.parent = parentBlot; + this.attach(); + }; + ShadowBlot.prototype.isolate = function (index, length) { + var target = this.split(index); + target.split(length); + return target; + }; + ShadowBlot.prototype.length = function () { + return 1; + }; + ShadowBlot.prototype.offset = function (root) { + if (root === void 0) { root = this.parent; } + if (this.parent == null || this == root) + return 0; + return this.parent.children.offset(this) + this.parent.offset(root); + }; + ShadowBlot.prototype.optimize = function (context) { + // TODO clean up once we use WeakMap + // @ts-ignore + if (this.domNode[Registry.DATA_KEY] != null) { + // @ts-ignore + delete this.domNode[Registry.DATA_KEY].mutations; + } + }; + ShadowBlot.prototype.remove = function () { + if (this.domNode.parentNode != null) { + this.domNode.parentNode.removeChild(this.domNode); + } + this.detach(); + }; + ShadowBlot.prototype.replace = function (target) { + if (target.parent == null) + return; + target.parent.insertBefore(this, target.next); + target.remove(); + }; + ShadowBlot.prototype.replaceWith = function (name, value) { + var replacement = typeof name === 'string' ? Registry.create(name, value) : name; + replacement.replace(this); + return replacement; + }; + ShadowBlot.prototype.split = function (index, force) { + return index === 0 ? this : this.next; + }; + ShadowBlot.prototype.update = function (mutations, context) { + // Nothing to do by default + }; + ShadowBlot.prototype.wrap = function (name, value) { + var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; + if (this.parent != null) { + this.parent.insertBefore(wrapper, this.next); + } + wrapper.appendChild(this); + return wrapper; + }; + ShadowBlot.blotName = 'abstract'; + return ShadowBlot; +}()); +exports.default = ShadowBlot; - exports.unsupported = unsupported; - function unsupported(object){ - return object && - typeof object == 'object' && - typeof object.length == 'number' && - Object.prototype.hasOwnProperty.call(object, 'callee') && - !Object.prototype.propertyIsEnumerable.call(object, 'callee') || - false; - }; +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 43 */ -/***/ function(module, exports) { +"use strict"; - "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(32); +var style_1 = __webpack_require__(33); +var Registry = __webpack_require__(1); +var AttributorStore = /** @class */ (function () { + function AttributorStore(domNode) { + this.attributes = {}; + this.domNode = domNode; + this.build(); + } + AttributorStore.prototype.attribute = function (attribute, value) { + // verb + if (value) { + if (attribute.add(this.domNode, value)) { + if (attribute.value(this.domNode) != null) { + this.attributes[attribute.attrName] = attribute; + } + else { + delete this.attributes[attribute.attrName]; + } + } + } + else { + attribute.remove(this.domNode); + delete this.attributes[attribute.attrName]; + } + }; + AttributorStore.prototype.build = function () { + var _this = this; + this.attributes = {}; + var attributes = attributor_1.default.keys(this.domNode); + var classes = class_1.default.keys(this.domNode); + var styles = style_1.default.keys(this.domNode); + attributes + .concat(classes) + .concat(styles) + .forEach(function (name) { + var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); + if (attr instanceof attributor_1.default) { + _this.attributes[attr.attrName] = attr; + } + }); + }; + AttributorStore.prototype.copy = function (target) { + var _this = this; + Object.keys(this.attributes).forEach(function (key) { + var value = _this.attributes[key].value(_this.domNode); + target.format(key, value); + }); + }; + AttributorStore.prototype.move = function (target) { + var _this = this; + this.copy(target); + Object.keys(this.attributes).forEach(function (key) { + _this.attributes[key].remove(_this.domNode); + }); + this.attributes = {}; + }; + AttributorStore.prototype.values = function () { + var _this = this; + return Object.keys(this.attributes).reduce(function (attributes, name) { + attributes[name] = _this.attributes[name].value(_this.domNode); + return attributes; + }, {}); + }; + return AttributorStore; +}()); +exports.default = AttributorStore; - Object.defineProperty(exports, "__esModule", { - value: true - }); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { - var Module = function Module(quill) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; +"use strict"; - _classCallCheck(this, Module); +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function match(node, prefix) { + var className = node.getAttribute('class') || ''; + return className.split(/\s+/).filter(function (name) { + return name.indexOf(prefix + "-") === 0; + }); +} +var ClassAttributor = /** @class */ (function (_super) { + __extends(ClassAttributor, _super); + function ClassAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + ClassAttributor.keys = function (node) { + return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { + return name + .split('-') + .slice(0, -1) + .join('-'); + }); + }; + ClassAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + this.remove(node); + node.classList.add(this.keyName + "-" + value); + return true; + }; + ClassAttributor.prototype.remove = function (node) { + var matches = match(node, this.keyName); + matches.forEach(function (name) { + node.classList.remove(name); + }); + if (node.classList.length === 0) { + node.removeAttribute('class'); + } + }; + ClassAttributor.prototype.value = function (node) { + var result = match(node, this.keyName)[0] || ''; + var value = result.slice(this.keyName.length + 1); // +1 for hyphen + return this.canAdd(node, value) ? value : ''; + }; + return ClassAttributor; +}(attributor_1.default)); +exports.default = ClassAttributor; - this.quill = quill; - this.options = options; - }; - Module.DEFAULTS = {}; +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { - exports.default = Module; +"use strict"; -/***/ }, -/* 44 */ -/***/ function(module, exports, __webpack_require__) { +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function camelize(name) { + var parts = name.split('-'); + var rest = parts + .slice(1) + .map(function (part) { + return part[0].toUpperCase() + part.slice(1); + }) + .join(''); + return parts[0] + rest; +} +var StyleAttributor = /** @class */ (function (_super) { + __extends(StyleAttributor, _super); + function StyleAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + StyleAttributor.keys = function (node) { + return (node.getAttribute('style') || '').split(';').map(function (value) { + var arr = value.split(':'); + return arr[0].trim(); + }); + }; + StyleAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + // @ts-ignore + node.style[camelize(this.keyName)] = value; + return true; + }; + StyleAttributor.prototype.remove = function (node) { + // @ts-ignore + node.style[camelize(this.keyName)] = ''; + if (!node.getAttribute('style')) { + node.removeAttribute('style'); + } + }; + StyleAttributor.prototype.value = function (node) { + // @ts-ignore + var value = node.style[camelize(this.keyName)]; + return this.canAdd(node, value) ? value : ''; + }; + return StyleAttributor; +}(attributor_1.default)); +exports.default = StyleAttributor; - 'use strict'; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.Range = undefined; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _clone = __webpack_require__(39); - - var _clone2 = _interopRequireDefault(_clone); - - var _deepEqual = __webpack_require__(40); - - var _deepEqual2 = _interopRequireDefault(_deepEqual); - - var _emitter3 = __webpack_require__(36); - - var _emitter4 = _interopRequireDefault(_emitter3); - - var _logger = __webpack_require__(38); - - var _logger2 = _interopRequireDefault(_logger); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var debug = (0, _logger2.default)('quill:selection'); - - var Range = function Range(index) { - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - _classCallCheck(this, Range); - - this.index = index; - this.length = length; - }; - - var Selection = function () { - function Selection(scroll, emitter) { - var _this = this; - - _classCallCheck(this, Selection); - - this.emitter = emitter; - this.scroll = scroll; - this.composing = false; - this.root = this.scroll.domNode; - this.root.addEventListener('compositionstart', function () { - _this.composing = true; - }); - this.root.addEventListener('compositionend', function () { - _this.composing = false; - }); - this.cursor = _parchment2.default.create('cursor', this); - // savedRange is last non-null range - this.lastRange = this.savedRange = new Range(0, 0); - ['keyup', 'mouseup', 'mouseleave', 'touchend', 'touchleave', 'focus', 'blur'].forEach(function (eventName) { - _this.root.addEventListener(eventName, function () { - // When range used to be a selection and user click within the selection, - // the range now being a cursor has not updated yet without setTimeout - setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 100); - }); - }); - this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { - if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { - _this.update(_emitter4.default.sources.SILENT); - } - }); - this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { - var native = _this.getNativeRange(); - if (native == null) return; - if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle - // TODO unclear if this has negative side effects - _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { - try { - _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); - } catch (ignored) {} - }); - }); - this.update(_emitter4.default.sources.SILENT); - } - - _createClass(Selection, [{ - key: 'focus', - value: function focus() { - if (this.hasFocus()) return; - var bodyTop = document.body.scrollTop; - this.root.focus(); - document.body.scrollTop = bodyTop; - this.setRange(this.savedRange); - } - }, { - key: 'format', - value: function format(_format, value) { - this.scroll.update(); - var nativeRange = this.getNativeRange(); - if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; - if (nativeRange.start.node !== this.cursor.textNode) { - var blot = _parchment2.default.find(nativeRange.start.node, false); - if (blot == null) return; - // TODO Give blot ability to not split - if (blot instanceof _parchment2.default.Leaf) { - var after = blot.split(nativeRange.start.offset); - blot.parent.insertBefore(this.cursor, after); - } else { - blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen - } - this.cursor.attach(); - } - this.cursor.format(_format, value); - this.scroll.optimize(); - this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); - this.update(); - } - }, { - key: 'getBounds', - value: function getBounds(index) { - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var scrollLength = this.scroll.length(); - index = Math.min(index, scrollLength - 1); - length = Math.min(index + length, scrollLength - 1) - index; - var bounds = void 0, - node = void 0, - _scroll$leaf = this.scroll.leaf(index), - _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), - leaf = _scroll$leaf2[0], - offset = _scroll$leaf2[1]; - if (leaf == null) return null; - - var _leaf$position = leaf.position(offset, true); - - var _leaf$position2 = _slicedToArray(_leaf$position, 2); - - node = _leaf$position2[0]; - offset = _leaf$position2[1]; - - var range = document.createRange(); - if (length > 0) { - range.setStart(node, offset); - - var _scroll$leaf3 = this.scroll.leaf(index + length); - - var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); - - leaf = _scroll$leaf4[0]; - offset = _scroll$leaf4[1]; - - if (leaf == null) return null; - - var _leaf$position3 = leaf.position(offset, true); - - var _leaf$position4 = _slicedToArray(_leaf$position3, 2); - - node = _leaf$position4[0]; - offset = _leaf$position4[1]; - - range.setEnd(node, offset); - bounds = range.getBoundingClientRect(); - } else { - var side = 'left'; - var rect = void 0; - if (node instanceof Text) { - if (offset < node.data.length) { - range.setStart(node, offset); - range.setEnd(node, offset + 1); - } else { - range.setStart(node, offset - 1); - range.setEnd(node, offset); - side = 'right'; - } - rect = range.getBoundingClientRect(); - } else { - rect = leaf.domNode.getBoundingClientRect(); - if (offset > 0) side = 'right'; - } - bounds = { - height: rect.height, - left: rect[side], - width: 0, - top: rect.top - }; - } - var containerBounds = this.root.parentNode.getBoundingClientRect(); - return { - left: bounds.left - containerBounds.left, - right: bounds.left + bounds.width - containerBounds.left, - top: bounds.top - containerBounds.top, - bottom: bounds.top + bounds.height - containerBounds.top, - height: bounds.height, - width: bounds.width - }; - } - }, { - key: 'getNativeRange', - value: function getNativeRange() { - var selection = document.getSelection(); - if (selection == null || selection.rangeCount <= 0) return null; - var nativeRange = selection.getRangeAt(0); - if (nativeRange == null) return null; - if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { - return null; - } - var range = { - start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, - end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, - native: nativeRange - }; - [range.start, range.end].forEach(function (position) { - var node = position.node, - offset = position.offset; - while (!(node instanceof Text) && node.childNodes.length > 0) { - if (node.childNodes.length > offset) { - node = node.childNodes[offset]; - offset = 0; - } else if (node.childNodes.length === offset) { - node = node.lastChild; - offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; - } else { - break; - } - } - position.node = node, position.offset = offset; - }); - debug.info('getNativeRange', range); - return range; - } - }, { - key: 'getRange', - value: function getRange() { - var _this2 = this; - - var range = this.getNativeRange(); - if (range == null) return [null, null]; - var positions = [[range.start.node, range.start.offset]]; - if (!range.native.collapsed) { - positions.push([range.end.node, range.end.offset]); - } - var indexes = positions.map(function (position) { - var _position = _slicedToArray(position, 2), - node = _position[0], - offset = _position[1]; - - var blot = _parchment2.default.find(node, true); - var index = blot.offset(_this2.scroll); - if (offset === 0) { - return index; - } else if (blot instanceof _parchment2.default.Container) { - return index + blot.length(); - } else { - return index + blot.index(node, offset); - } - }); - var start = Math.min.apply(Math, _toConsumableArray(indexes)), - end = Math.max.apply(Math, _toConsumableArray(indexes)); - return [new Range(start, end - start), range]; - } - }, { - key: 'hasFocus', - value: function hasFocus() { - return document.activeElement === this.root; - } - }, { - key: 'scrollIntoView', - value: function scrollIntoView() { - var range = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.lastRange; - - if (range == null) return; - var bounds = this.getBounds(range.index, range.length); - if (bounds == null) return; - if (this.root.offsetHeight < bounds.bottom) { - var _scroll$line = this.scroll.line(Math.min(range.index + range.length, this.scroll.length() - 1)), - _scroll$line2 = _slicedToArray(_scroll$line, 1), - line = _scroll$line2[0]; - - this.root.scrollTop = line.domNode.offsetTop + line.domNode.offsetHeight - this.root.offsetHeight; - } else if (bounds.top < 0) { - var _scroll$line3 = this.scroll.line(Math.min(range.index, this.scroll.length() - 1)), - _scroll$line4 = _slicedToArray(_scroll$line3, 1), - _line = _scroll$line4[0]; - - this.root.scrollTop = _line.domNode.offsetTop; - } - } - }, { - key: 'setNativeRange', - value: function setNativeRange(startNode, startOffset) { - var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; - var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; - var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; - - debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); - if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { - return; - } - var selection = document.getSelection(); - if (selection == null) return; - if (startNode != null) { - if (!this.hasFocus()) this.root.focus(); - var nativeRange = this.getNativeRange(); - if (nativeRange == null || force || startNode !== nativeRange.start.node || startOffset !== nativeRange.start.offset || endNode !== nativeRange.end.node || endOffset !== nativeRange.end.offset) { - var range = document.createRange(); - range.setStart(startNode, startOffset); - range.setEnd(endNode, endOffset); - selection.removeAllRanges(); - selection.addRange(range); - } - } else { - selection.removeAllRanges(); - this.root.blur(); - document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) - } - } - }, { - key: 'setRange', - value: function setRange(range) { - var _this3 = this; - - var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; - - if (typeof force === 'string') { - source = force; - force = false; - } - debug.info('setRange', range); - if (range != null) { - (function () { - var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; - var args = []; - var scrollLength = _this3.scroll.length(); - indexes.forEach(function (index, i) { - index = Math.min(scrollLength - 1, index); - var node = void 0, - _scroll$leaf5 = _this3.scroll.leaf(index), - _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), - leaf = _scroll$leaf6[0], - offset = _scroll$leaf6[1]; - var _leaf$position5 = leaf.position(offset, i !== 0); - - var _leaf$position6 = _slicedToArray(_leaf$position5, 2); - - node = _leaf$position6[0]; - offset = _leaf$position6[1]; - - args.push(node, offset); - }); - if (args.length < 2) { - args = args.concat(args); - } - _this3.setNativeRange.apply(_this3, _toConsumableArray(args).concat([force])); - })(); - } else { - this.setNativeRange(null); - } - this.update(source); - } - }, { - key: 'update', - value: function update() { - var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; - - var nativeRange = void 0, - oldRange = this.lastRange; - - var _getRange = this.getRange(); - - var _getRange2 = _slicedToArray(_getRange, 2); - - this.lastRange = _getRange2[0]; - nativeRange = _getRange2[1]; - - if (this.lastRange != null) { - this.savedRange = this.lastRange; - } - if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { - var _emitter; - - if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { - this.cursor.restore(); - } - var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; - (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); - if (source !== _emitter4.default.sources.SILENT) { - var _emitter2; - - (_emitter2 = this.emitter).emit.apply(_emitter2, args); - } - } - } - }]); - - return Selection; - }(); - - function contains(parent, descendant) { - try { - // Firefox inserts inaccessible nodes around video elements - descendant.parentNode; - } catch (e) { - return false; - } - // IE11 has bug with Text nodes - // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect - if (descendant instanceof Text) { - descendant = descendant.parentNode; - } - return parent.contains(descendant); - } +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { - exports.Range = Range; - exports.default = Selection; +"use strict"; -/***/ }, -/* 45 */ -/***/ function(module, exports) { - 'use strict'; +Object.defineProperty(exports, "__esModule", { + value: true +}); - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var Theme = function () { - function Theme(quill, options) { - _classCallCheck(this, Theme); - - this.quill = quill; - this.options = options; - this.modules = {}; - } - - _createClass(Theme, [{ - key: 'init', - value: function init() { - var _this = this; - - Object.keys(this.options.modules).forEach(function (name) { - if (_this.modules[name] == null) { - _this.addModule(name); - } - }); - } - }, { - key: 'addModule', - value: function addModule(name) { - var moduleClass = this.quill.constructor.import('modules/' + name); - this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); - return this.modules[name]; - } - }]); - - return Theme; - }(); - - Theme.DEFAULTS = { - modules: {} - }; - Theme.themes = { - 'default': Theme - }; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - exports.default = Theme; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -/***/ }, -/* 46 */ -/***/ function(module, exports, __webpack_require__) { +var Theme = function () { + function Theme(quill, options) { + _classCallCheck(this, Theme); + + this.quill = quill; + this.options = options; + this.modules = {}; + } + + _createClass(Theme, [{ + key: 'init', + value: function init() { + var _this = this; + + Object.keys(this.options.modules).forEach(function (name) { + if (_this.modules[name] == null) { + _this.addModule(name); + } + }); + } + }, { + key: 'addModule', + value: function addModule(name) { + var moduleClass = this.quill.constructor.import('modules/' + name); + this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); + return this.modules[name]; + } + }]); + + return Theme; +}(); + +Theme.DEFAULTS = { + modules: {} +}; +Theme.themes = { + 'default': Theme +}; - 'use strict'; +exports.default = Theme; - Object.defineProperty(exports, "__esModule", { - value: true - }); +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { - var _parchment = __webpack_require__(2); +"use strict"; - var _parchment2 = _interopRequireDefault(_parchment); - var _block = __webpack_require__(29); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _block2 = _interopRequireDefault(_block); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _parchment = __webpack_require__(0); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var _parchment2 = _interopRequireDefault(_parchment); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var GUARD_TEXT = '\uFEFF'; + +var Embed = function (_Parchment$Embed) { + _inherits(Embed, _Parchment$Embed); + + function Embed(node) { + _classCallCheck(this, Embed); + + var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node)); + + _this.contentNode = document.createElement('span'); + _this.contentNode.setAttribute('contenteditable', false); + [].slice.call(_this.domNode.childNodes).forEach(function (childNode) { + _this.contentNode.appendChild(childNode); + }); + _this.leftGuard = document.createTextNode(GUARD_TEXT); + _this.rightGuard = document.createTextNode(GUARD_TEXT); + _this.domNode.appendChild(_this.leftGuard); + _this.domNode.appendChild(_this.contentNode); + _this.domNode.appendChild(_this.rightGuard); + return _this; + } + + _createClass(Embed, [{ + key: 'index', + value: function index(node, offset) { + if (node === this.leftGuard) return 0; + if (node === this.rightGuard) return 1; + return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'restore', + value: function restore(node) { + var range = void 0, + textNode = void 0; + var text = node.data.split(GUARD_TEXT).join(''); + if (node === this.leftGuard) { + if (this.prev instanceof _text2.default) { + var prevLength = this.prev.length(); + this.prev.insertAt(prevLength, text); + range = { + startNode: this.prev.domNode, + startOffset: prevLength + text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } else if (node === this.rightGuard) { + if (this.next instanceof _text2.default) { + this.next.insertAt(0, text); + range = { + startNode: this.next.domNode, + startOffset: text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this.next); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } + node.data = GUARD_TEXT; + return range; + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + mutations.forEach(function (mutation) { + if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) { + var range = _this2.restore(mutation.target); + if (range) context.range = range; + } + }); + } + }]); - var Container = function (_Parchment$Container) { - _inherits(Container, _Parchment$Container); + return Embed; +}(_parchment2.default.Embed); - function Container() { - _classCallCheck(this, Container); +exports.default = Embed; - return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); - } +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { - return Container; - }(_parchment2.default.Container); +"use strict"; - Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; - exports.default = Container; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; -/***/ }, -/* 47 */ -/***/ function(module, exports, __webpack_require__) { +var _parchment = __webpack_require__(0); - 'use strict'; +var _parchment2 = _interopRequireDefault(_parchment); - Object.defineProperty(exports, "__esModule", { - value: true - }); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['right', 'center', 'justify'] +}; - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); +var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); +var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +exports.AlignAttribute = AlignAttribute; +exports.AlignClass = AlignClass; +exports.AlignStyle = AlignStyle; - var _parchment = __webpack_require__(2); +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { - var _parchment2 = _interopRequireDefault(_parchment); +"use strict"; - var _emitter = __webpack_require__(36); - var _emitter2 = _interopRequireDefault(_emitter); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BackgroundStyle = exports.BackgroundClass = undefined; - var _block = __webpack_require__(29); +var _parchment = __webpack_require__(0); - var _block2 = _interopRequireDefault(_block); +var _parchment2 = _interopRequireDefault(_parchment); - var _break = __webpack_require__(31); +var _color = __webpack_require__(26); - var _break2 = _interopRequireDefault(_break); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _container = __webpack_require__(46); +var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { + scope: _parchment2.default.Scope.INLINE +}); +var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { + scope: _parchment2.default.Scope.INLINE +}); - var _container2 = _interopRequireDefault(_container); +exports.BackgroundClass = BackgroundClass; +exports.BackgroundStyle = BackgroundStyle; - var _code = __webpack_require__(28); +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { - var _code2 = _interopRequireDefault(_code); +"use strict"; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var _parchment = __webpack_require__(0); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _parchment2 = _interopRequireDefault(_parchment); - function isLine(blot) { - return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var Scroll = function (_Parchment$Scroll) { - _inherits(Scroll, _Parchment$Scroll); +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['rtl'] +}; - function Scroll(domNode, config) { - _classCallCheck(this, Scroll); +var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); +var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); +var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); - var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); +exports.DirectionAttribute = DirectionAttribute; +exports.DirectionClass = DirectionClass; +exports.DirectionStyle = DirectionStyle; - _this.emitter = config.emitter; - if (Array.isArray(config.whitelist)) { - _this.whitelist = config.whitelist.reduce(function (whitelist, format) { - whitelist[format] = true; - return whitelist; - }, {}); - } - _this.optimize(); - _this.enable(); - return _this; - } - - _createClass(Scroll, [{ - key: 'deleteAt', - value: function deleteAt(index, length) { - var _line = this.line(index), - _line2 = _slicedToArray(_line, 2), - first = _line2[0], - offset = _line2[1]; - - var _line3 = this.line(index + length), - _line4 = _slicedToArray(_line3, 1), - last = _line4[0]; - - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); - if (last != null && first !== last && offset > 0 && !(first instanceof _block.BlockEmbed) && !(last instanceof _block.BlockEmbed)) { - if (last instanceof _code2.default) { - last.deleteAt(last.length() - 1, 1); - } - var ref = last.children.head instanceof _break2.default ? null : last.children.head; - first.moveChildren(last, ref); - first.remove(); - } - this.optimize(); - } - }, { - key: 'enable', - value: function enable() { - var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - - this.domNode.setAttribute('contenteditable', enabled); - } - }, { - key: 'formatAt', - value: function formatAt(index, length, format, value) { - if (this.whitelist != null && !this.whitelist[format]) return; - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); - this.optimize(); - } - }, { - key: 'insertAt', - value: function insertAt(index, value, def) { - if (def != null && this.whitelist != null && !this.whitelist[value]) return; - if (index >= this.length()) { - if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { - var blot = _parchment2.default.create(this.statics.defaultChild); - this.appendChild(blot); - if (def == null && value.endsWith('\n')) { - value = value.slice(0, -1); - } - blot.insertAt(0, value, def); - } else { - var embed = _parchment2.default.create(value, def); - this.appendChild(embed); - } - } else { - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); - } - this.optimize(); - } - }, { - key: 'insertBefore', - value: function insertBefore(blot, ref) { - if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { - var wrapper = _parchment2.default.create(this.statics.defaultChild); - wrapper.appendChild(blot); - blot = wrapper; - } - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); - } - }, { - key: 'leaf', - value: function leaf(index) { - return this.path(index).pop() || [null, -1]; - } - }, { - key: 'line', - value: function line(index) { - if (index === this.length()) { - return this.line(index - 1); - } - return this.descendant(isLine, index); - } - }, { - key: 'lines', - value: function lines() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; - - var getLines = function getLines(blot, index, length) { - var lines = [], - lengthLeft = length; - blot.children.forEachAt(index, length, function (child, index, length) { - if (isLine(child)) { - lines.push(child); - } else if (child instanceof _parchment2.default.Container) { - lines = lines.concat(getLines(child, index, lengthLeft)); - } - lengthLeft -= length; - }); - return lines; - }; - return getLines(this, index, length); - } - }, { - key: 'optimize', - value: function optimize() { - var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - if (this.batch === true) return; - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations); - if (mutations.length > 0) { - this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations); - } - } - }, { - key: 'path', - value: function path(index) { - return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self - } - }, { - key: 'update', - value: function update(mutations) { - if (this.batch === true) return; - var source = _emitter2.default.sources.USER; - if (typeof mutations === 'string') { - source = mutations; - } - if (!Array.isArray(mutations)) { - mutations = this.observer.takeRecords(); - } - if (mutations.length > 0) { - this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); - } - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy - if (mutations.length > 0) { - this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); - } - } - }]); - - return Scroll; - }(_parchment2.default.Scroll); - - Scroll.blotName = 'scroll'; - Scroll.className = 'ql-editor'; - Scroll.tagName = 'DIV'; - Scroll.defaultChild = 'block'; - Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { - exports.default = Scroll; +"use strict"; -/***/ }, -/* 48 */ -/***/ function(module, exports, __webpack_require__) { - 'use strict'; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FontClass = exports.FontStyle = undefined; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _quillDelta = __webpack_require__(20); - - var _quillDelta2 = _interopRequireDefault(_quillDelta); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _quill = __webpack_require__(18); - - var _quill2 = _interopRequireDefault(_quill); - - var _logger = __webpack_require__(38); - - var _logger2 = _interopRequireDefault(_logger); - - var _module = __webpack_require__(43); - - var _module2 = _interopRequireDefault(_module); - - var _align = __webpack_require__(49); - - var _background = __webpack_require__(50); - - var _color = __webpack_require__(51); - - var _direction = __webpack_require__(52); - - var _font = __webpack_require__(53); - - var _size = __webpack_require__(54); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var debug = (0, _logger2.default)('quill:clipboard'); - - var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; - - var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { - memo[attr.keyName] = attr; - return memo; - }, {}); - - var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { - memo[attr.keyName] = attr; - return memo; - }, {}); - - var Clipboard = function (_Module) { - _inherits(Clipboard, _Module); - - function Clipboard(quill, options) { - _classCallCheck(this, Clipboard); - - var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); - - _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); - _this.container = _this.quill.addContainer('ql-clipboard'); - _this.container.setAttribute('contenteditable', true); - _this.container.setAttribute('tabindex', -1); - _this.matchers = []; - CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (pair) { - _this.addMatcher.apply(_this, _toConsumableArray(pair)); - }); - return _this; - } - - _createClass(Clipboard, [{ - key: 'addMatcher', - value: function addMatcher(selector, matcher) { - this.matchers.push([selector, matcher]); - } - }, { - key: 'convert', - value: function convert(html) { - var _this2 = this; - - var DOM_KEY = '__ql-matcher'; - if (typeof html === 'string') { - this.container.innerHTML = html; - } - var textMatchers = [], - elementMatchers = []; - this.matchers.forEach(function (pair) { - var _pair = _slicedToArray(pair, 2), - selector = _pair[0], - matcher = _pair[1]; - - switch (selector) { - case Node.TEXT_NODE: - textMatchers.push(matcher); - break; - case Node.ELEMENT_NODE: - elementMatchers.push(matcher); - break; - default: - [].forEach.call(_this2.container.querySelectorAll(selector), function (node) { - // TODO use weakmap - node[DOM_KEY] = node[DOM_KEY] || []; - node[DOM_KEY].push(matcher); - }); - break; - } - }); - var traverse = function traverse(node) { - // Post-order - if (node.nodeType === node.TEXT_NODE) { - return textMatchers.reduce(function (delta, matcher) { - return matcher(node, delta); - }, new _quillDelta2.default()); - } else if (node.nodeType === node.ELEMENT_NODE) { - return [].reduce.call(node.childNodes || [], function (delta, childNode) { - var childrenDelta = traverse(childNode); - if (childNode.nodeType === node.ELEMENT_NODE) { - childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { - return matcher(childNode, childrenDelta); - }, childrenDelta); - childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { - return matcher(childNode, childrenDelta); - }, childrenDelta); - } - return delta.concat(childrenDelta); - }, new _quillDelta2.default()); - } else { - return new _quillDelta2.default(); - } - }; - var delta = traverse(this.container); - // Remove trailing newline - if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { - delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); - } - debug.log('convert', this.container.innerHTML, delta); - this.container.innerHTML = ''; - return delta; - } - }, { - key: 'dangerouslyPasteHTML', - value: function dangerouslyPasteHTML(index, html) { - var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; - - if (typeof index === 'string') { - return this.quill.setContents(this.convert(index), html); - } else { - var paste = this.convert(html); - return this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); - } - } - }, { - key: 'onPaste', - value: function onPaste(e) { - var _this3 = this; - - if (e.defaultPrevented || !this.quill.isEnabled()) return; - var range = this.quill.getSelection(); - var delta = new _quillDelta2.default().retain(range.index).delete(range.length); - var bodyTop = document.body.scrollTop; - this.container.focus(); - setTimeout(function () { - _this3.quill.selection.update(_quill2.default.sources.SILENT); - delta = delta.concat(_this3.convert()); - _this3.quill.updateContents(delta, _quill2.default.sources.USER); - // range.length contributes to delta.length() - _this3.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); - document.body.scrollTop = bodyTop; - _this3.quill.selection.scrollIntoView(); - }, 1); - } - }]); - - return Clipboard; - }(_module2.default); - - Clipboard.DEFAULTS = { - matchers: [] - }; - - function computeStyle(node) { - if (node.nodeType !== Node.ELEMENT_NODE) return {}; - var DOM_KEY = '__ql-computed-style'; - return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); - } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function deltaEndsWith(delta, text) { - var endText = ""; - for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { - var op = delta.ops[i]; - if (typeof op.insert !== 'string') break; - endText = op.insert + endText; - } - return endText.slice(-1 * text.length) === text; - } +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - function isLine(node) { - if (node.childNodes.length === 0) return false; // Exclude embed blocks - var style = computeStyle(node); - return ['block', 'list-item'].indexOf(style.display) > -1; - } +var _parchment = __webpack_require__(0); - function matchAlias(format, node, delta) { - return delta.compose(new _quillDelta2.default().retain(delta.length(), _defineProperty({}, format, true))); - } +var _parchment2 = _interopRequireDefault(_parchment); - function matchAttributor(node, delta) { - var attributes = _parchment2.default.Attributor.Attribute.keys(node); - var classes = _parchment2.default.Attributor.Class.keys(node); - var styles = _parchment2.default.Attributor.Style.keys(node); - var formats = {}; - attributes.concat(classes).concat(styles).forEach(function (name) { - var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); - if (attr != null) { - formats[attr.attrName] = attr.value(node); - if (formats[attr.attrName]) return; - } - if (ATTRIBUTE_ATTRIBUTORS[name] != null) { - attr = ATTRIBUTE_ATTRIBUTORS[name]; - formats[attr.attrName] = attr.value(node); - } - if (STYLE_ATTRIBUTORS[name] != null) { - attr = STYLE_ATTRIBUTORS[name]; - formats[attr.attrName] = attr.value(node); - } - }); - if (Object.keys(formats).length > 0) { - delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats)); - } - return delta; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function matchBlot(node, delta) { - var match = _parchment2.default.query(node); - if (match == null) return delta; - if (match.prototype instanceof _parchment2.default.Embed) { - var embed = {}; - var value = match.value(node); - if (value != null) { - embed[match.blotName] = value; - delta = new _quillDelta2.default().insert(embed, match.formats(node)); - } - } else if (typeof match.formats === 'function') { - var formats = _defineProperty({}, match.blotName, match.formats(node)); - delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats)); - } - return delta; - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function matchBreak(node, delta) { - if (!deltaEndsWith(delta, '\n')) { - delta.insert('\n'); - } - return delta; - } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - function matchIgnore() { - return new _quillDelta2.default(); - } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - function matchNewline(node, delta) { - if (isLine(node) && !deltaEndsWith(delta, '\n')) { - delta.insert('\n'); - } - return delta; - } +var config = { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['serif', 'monospace'] +}; - function matchSpacing(node, delta) { - if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { - var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); - if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { - delta.insert('\n'); - } - } - return delta; - } +var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); - function matchStyles(node, delta) { - var formats = {}; - var style = node.style || {}; - if (style.fontWeight && computeStyle(node).fontWeight === 'bold') { - formats.bold = true; - } - if (Object.keys(formats).length > 0) { - delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats)); - } - if (parseFloat(style.textIndent || 0) > 0) { - // Could be 0.5in - delta = new _quillDelta2.default().insert('\t').concat(delta); - } - return delta; - } +var FontStyleAttributor = function (_Parchment$Attributor) { + _inherits(FontStyleAttributor, _Parchment$Attributor); - function matchText(node, delta) { - var text = node.data; - // Word represents empty line with   - if (node.parentNode.tagName === 'O:P') { - return delta.insert(text.trim()); - } - if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { - // eslint-disable-next-line func-style - var replacer = function replacer(collapse, match) { - match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; - return match.length < 1 && collapse ? ' ' : match; - }; - text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); - text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace - if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { - text = text.replace(/^\s+/, replacer.bind(replacer, false)); - } - if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { - text = text.replace(/\s+$/, replacer.bind(replacer, false)); - } - } - return delta.insert(text); - } + function FontStyleAttributor() { + _classCallCheck(this, FontStyleAttributor); - exports.default = Clipboard; - exports.matchAttributor = matchAttributor; - exports.matchBlot = matchBlot; - exports.matchNewline = matchNewline; - exports.matchSpacing = matchSpacing; - exports.matchText = matchText; + return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); + } -/***/ }, -/* 49 */ -/***/ function(module, exports, __webpack_require__) { + _createClass(FontStyleAttributor, [{ + key: 'value', + value: function value(node) { + return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); + } + }]); - 'use strict'; + return FontStyleAttributor; +}(_parchment2.default.Attributor.Style); - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; +var FontStyle = new FontStyleAttributor('font', 'font-family', config); - var _parchment = __webpack_require__(2); +exports.FontStyle = FontStyle; +exports.FontClass = FontClass; - var _parchment2 = _interopRequireDefault(_parchment); +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +"use strict"; - var config = { - scope: _parchment2.default.Scope.BLOCK, - whitelist: ['right', 'center', 'justify'] - }; - var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); - var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); - var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SizeStyle = exports.SizeClass = undefined; - exports.AlignAttribute = AlignAttribute; - exports.AlignClass = AlignClass; - exports.AlignStyle = AlignStyle; +var _parchment = __webpack_require__(0); -/***/ }, -/* 50 */ -/***/ function(module, exports, __webpack_require__) { +var _parchment2 = _interopRequireDefault(_parchment); - 'use strict'; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.BackgroundStyle = exports.BackgroundClass = undefined; +var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['small', 'large', 'huge'] +}); +var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['10px', '18px', '32px'] +}); - var _parchment = __webpack_require__(2); +exports.SizeClass = SizeClass; +exports.SizeStyle = SizeStyle; - var _parchment2 = _interopRequireDefault(_parchment); +/***/ }), +/* 41 */, +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { - var _color = __webpack_require__(51); +"use strict"; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { - scope: _parchment2.default.Scope.INLINE - }); - var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { - scope: _parchment2.default.Scope.INLINE - }); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getLastChangeIndex = exports.default = undefined; - exports.BackgroundClass = BackgroundClass; - exports.BackgroundStyle = BackgroundStyle; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -/***/ }, -/* 51 */ -/***/ function(module, exports, __webpack_require__) { +var _parchment = __webpack_require__(0); - 'use strict'; +var _parchment2 = _interopRequireDefault(_parchment); - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var History = function (_Module) { + _inherits(History, _Module); + + function History(quill, options) { + _classCallCheck(this, History); + + var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); + + _this.lastRecorded = 0; + _this.ignoreChange = false; + _this.clear(); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { + if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; + if (!_this.options.userOnly || source === _quill2.default.sources.USER) { + _this.record(delta, oldDelta); + } else { + _this.transform(delta); + } + }); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); + if (/Win/i.test(navigator.platform)) { + _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); + } + return _this; + } + + _createClass(History, [{ + key: 'change', + value: function change(source, dest) { + if (this.stack[source].length === 0) return; + var delta = this.stack[source].pop(); + this.stack[dest].push(delta); + this.lastRecorded = 0; + this.ignoreChange = true; + this.quill.updateContents(delta[source], _quill2.default.sources.USER); + this.ignoreChange = false; + var index = getLastChangeIndex(delta[source]); + this.quill.setSelection(index); + } + }, { + key: 'clear', + value: function clear() { + this.stack = { undo: [], redo: [] }; + } + }, { + key: 'cutoff', + value: function cutoff() { + this.lastRecorded = 0; + } + }, { + key: 'record', + value: function record(changeDelta, oldDelta) { + if (changeDelta.ops.length === 0) return; + this.stack.redo = []; + var undoDelta = this.quill.getContents().diff(oldDelta); + var timestamp = Date.now(); + if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { + var delta = this.stack.undo.pop(); + undoDelta = undoDelta.compose(delta.undo); + changeDelta = delta.redo.compose(changeDelta); + } else { + this.lastRecorded = timestamp; + } + this.stack.undo.push({ + redo: changeDelta, + undo: undoDelta + }); + if (this.stack.undo.length > this.options.maxStack) { + this.stack.undo.shift(); + } + } + }, { + key: 'redo', + value: function redo() { + this.change('redo', 'undo'); + } + }, { + key: 'transform', + value: function transform(delta) { + this.stack.undo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + this.stack.redo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + } + }, { + key: 'undo', + value: function undo() { + this.change('undo', 'redo'); + } + }]); + + return History; +}(_module2.default); + +History.DEFAULTS = { + delay: 1000, + maxStack: 100, + userOnly: false +}; + +function endsWithNewlineChange(delta) { + var lastOp = delta.ops[delta.ops.length - 1]; + if (lastOp == null) return false; + if (lastOp.insert != null) { + return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); + } + if (lastOp.attributes != null) { + return Object.keys(lastOp.attributes).some(function (attr) { + return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; + }); + } + return false; +} + +function getLastChangeIndex(delta) { + var deleteLength = delta.reduce(function (length, op) { + length += op.delete || 0; + return length; + }, 0); + var changeIndex = delta.length() - deleteLength; + if (endsWithNewlineChange(delta)) { + changeIndex -= 1; + } + return changeIndex; +} - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +exports.default = History; +exports.getLastChangeIndex = getLastChangeIndex; - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +/***/ }), +/* 43 */, +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { - var _parchment = __webpack_require__(2); +"use strict"; - var _parchment2 = _interopRequireDefault(_parchment); +Object.defineProperty(exports, "__esModule", { value: true }); +var LinkedList = /** @class */ (function () { + function LinkedList() { + this.head = this.tail = null; + this.length = 0; + } + LinkedList.prototype.append = function () { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i] = arguments[_i]; + } + this.insertBefore(nodes[0], null); + if (nodes.length > 1) { + this.append.apply(this, nodes.slice(1)); + } + }; + LinkedList.prototype.contains = function (node) { + var cur, next = this.iterator(); + while ((cur = next())) { + if (cur === node) + return true; + } + return false; + }; + LinkedList.prototype.insertBefore = function (node, refNode) { + if (!node) + return; + node.next = refNode; + if (refNode != null) { + node.prev = refNode.prev; + if (refNode.prev != null) { + refNode.prev.next = node; + } + refNode.prev = node; + if (refNode === this.head) { + this.head = node; + } + } + else if (this.tail != null) { + this.tail.next = node; + node.prev = this.tail; + this.tail = node; + } + else { + node.prev = null; + this.head = this.tail = node; + } + this.length += 1; + }; + LinkedList.prototype.offset = function (target) { + var index = 0, cur = this.head; + while (cur != null) { + if (cur === target) + return index; + index += cur.length(); + cur = cur.next; + } + return -1; + }; + LinkedList.prototype.remove = function (node) { + if (!this.contains(node)) + return; + if (node.prev != null) + node.prev.next = node.next; + if (node.next != null) + node.next.prev = node.prev; + if (node === this.head) + this.head = node.next; + if (node === this.tail) + this.tail = node.prev; + this.length -= 1; + }; + LinkedList.prototype.iterator = function (curNode) { + if (curNode === void 0) { curNode = this.head; } + // TODO use yield when we can + return function () { + var ret = curNode; + if (curNode != null) + curNode = curNode.next; + return ret; + }; + }; + LinkedList.prototype.find = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var cur, next = this.iterator(); + while ((cur = next())) { + var length = cur.length(); + if (index < length || + (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) { + return [cur, index]; + } + index -= length; + } + return [null, 0]; + }; + LinkedList.prototype.forEach = function (callback) { + var cur, next = this.iterator(); + while ((cur = next())) { + callback(cur); + } + }; + LinkedList.prototype.forEachAt = function (index, length, callback) { + if (length <= 0) + return; + var _a = this.find(index), startNode = _a[0], offset = _a[1]; + var cur, curIndex = index - offset, next = this.iterator(startNode); + while ((cur = next()) && curIndex < index + length) { + var curLength = cur.length(); + if (index > curIndex) { + callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); + } + else { + callback(cur, 0, Math.min(curLength, index + length - curIndex)); + } + curIndex += curLength; + } + }; + LinkedList.prototype.map = function (callback) { + return this.reduce(function (memo, cur) { + memo.push(callback(cur)); + return memo; + }, []); + }; + LinkedList.prototype.reduce = function (callback, memo) { + var cur, next = this.iterator(); + while ((cur = next())) { + memo = callback(memo, cur); + } + return memo; + }; + return LinkedList; +}()); +exports.default = LinkedList; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +"use strict"; - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var OBSERVER_CONFIG = { + attributes: true, + characterData: true, + characterDataOldValue: true, + childList: true, + subtree: true, +}; +var MAX_OPTIMIZE_ITERATIONS = 100; +var ScrollBlot = /** @class */ (function (_super) { + __extends(ScrollBlot, _super); + function ScrollBlot(node) { + var _this = _super.call(this, node) || this; + _this.scroll = _this; + _this.observer = new MutationObserver(function (mutations) { + _this.update(mutations); + }); + _this.observer.observe(_this.domNode, OBSERVER_CONFIG); + _this.attach(); + return _this; + } + ScrollBlot.prototype.detach = function () { + _super.prototype.detach.call(this); + this.observer.disconnect(); + }; + ScrollBlot.prototype.deleteAt = function (index, length) { + this.update(); + if (index === 0 && length === this.length()) { + this.children.forEach(function (child) { + child.remove(); + }); + } + else { + _super.prototype.deleteAt.call(this, index, length); + } + }; + ScrollBlot.prototype.formatAt = function (index, length, name, value) { + this.update(); + _super.prototype.formatAt.call(this, index, length, name, value); + }; + ScrollBlot.prototype.insertAt = function (index, value, def) { + this.update(); + _super.prototype.insertAt.call(this, index, value, def); + }; + ScrollBlot.prototype.optimize = function (mutations, context) { + var _this = this; + if (mutations === void 0) { mutations = []; } + if (context === void 0) { context = {}; } + _super.prototype.optimize.call(this, context); + // We must modify mutations directly, cannot make copy and then modify + var records = [].slice.call(this.observer.takeRecords()); + // Array.push currently seems to be implemented by a non-tail recursive function + // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords()); + while (records.length > 0) + mutations.push(records.pop()); + // TODO use WeakMap + var mark = function (blot, markParent) { + if (markParent === void 0) { markParent = true; } + if (blot == null || blot === _this) + return; + if (blot.domNode.parentNode == null) + return; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = []; + } + if (markParent) + mark(blot.parent); + }; + var optimize = function (blot) { + // Post-order traversal + if ( + // @ts-ignore + blot.domNode[Registry.DATA_KEY] == null || + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations == null) { + return; + } + if (blot instanceof container_1.default) { + blot.children.forEach(optimize); + } + blot.optimize(context); + }; + var remaining = mutations; + for (var i = 0; remaining.length > 0; i += 1) { + if (i >= MAX_OPTIMIZE_ITERATIONS) { + throw new Error('[Parchment] Maximum optimize iterations reached'); + } + remaining.forEach(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return; + if (blot.domNode === mutation.target) { + if (mutation.type === 'childList') { + mark(Registry.find(mutation.previousSibling, false)); + [].forEach.call(mutation.addedNodes, function (node) { + var child = Registry.find(node, false); + mark(child, false); + if (child instanceof container_1.default) { + child.children.forEach(function (grandChild) { + mark(grandChild, false); + }); + } + }); + } + else if (mutation.type === 'attributes') { + mark(blot.prev); + } + } + mark(blot); + }); + this.children.forEach(optimize); + remaining = [].slice.call(this.observer.takeRecords()); + records = remaining.slice(); + while (records.length > 0) + mutations.push(records.pop()); + } + }; + ScrollBlot.prototype.update = function (mutations, context) { + var _this = this; + if (context === void 0) { context = {}; } + mutations = mutations || this.observer.takeRecords(); + // TODO use WeakMap + mutations + .map(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return null; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = [mutation]; + return blot; + } + else { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations.push(mutation); + return null; + } + }) + .forEach(function (blot) { + if (blot == null || + blot === _this || + //@ts-ignore + blot.domNode[Registry.DATA_KEY] == null) + return; + // @ts-ignore + blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context); + }); + // @ts-ignore + if (this.domNode[Registry.DATA_KEY].mutations != null) { + // @ts-ignore + _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context); + } + this.optimize(mutations, context); + }; + ScrollBlot.blotName = 'scroll'; + ScrollBlot.defaultChild = 'block'; + ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; + ScrollBlot.tagName = 'DIV'; + return ScrollBlot; +}(container_1.default)); +exports.default = ScrollBlot; - var ColorAttributor = function (_Parchment$Attributor) { - _inherits(ColorAttributor, _Parchment$Attributor); - function ColorAttributor() { - _classCallCheck(this, ColorAttributor); +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { - return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); - } +"use strict"; - _createClass(ColorAttributor, [{ - key: 'value', - value: function value(domNode) { - var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); - if (!value.startsWith('rgb(')) return value; - value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); - return '#' + value.split(',').map(function (component) { - return ('00' + parseInt(component).toString(16)).slice(-2); - }).join(''); - } - }]); +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +// Shallow object comparison +function isEqual(obj1, obj2) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) + return false; + // @ts-ignore + for (var prop in obj1) { + // @ts-ignore + if (obj1[prop] !== obj2[prop]) + return false; + } + return true; +} +var InlineBlot = /** @class */ (function (_super) { + __extends(InlineBlot, _super); + function InlineBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + InlineBlot.formats = function (domNode) { + if (domNode.tagName === InlineBlot.tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + InlineBlot.prototype.format = function (name, value) { + var _this = this; + if (name === this.statics.blotName && !value) { + this.children.forEach(function (child) { + if (!(child instanceof format_1.default)) { + child = child.wrap(InlineBlot.blotName, true); + } + _this.attributes.copy(child); + }); + this.unwrap(); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + InlineBlot.prototype.formatAt = function (index, length, name, value) { + if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { + var blot = this.isolate(index, length); + blot.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + InlineBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + var formats = this.formats(); + if (Object.keys(formats).length === 0) { + return this.unwrap(); // unformatted span + } + var next = this.next; + if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { + next.moveChildren(this); + next.remove(); + } + }; + InlineBlot.blotName = 'inline'; + InlineBlot.scope = Registry.Scope.INLINE_BLOT; + InlineBlot.tagName = 'SPAN'; + return InlineBlot; +}(format_1.default)); +exports.default = InlineBlot; - return ColorAttributor; - }(_parchment2.default.Attributor.Style); - var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { - scope: _parchment2.default.Scope.INLINE - }); - var ColorStyle = new ColorAttributor('color', 'color', { - scope: _parchment2.default.Scope.INLINE - }); +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { - exports.ColorAttributor = ColorAttributor; - exports.ColorClass = ColorClass; - exports.ColorStyle = ColorStyle; +"use strict"; -/***/ }, -/* 52 */ -/***/ function(module, exports, __webpack_require__) { +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +var BlockBlot = /** @class */ (function (_super) { + __extends(BlockBlot, _super); + function BlockBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlockBlot.formats = function (domNode) { + var tagName = Registry.query(BlockBlot.blotName).tagName; + if (domNode.tagName === tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + BlockBlot.prototype.format = function (name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) == null) { + return; + } + else if (name === this.statics.blotName && !value) { + this.replaceWith(BlockBlot.blotName); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + BlockBlot.prototype.formatAt = function (index, length, name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) != null) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + BlockBlot.prototype.insertAt = function (index, value, def) { + if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { + // Insert text or inline + _super.prototype.insertAt.call(this, index, value, def); + } + else { + var after = this.split(index); + var blot = Registry.create(value, def); + after.parent.insertBefore(blot, after); + } + }; + BlockBlot.prototype.update = function (mutations, context) { + if (navigator.userAgent.match(/Trident/)) { + this.build(); + } + else { + _super.prototype.update.call(this, mutations, context); + } + }; + BlockBlot.blotName = 'block'; + BlockBlot.scope = Registry.Scope.BLOCK_BLOT; + BlockBlot.tagName = 'P'; + return BlockBlot; +}(format_1.default)); +exports.default = BlockBlot; - 'use strict'; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { - var _parchment = __webpack_require__(2); +"use strict"; - var _parchment2 = _interopRequireDefault(_parchment); +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var EmbedBlot = /** @class */ (function (_super) { + __extends(EmbedBlot, _super); + function EmbedBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + EmbedBlot.formats = function (domNode) { + return undefined; + }; + EmbedBlot.prototype.format = function (name, value) { + // super.formatAt wraps, which is what we want in general, + // but this allows subclasses to overwrite for formats + // that just apply to particular embeds + _super.prototype.formatAt.call(this, 0, this.length(), name, value); + }; + EmbedBlot.prototype.formatAt = function (index, length, name, value) { + if (index === 0 && length === this.length()) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + EmbedBlot.prototype.formats = function () { + return this.statics.formats(this.domNode); + }; + return EmbedBlot; +}(leaf_1.default)); +exports.default = EmbedBlot; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var config = { - scope: _parchment2.default.Scope.BLOCK, - whitelist: ['rtl'] - }; +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { - var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); - var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); - var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); +"use strict"; - exports.DirectionAttribute = DirectionAttribute; - exports.DirectionClass = DirectionClass; - exports.DirectionStyle = DirectionStyle; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var Registry = __webpack_require__(1); +var TextBlot = /** @class */ (function (_super) { + __extends(TextBlot, _super); + function TextBlot(node) { + var _this = _super.call(this, node) || this; + _this.text = _this.statics.value(_this.domNode); + return _this; + } + TextBlot.create = function (value) { + return document.createTextNode(value); + }; + TextBlot.value = function (domNode) { + var text = domNode.data; + // @ts-ignore + if (text['normalize']) + text = text['normalize'](); + return text; + }; + TextBlot.prototype.deleteAt = function (index, length) { + this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); + }; + TextBlot.prototype.index = function (node, offset) { + if (this.domNode === node) { + return offset; + } + return -1; + }; + TextBlot.prototype.insertAt = function (index, value, def) { + if (def == null) { + this.text = this.text.slice(0, index) + value + this.text.slice(index); + this.domNode.data = this.text; + } + else { + _super.prototype.insertAt.call(this, index, value, def); + } + }; + TextBlot.prototype.length = function () { + return this.text.length; + }; + TextBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + this.text = this.statics.value(this.domNode); + if (this.text.length === 0) { + this.remove(); + } + else if (this.next instanceof TextBlot && this.next.prev === this) { + this.insertAt(this.length(), this.next.value()); + this.next.remove(); + } + }; + TextBlot.prototype.position = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + return [this.domNode, index]; + }; + TextBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = Registry.create(this.domNode.splitText(index)); + this.parent.insertBefore(after, this.next); + this.text = this.statics.value(this.domNode); + return after; + }; + TextBlot.prototype.update = function (mutations, context) { + var _this = this; + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this.domNode; + })) { + this.text = this.statics.value(this.domNode); + } + }; + TextBlot.prototype.value = function () { + return this.text; + }; + TextBlot.blotName = 'text'; + TextBlot.scope = Registry.Scope.INLINE_BLOT; + return TextBlot; +}(leaf_1.default)); +exports.default = TextBlot; -/***/ }, -/* 53 */ -/***/ function(module, exports, __webpack_require__) { - 'use strict'; +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.FontClass = exports.FontStyle = undefined; +"use strict"; - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +var elem = document.createElement('div'); +elem.classList.toggle('test-class', false); +if (elem.classList.contains('test-class')) { + var _toggle = DOMTokenList.prototype.toggle; + DOMTokenList.prototype.toggle = function (token, force) { + if (arguments.length > 1 && !this.contains(token) === !force) { + return force; + } else { + return _toggle.call(this, token); + } + }; +} + +if (!String.prototype.startsWith) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; +} + +if (!String.prototype.endsWith) { + String.prototype.endsWith = function (searchString, position) { + var subjectString = this.toString(); + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length; + } + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; +} + +if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, "find", { + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } + } + return undefined; + } + }); +} + +document.addEventListener("DOMContentLoaded", function () { + // Disable resizing in Firefox + document.execCommand("enableObjectResizing", false, false); + // Disable automatic linkifying in IE11 + document.execCommand("autoUrlDetect", false, false); +}); - var _parchment = __webpack_require__(2); +/***/ }), +/* 51 */ +/***/ (function(module, exports) { - var _parchment2 = _interopRequireDefault(_parchment); +/** + * This library modifies the diff-patch-match library by Neil Fraser + * by removing the patch and match functionality and certain advanced + * options in the diff function. The original license is as follows: + * + * === + * + * Diff Match and Patch + * + * Copyright 2006 Google Inc. + * http://code.google.com/p/google-diff-match-patch/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ +var DIFF_DELETE = -1; +var DIFF_INSERT = 1; +var DIFF_EQUAL = 0; - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +/** + * Find the differences between two texts. Simplifies the problem by stripping + * any common prefix or suffix off the texts before diffing. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {Int} cursor_pos Expected edit position in text1 (optional) + * @return {Array} Array of diff tuples. + */ +function diff_main(text1, text2, cursor_pos) { + // Check for equality (speedup). + if (text1 == text2) { + if (text1) { + return [[DIFF_EQUAL, text1]]; + } + return []; + } + + // Check cursor_pos within bounds + if (cursor_pos < 0 || text1.length < cursor_pos) { + cursor_pos = null; + } + + // Trim off common prefix (speedup). + var commonlength = diff_commonPrefix(text1, text2); + var commonprefix = text1.substring(0, commonlength); + text1 = text1.substring(commonlength); + text2 = text2.substring(commonlength); + + // Trim off common suffix (speedup). + 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); + + // Compute the diff on the middle block. + var diffs = diff_compute_(text1, text2); + + // Restore the prefix and suffix. + if (commonprefix) { + diffs.unshift([DIFF_EQUAL, commonprefix]); + } + if (commonsuffix) { + diffs.push([DIFF_EQUAL, commonsuffix]); + } + diff_cleanupMerge(diffs); + if (cursor_pos != null) { + diffs = fix_cursor(diffs, cursor_pos); + } + diffs = fix_emoji(diffs); + return diffs; +}; + + +/** + * Find the differences between two texts. Assumes that the texts do not + * have any common prefix or suffix. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + */ +function diff_compute_(text1, text2) { + var diffs; - var config = { - scope: _parchment2.default.Scope.INLINE, - whitelist: ['serif', 'monospace'] - }; + if (!text1) { + // Just add some text (speedup). + return [[DIFF_INSERT, text2]]; + } + + if (!text2) { + // Just delete some text (speedup). + return [[DIFF_DELETE, text1]]; + } + + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + var i = longtext.indexOf(shorttext); + if (i != -1) { + // Shorter text is inside the longer text (speedup). + diffs = [[DIFF_INSERT, longtext.substring(0, i)], + [DIFF_EQUAL, shorttext], + [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; + // Swap insertions for deletions if diff is reversed. + if (text1.length > text2.length) { + diffs[0][0] = diffs[2][0] = DIFF_DELETE; + } + return diffs; + } + + if (shorttext.length == 1) { + // Single character string. + // After the previous speedup, the character can't be an equality. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + } + + // Check to see if the problem can be split in two. + var hm = diff_halfMatch_(text1, text2); + if (hm) { + // A half-match was found, sort out the return data. + var text1_a = hm[0]; + var text1_b = hm[1]; + var text2_a = hm[2]; + var text2_b = hm[3]; + var mid_common = hm[4]; + // Send both pairs off for separate processing. + var diffs_a = diff_main(text1_a, text2_a); + var diffs_b = diff_main(text1_b, text2_b); + // Merge the results. + return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); + } + + return diff_bisect_(text1, text2); +}; + + +/** + * Find the 'middle snake' of a diff, split the problem in two + * and return the recursively constructed diff. + * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + * @private + */ +function diff_bisect_(text1, text2) { + // Cache the text lengths to prevent multiple calls. + var text1_length = text1.length; + var text2_length = text2.length; + var max_d = Math.ceil((text1_length + text2_length) / 2); + var v_offset = max_d; + var v_length = 2 * max_d; + var v1 = new Array(v_length); + var v2 = new Array(v_length); + // Setting all elements to -1 is faster in Chrome & Firefox than mixing + // integers and undefined. + for (var x = 0; x < v_length; x++) { + v1[x] = -1; + v2[x] = -1; + } + v1[v_offset + 1] = 0; + v2[v_offset + 1] = 0; + var delta = text1_length - text2_length; + // If the total number of characters is odd, then the front path will collide + // with the reverse path. + var front = (delta % 2 != 0); + // Offsets for start and end of k loop. + // Prevents mapping of space beyond the grid. + var k1start = 0; + var k1end = 0; + var k2start = 0; + var k2end = 0; + for (var d = 0; d < max_d; d++) { + // Walk the front path one step. + for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { + var k1_offset = v_offset + k1; + var x1; + if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { + x1 = v1[k1_offset + 1]; + } else { + x1 = v1[k1_offset - 1] + 1; + } + var y1 = x1 - k1; + while (x1 < text1_length && y1 < text2_length && + text1.charAt(x1) == text2.charAt(y1)) { + x1++; + y1++; + } + v1[k1_offset] = x1; + if (x1 > text1_length) { + // Ran off the right of the graph. + k1end += 2; + } else if (y1 > text2_length) { + // Ran off the bottom of the graph. + k1start += 2; + } else if (front) { + var k2_offset = v_offset + delta - k1; + if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { + // Mirror x2 onto top-left coordinate system. + var x2 = text1_length - v2[k2_offset]; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + + // Walk the reverse path one step. + for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { + var k2_offset = v_offset + k2; + var x2; + if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { + x2 = v2[k2_offset + 1]; + } else { + x2 = v2[k2_offset - 1] + 1; + } + var y2 = x2 - k2; + while (x2 < text1_length && y2 < text2_length && + text1.charAt(text1_length - x2 - 1) == + text2.charAt(text2_length - y2 - 1)) { + x2++; + y2++; + } + v2[k2_offset] = x2; + if (x2 > text1_length) { + // Ran off the left of the graph. + k2end += 2; + } else if (y2 > text2_length) { + // Ran off the top of the graph. + 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]; + var y1 = v_offset + x1 - k1_offset; + // Mirror x2 onto top-left coordinate system. + x2 = text1_length - x2; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + } + // Diff took too long and hit the deadline or + // number of diffs equals number of characters, no commonality at all. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; +}; + + +/** + * Given the location of the 'middle snake', split the diff in two parts + * and recurse. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} x Index of split point in text1. + * @param {number} y Index of split point in text2. + * @return {Array} Array of diff tuples. + */ +function diff_bisectSplit_(text1, text2, x, y) { + var text1a = text1.substring(0, x); + var text2a = text2.substring(0, y); + var text1b = text1.substring(x); + var text2b = text2.substring(y); + + // Compute both diffs serially. + var diffs = diff_main(text1a, text2a); + var diffsb = diff_main(text1b, text2b); + + return diffs.concat(diffsb); +}; + + +/** + * Determine the common prefix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the start of each + * string. + */ +function diff_commonPrefix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerstart = 0; + while (pointermin < pointermid) { + if (text1.substring(pointerstart, pointermid) == + text2.substring(pointerstart, pointermid)) { + pointermin = pointermid; + pointerstart = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Determine the common suffix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of each string. + */ +function diff_commonSuffix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || + text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerend = 0; + while (pointermin < pointermid) { + if (text1.substring(text1.length - pointermid, text1.length - pointerend) == + text2.substring(text2.length - pointermid, text2.length - pointerend)) { + pointermin = pointermid; + pointerend = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Do the two texts share a substring which is at least half the length of the + * longer text? + * This speedup can produce non-minimal diffs. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {Array.} Five element Array, containing the prefix of + * text1, the suffix of text1, the prefix of text2, the suffix of + * text2 and the common middle. Or null if there was no match. + */ +function diff_halfMatch_(text1, text2) { + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { + return null; // Pointless. + } + + /** + * Does a substring of shorttext exist within longtext such that the substring + * is at least half the length of longtext? + * Closure, but does not reference any external variables. + * @param {string} longtext Longer string. + * @param {string} shorttext Shorter string. + * @param {number} i Start index of quarter length substring within longtext. + * @return {Array.} Five element Array, containing the prefix of + * longtext, the suffix of longtext, the prefix of shorttext, the suffix + * of shorttext and the common middle. Or null if there was no match. + * @private + */ + function diff_halfMatchI_(longtext, shorttext, i) { + // Start with a 1/4 length substring at position i as a seed. + var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); + var j = -1; + var best_common = ''; + var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; + while ((j = shorttext.indexOf(seed, j + 1)) != -1) { + var prefixLength = diff_commonPrefix(longtext.substring(i), + shorttext.substring(j)); + var suffixLength = diff_commonSuffix(longtext.substring(0, i), + shorttext.substring(0, j)); + if (best_common.length < suffixLength + prefixLength) { + best_common = shorttext.substring(j - suffixLength, j) + + shorttext.substring(j, j + prefixLength); + best_longtext_a = longtext.substring(0, i - suffixLength); + best_longtext_b = longtext.substring(i + prefixLength); + best_shorttext_a = shorttext.substring(0, j - suffixLength); + best_shorttext_b = shorttext.substring(j + prefixLength); + } + } + if (best_common.length * 2 >= longtext.length) { + return [best_longtext_a, best_longtext_b, + best_shorttext_a, best_shorttext_b, best_common]; + } else { + return null; + } + } + + // First check if the second quarter is the seed for a half-match. + var hm1 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 4)); + // Check again based on the third quarter. + var hm2 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 2)); + var hm; + if (!hm1 && !hm2) { + return null; + } else if (!hm2) { + hm = hm1; + } else if (!hm1) { + hm = hm2; + } else { + // Both matched. Select the longest. + hm = hm1[4].length > hm2[4].length ? hm1 : hm2; + } + + // A half-match was found, sort out the return data. + var text1_a, text1_b, text2_a, text2_b; + if (text1.length > text2.length) { + text1_a = hm[0]; + text1_b = hm[1]; + text2_a = hm[2]; + text2_b = hm[3]; + } else { + 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]; +}; + + +/** + * Reorder and merge like edit sections. Merge equalities. + * Any edit section can move as long as it doesn't cross an equality. + * @param {Array} diffs Array of diff tuples. + */ +function diff_cleanupMerge(diffs) { + diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. + var pointer = 0; + var count_delete = 0; + var count_insert = 0; + var text_delete = ''; + var text_insert = ''; + var commonlength; + while (pointer < diffs.length) { + 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: + // Upon reaching an equality, check for prior redundancies. + if (count_delete + count_insert > 1) { + if (count_delete !== 0 && count_insert !== 0) { + // Factor out any common prefixies. + commonlength = diff_commonPrefix(text_insert, text_delete); + if (commonlength !== 0) { + if ((pointer - count_delete - count_insert) > 0 && + diffs[pointer - count_delete - count_insert - 1][0] == + DIFF_EQUAL) { + diffs[pointer - count_delete - count_insert - 1][1] += + text_insert.substring(0, commonlength); + } else { + diffs.splice(0, 0, [DIFF_EQUAL, + text_insert.substring(0, commonlength)]); + pointer++; + } + text_insert = text_insert.substring(commonlength); + text_delete = text_delete.substring(commonlength); + } + // Factor out any common suffixies. + commonlength = diff_commonSuffix(text_insert, text_delete); + if (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); + } + } + // Delete the offending records and add the merged ones. + if (count_delete === 0) { + diffs.splice(pointer - count_insert, + count_delete + count_insert, [DIFF_INSERT, text_insert]); + } else if (count_insert === 0) { + diffs.splice(pointer - count_delete, + count_delete + count_insert, [DIFF_DELETE, text_delete]); + } else { + diffs.splice(pointer - count_delete - count_insert, + count_delete + count_insert, [DIFF_DELETE, text_delete], + [DIFF_INSERT, text_insert]); + } + pointer = pointer - count_delete - count_insert + + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; + } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { + // Merge this equality with the previous one. + diffs[pointer - 1][1] += diffs[pointer][1]; + diffs.splice(pointer, 1); + } else { + pointer++; + } + count_insert = 0; + count_delete = 0; + text_delete = ''; + text_insert = ''; + break; + } + } + if (diffs[diffs.length - 1][1] === '') { + diffs.pop(); // Remove the dummy entry at the end. + } + + // Second pass: look for single edits surrounded on both sides by equalities + // which can be shifted sideways to eliminate an equality. + // e.g: ABAC -> ABAC + var changes = false; + pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if (diffs[pointer - 1][0] == DIFF_EQUAL && + diffs[pointer + 1][0] == DIFF_EQUAL) { + // This is a single edit surrounded by equalities. + if (diffs[pointer][1].substring(diffs[pointer][1].length - + diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { + // Shift the edit over the previous equality. + 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 = true; + } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == + diffs[pointer + 1][1]) { + // Shift the edit over the next equality. + 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 = true; + } + } + pointer++; + } + // If shifts were made, the diff needs reordering and another shift sweep. + if (changes) { + diff_cleanupMerge(diffs); + } +}; + + +var diff = diff_main; +diff.INSERT = DIFF_INSERT; +diff.DELETE = DIFF_DELETE; +diff.EQUAL = DIFF_EQUAL; + +module.exports = diff; + +/* + * Modify a diff such that the cursor position points to the start of a change: + * E.g. + * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) + * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] + * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) + * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} A tuple [cursor location in the modified diff, modified diff] + */ +function cursor_normalize_diff (diffs, cursor_pos) { + if (cursor_pos === 0) { + return [DIFF_EQUAL, diffs]; + } + for (var current_pos = 0, i = 0; i < diffs.length; i++) { + var d = diffs[i]; + if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { + var next_pos = current_pos + d[1].length; + if (cursor_pos === next_pos) { + return [i + 1, diffs]; + } else if (cursor_pos < next_pos) { + // copy to prevent side effects + diffs = diffs.slice(); + // split d into two diff changes + var split_pos = cursor_pos - current_pos; + var d_left = [d[0], d[1].slice(0, split_pos)]; + var d_right = [d[0], d[1].slice(split_pos)]; + diffs.splice(i, 1, d_left, d_right); + return [i + 1, diffs]; + } else { + current_pos = next_pos; + } + } + } + throw new Error('cursor_pos is out of bounds!') +} + +/* + * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). + * + * Case 1) + * Check if a naive shift is possible: + * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) + * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result + * Case 2) + * Check if the following shifts are possible: + * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] + * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] + * ^ ^ + * d d_next + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} Array of diff tuples + */ +function fix_cursor (diffs, cursor_pos) { + var norm = cursor_normalize_diff(diffs, cursor_pos); + var ndiffs = norm[1]; + var cursor_pointer = norm[0]; + var d = ndiffs[cursor_pointer]; + var d_next = ndiffs[cursor_pointer + 1]; + + if (d == null) { + // Text was deleted from end of original string, + // cursor is now out of bounds in new string + return diffs; + } else if (d[0] !== DIFF_EQUAL) { + // A modification happened at the cursor location. + // This is the expected outcome, so we can return the original diff. + return diffs; + } else { + if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { + // Case 1) + // It is possible to perform a naive shift + ndiffs.splice(cursor_pointer, 2, d_next, d) + return merge_tuples(ndiffs, cursor_pointer, 2) + } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { + // Case 2) + // d[1] is a prefix of d_next[1] + // We can assume that d_next[0] !== 0, since d[0] === 0 + // Shift edit locations.. + ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); + var suffix = d_next[1].slice(d[1].length); + if (suffix.length > 0) { + ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); + } + return merge_tuples(ndiffs, cursor_pointer, 3) + } else { + // Not possible to perform any modification + return diffs; + } + } +} + +/* + * Check diff did not split surrogate pairs. + * Ex. [0, '\uD83D'], [-1, '\uDC36'], [1, '\uDC2F'] -> [-1, '\uD83D\uDC36'], [1, '\uD83D\uDC2F'] + * '\uD83D\uDC36' === '🐶', '\uD83D\uDC2F' === '🐯' + * + * @param {Array} diffs Array of diff tuples + * @return {Array} Array of diff tuples + */ +function fix_emoji (diffs) { + var compact = false; + var starts_with_pair_end = function(str) { + return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF; + } + var ends_with_pair_start = function(str) { + return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF; + } + for (var i = 2; i < diffs.length; i += 1) { + if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) && + diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) && + diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) { + compact = true; + + diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1]; + diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1]; + + diffs[i-2][1] = diffs[i-2][1].slice(0, -1); + } + } + if (!compact) { + return diffs; + } + var fixed_diffs = []; + for (var i = 0; i < diffs.length; i += 1) { + if (diffs[i][1].length > 0) { + fixed_diffs.push(diffs[i]); + } + } + return fixed_diffs; +} + +/* + * Try to merge tuples with their neigbors in a given range. + * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] + * + * @param {Array} diffs Array of diff tuples. + * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). + * @param {Int} length Number of consecutive elements to check. + * @return {Array} Array of merged diff tuples. + */ +function merge_tuples (diffs, start, length) { + // Check from (start-1) to (start+length). + for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { + if (i + 1 < diffs.length) { + var left_d = diffs[i]; + var right_d = diffs[i+1]; + if (left_d[0] === right_d[1]) { + diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); + } + } + } + return diffs; +} - var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); - var FontStyleAttributor = function (_Parchment$Attributor) { - _inherits(FontStyleAttributor, _Parchment$Attributor); +/***/ }), +/* 52 */ +/***/ (function(module, exports) { - function FontStyleAttributor() { - _classCallCheck(this, FontStyleAttributor); +exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; - return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); - } +exports.shim = shim; +function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} - _createClass(FontStyleAttributor, [{ - key: 'value', - value: function value(node) { - return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); - } - }]); - return FontStyleAttributor; - }(_parchment2.default.Attributor.Style); +/***/ }), +/* 53 */ +/***/ (function(module, exports) { - var FontStyle = new FontStyleAttributor('font', 'font-family', config); +var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) +})() == '[object Arguments]'; + +exports = module.exports = supportsArgumentsClass ? supported : unsupported; + +exports.supported = supported; +function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +}; + +exports.unsupported = unsupported; +function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; +}; - exports.FontStyle = FontStyle; - exports.FontClass = FontClass; -/***/ }, +/***/ }), /* 54 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.SizeStyle = exports.SizeClass = undefined; - - var _parchment = __webpack_require__(2); +/***/ (function(module, exports) { - var _parchment2 = _interopRequireDefault(_parchment); +'use strict'; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var has = Object.prototype.hasOwnProperty + , prefix = '~'; - var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { - scope: _parchment2.default.Scope.INLINE, - whitelist: ['small', 'large', 'huge'] - }); - var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { - scope: _parchment2.default.Scope.INLINE, - whitelist: ['10px', '18px', '32px'] - }); - - exports.SizeClass = SizeClass; - exports.SizeStyle = SizeStyle; - -/***/ }, -/* 55 */ -/***/ function(module, exports, __webpack_require__) { +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @api private + */ +function Events() {} - 'use strict'; +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {Mixed} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @api private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @api public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Boolean} exists Only check if there are listeners. + * @returns {Array|Boolean} + * @api public + */ +EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @api public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.getLastChangeIndex = exports.default = undefined; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _quill = __webpack_require__(18); - - var _quill2 = _interopRequireDefault(_quill); - - var _module = __webpack_require__(43); - - var _module2 = _interopRequireDefault(_module); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var History = function (_Module) { - _inherits(History, _Module); - - function History(quill, options) { - _classCallCheck(this, History); - - var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); - - _this.lastRecorded = 0; - _this.ignoreChange = false; - _this.clear(); - _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { - if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; - if (!_this.options.userOnly || source === _quill2.default.sources.USER) { - _this.record(delta, oldDelta); - } else { - _this.transform(delta); - } - }); - _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); - _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); - if (/Win/i.test(navigator.platform)) { - _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); - } - return _this; - } - - _createClass(History, [{ - key: 'change', - value: function change(source, dest) { - if (this.stack[source].length === 0) return; - var delta = this.stack[source].pop(); - this.lastRecorded = 0; - this.ignoreChange = true; - this.quill.updateContents(delta[source], _quill2.default.sources.USER); - this.ignoreChange = false; - var index = getLastChangeIndex(delta[source]); - this.quill.setSelection(index); - this.quill.selection.scrollIntoView(); - this.stack[dest].push(delta); - } - }, { - key: 'clear', - value: function clear() { - this.stack = { undo: [], redo: [] }; - } - }, { - key: 'record', - value: function record(changeDelta, oldDelta) { - if (changeDelta.ops.length === 0) return; - this.stack.redo = []; - var undoDelta = this.quill.getContents().diff(oldDelta); - var timestamp = Date.now(); - if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { - var delta = this.stack.undo.pop(); - undoDelta = undoDelta.compose(delta.undo); - changeDelta = delta.redo.compose(changeDelta); - } else { - this.lastRecorded = timestamp; - } - this.stack.undo.push({ - redo: changeDelta, - undo: undoDelta - }); - if (this.stack.undo.length > this.options.maxStack) { - this.stack.undo.shift(); - } - } - }, { - key: 'redo', - value: function redo() { - this.change('redo', 'undo'); - } - }, { - key: 'transform', - value: function transform(delta) { - this.stack.undo.forEach(function (change) { - change.undo = delta.transform(change.undo, true); - change.redo = delta.transform(change.redo, true); - }); - this.stack.redo.forEach(function (change) { - change.undo = delta.transform(change.undo, true); - change.redo = delta.transform(change.redo, true); - }); - } - }, { - key: 'undo', - value: function undo() { - this.change('undo', 'redo'); - } - }]); - - return History; - }(_module2.default); - - History.DEFAULTS = { - delay: 1000, - maxStack: 100, - userOnly: false - }; - - function endsWithNewlineChange(delta) { - var lastOp = delta.ops[delta.ops.length - 1]; - if (lastOp == null) return false; - if (lastOp.insert != null) { - return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); - } - if (lastOp.attributes != null) { - return Object.keys(lastOp.attributes).some(function (attr) { - return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; - }); - } - return false; - } + if (!this._events[evt]) return false; - function getLastChangeIndex(delta) { - var deleteLength = delta.reduce(function (length, op) { - length += op.delete || 0; - return length; - }, 0); - var changeIndex = delta.length() - deleteLength; - if (endsWithNewlineChange(delta)) { - changeIndex -= 1; - } - return changeIndex; - } + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + 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++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (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 true; +}; + +/** + * Add a listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Add a one-time listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Remove the listeners of a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {Mixed} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; - exports.default = History; - exports.getLastChangeIndex = getLastChangeIndex; + if (!this._events[evt]) return this; + if (!fn) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn + && (!once || listeners.once) + && (!context || listeners.context === context) + ) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {String|Symbol} [event] The event name. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; -/***/ }, -/* 56 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _clone = __webpack_require__(39); - - var _clone2 = _interopRequireDefault(_clone); - - var _deepEqual = __webpack_require__(40); - - var _deepEqual2 = _interopRequireDefault(_deepEqual); - - var _extend = __webpack_require__(30); - - var _extend2 = _interopRequireDefault(_extend); - - var _op = __webpack_require__(26); - - var _op2 = _interopRequireDefault(_op); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _quill = __webpack_require__(18); - - var _quill2 = _interopRequireDefault(_quill); - - var _logger = __webpack_require__(38); - - var _logger2 = _interopRequireDefault(_logger); - - var _module = __webpack_require__(43); - - var _module2 = _interopRequireDefault(_module); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var debug = (0, _logger2.default)('quill:keyboard'); - - var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; - - var Keyboard = function (_Module) { - _inherits(Keyboard, _Module); - - _createClass(Keyboard, null, [{ - key: 'match', - value: function match(evt, binding) { - binding = normalize(binding); - if (!!binding.shortKey !== evt[SHORTKEY] && binding.shortKey !== null) return false; - if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { - return key != SHORTKEY && !!binding[key] !== evt[key] && binding[key] !== null; - })) { - return false; - } - return binding.key === (evt.which || evt.keyCode); - } - }]); - - function Keyboard(quill, options) { - _classCallCheck(this, Keyboard); - - var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); - - _this.bindings = {}; - Object.keys(_this.options.bindings).forEach(function (name) { - if (_this.options.bindings[name]) { - _this.addBinding(_this.options.bindings[name]); - } - }); - _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); - _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); - _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); - _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^$/ }, handleDelete); - _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); - _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); - if (/Trident/i.test(navigator.userAgent)) { - _this.addBinding({ key: Keyboard.keys.BACKSPACE, shortKey: true }, handleBackspace); - _this.addBinding({ key: Keyboard.keys.DELETE, shortKey: true }, handleDelete); - } - _this.listen(); - return _this; - } - - _createClass(Keyboard, [{ - key: 'addBinding', - value: function addBinding(key) { - var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - var binding = normalize(key); - if (binding == null || binding.key == null) { - return debug.warn('Attempted to add invalid keyboard binding', binding); - } - if (typeof context === 'function') { - context = { handler: context }; - } - if (typeof handler === 'function') { - handler = { handler: handler }; - } - binding = (0, _extend2.default)(binding, context, handler); - this.bindings[binding.key] = this.bindings[binding.key] || []; - this.bindings[binding.key].push(binding); - } - }, { - key: 'listen', - value: function listen() { - var _this2 = this; - - this.quill.root.addEventListener('keydown', function (evt) { - if (evt.defaultPrevented) return; - var which = evt.which || evt.keyCode; - var bindings = (_this2.bindings[which] || []).filter(function (binding) { - return Keyboard.match(evt, binding); - }); - if (bindings.length === 0) return; - var range = _this2.quill.getSelection(); - if (range == null || !_this2.quill.hasFocus()) return; - - var _quill$scroll$line = _this2.quill.scroll.line(range.index), - _quill$scroll$line2 = _slicedToArray(_quill$scroll$line, 2), - line = _quill$scroll$line2[0], - offset = _quill$scroll$line2[1]; - - var _quill$scroll$leaf = _this2.quill.scroll.leaf(range.index), - _quill$scroll$leaf2 = _slicedToArray(_quill$scroll$leaf, 2), - leafStart = _quill$scroll$leaf2[0], - offsetStart = _quill$scroll$leaf2[1]; - - var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.scroll.leaf(range.index + range.length), - _ref2 = _slicedToArray(_ref, 2), - leafEnd = _ref2[0], - offsetEnd = _ref2[1]; - - var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; - var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; - var curContext = { - collapsed: range.length === 0, - empty: range.length === 0 && line.length() <= 1, - format: _this2.quill.getFormat(range), - offset: offset, - prefix: prefixText, - suffix: suffixText - }; - var prevented = bindings.some(function (binding) { - if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; - if (binding.empty != null && binding.empty !== curContext.empty) return false; - if (binding.offset != null && binding.offset !== curContext.offset) return false; - if (Array.isArray(binding.format)) { - // any format is present - if (binding.format.every(function (name) { - return curContext.format[name] == null; - })) { - return false; - } - } else if (_typeof(binding.format) === 'object') { - // all formats must match - if (!Object.keys(binding.format).every(function (name) { - if (binding.format[name] === true) return curContext.format[name] != null; - if (binding.format[name] === false) return curContext.format[name] == null; - return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); - })) { - return false; - } - } - if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; - if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; - return binding.handler.call(_this2, range, curContext) !== true; - }); - if (prevented) { - evt.preventDefault(); - } - }); - } - }]); - - return Keyboard; - }(_module2.default); - - Keyboard.keys = { - BACKSPACE: 8, - TAB: 9, - ENTER: 13, - ESCAPE: 27, - LEFT: 37, - UP: 38, - RIGHT: 39, - DOWN: 40, - DELETE: 46 - }; - - Keyboard.DEFAULTS = { - bindings: { - 'bold': makeFormatHandler('bold'), - 'italic': makeFormatHandler('italic'), - 'underline': makeFormatHandler('underline'), - 'indent': { - // highlight tab or tab at beginning of list, indent or blockquote - key: Keyboard.keys.TAB, - format: ['blockquote', 'indent', 'list'], - handler: function handler(range, context) { - if (context.collapsed && context.offset !== 0) return true; - this.quill.format('indent', '+1', _quill2.default.sources.USER); - } - }, - 'outdent': { - key: Keyboard.keys.TAB, - shiftKey: true, - format: ['blockquote', 'indent', 'list'], - // highlight tab or tab at beginning of list, indent or blockquote - handler: function handler(range, context) { - if (context.collapsed && context.offset !== 0) return true; - this.quill.format('indent', '-1', _quill2.default.sources.USER); - } - }, - 'outdent backspace': { - key: Keyboard.keys.BACKSPACE, - collapsed: true, - format: ['blockquote', 'indent', 'list'], - offset: 0, - handler: function handler(range, context) { - if (context.format.indent != null) { - this.quill.format('indent', '-1', _quill2.default.sources.USER); - } else if (context.format.blockquote != null) { - this.quill.format('blockquote', false, _quill2.default.sources.USER); - } else if (context.format.list != null) { - this.quill.format('list', false, _quill2.default.sources.USER); - } - } - }, - 'indent code-block': makeCodeBlockHandler(true), - 'outdent code-block': makeCodeBlockHandler(false), - 'remove tab': { - key: Keyboard.keys.TAB, - shiftKey: true, - collapsed: true, - prefix: /\t$/, - handler: function handler(range) { - this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); - } - }, - 'tab': { - key: Keyboard.keys.TAB, - handler: function handler(range, context) { - if (!context.collapsed) { - this.quill.scroll.deleteAt(range.index, range.length); - } - this.quill.insertText(range.index, '\t', _quill2.default.sources.USER); - this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); - } - }, - 'list empty enter': { - key: Keyboard.keys.ENTER, - collapsed: true, - format: ['list'], - empty: true, - handler: function handler(range, context) { - this.quill.format('list', false, _quill2.default.sources.USER); - if (context.format.indent) { - this.quill.format('indent', false, _quill2.default.sources.USER); - } - } - }, - 'header enter': { - key: Keyboard.keys.ENTER, - collapsed: true, - format: ['header'], - suffix: /^$/, - handler: function handler(range) { - this.quill.scroll.insertAt(range.index, '\n'); - this.quill.formatText(range.index + 1, 1, 'header', false, _quill2.default.sources.USER); - this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); - this.quill.selection.scrollIntoView(); - } - }, - 'list autofill': { - key: ' ', - collapsed: true, - format: { list: false }, - prefix: /^(1\.|-)$/, - handler: function handler(range, context) { - var length = context.prefix.length; - this.quill.scroll.deleteAt(range.index - length, length); - this.quill.formatLine(range.index - length, 1, 'list', length === 1 ? 'bullet' : 'ordered', _quill2.default.sources.USER); - this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); - } - } - } - }; - - function handleBackspace(range, context) { - if (range.index === 0) return; - - var _quill$scroll$line3 = this.quill.scroll.line(range.index), - _quill$scroll$line4 = _slicedToArray(_quill$scroll$line3, 1), - line = _quill$scroll$line4[0]; - - var formats = {}; - if (context.offset === 0) { - var curFormats = line.formats(); - var prevFormats = this.quill.getFormat(range.index - 1, 1); - formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; - } - this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); - if (Object.keys(formats).length > 0) { - this.quill.formatLine(range.index - 1, 1, formats, _quill2.default.sources.USER); - } - this.quill.selection.scrollIntoView(); - } + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// This function doesn't apply anymore. +// +EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; +}; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} - function handleDelete(range) { - if (range.index >= this.quill.getLength() - 1) return; - this.quill.deleteText(range.index, 1, _quill2.default.sources.USER); - } - function handleDeleteRange(range) { - this.quill.deleteText(range, _quill2.default.sources.USER); - this.quill.setSelection(range.index, _quill2.default.sources.SILENT); - this.quill.selection.scrollIntoView(); - } +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { - function handleEnter(range, context) { - var _this3 = this; +"use strict"; - if (range.length > 0) { - this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change - } - var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { - if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { - lineFormats[format] = context.format[format]; - } - return lineFormats; - }, {}); - this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); - this.quill.selection.scrollIntoView(); - Object.keys(context.format).forEach(function (name) { - if (lineFormats[name] != null) return; - if (Array.isArray(context.format[name])) return; - if (name === 'link') return; - _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); - }); - } - function makeCodeBlockHandler(indent) { - return { - key: Keyboard.keys.TAB, - shiftKey: !indent, - format: { 'code-block': true }, - handler: function handler(range) { - var CodeBlock = _parchment2.default.query('code-block'); - var index = range.index, - length = range.length; - - var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), - _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), - block = _quill$scroll$descend2[0], - offset = _quill$scroll$descend2[1]; - - if (block == null) return; - var scrollOffset = this.quill.scroll.offset(block); - var start = block.newlineIndex(offset, true) + 1; - var end = block.newlineIndex(scrollOffset + offset + length); - var lines = block.domNode.textContent.slice(start, end).split('\n'); - offset = 0; - lines.forEach(function (line, i) { - if (indent) { - block.insertAt(start + offset, CodeBlock.TAB); - offset += CodeBlock.TAB.length; - if (i === 0) { - index += CodeBlock.TAB.length; - } else { - length += CodeBlock.TAB.length; - } - } else if (line.startsWith(CodeBlock.TAB)) { - block.deleteAt(start + offset, CodeBlock.TAB.length); - offset -= CodeBlock.TAB.length; - if (i === 0) { - index -= CodeBlock.TAB.length; - } else { - length -= CodeBlock.TAB.length; - } - } - offset += line.length + 1; - }); - this.quill.update(_quill2.default.sources.USER); - this.quill.setSelection(index, length, _quill2.default.sources.SILENT); - } - }; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; - function makeFormatHandler(format) { - return { - key: format[0].toUpperCase(), - shortKey: true, - handler: function handler(range, context) { - this.quill.format(format, !context.format[format], _quill2.default.sources.USER); - } - }; - } +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - function normalize(binding) { - if (typeof binding === 'string' || typeof binding === 'number') { - return normalize({ key: binding }); - } - if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { - binding = (0, _clone2.default)(binding, false); - } - if (typeof binding.key === 'string') { - if (Keyboard.keys[binding.key.toUpperCase()] != null) { - binding.key = Keyboard.keys[binding.key.toUpperCase()]; - } else if (binding.key.length === 1) { - binding.key = binding.key.toUpperCase().charCodeAt(0); - } else { - return null; - } - } - return binding; - } +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - exports.default = Keyboard; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -/***/ } -/******/ ]) -}); -; \ No newline at end of file +var _extend2 = __webpack_require__(3); + +var _extend3 = _interopRequireDefault(_extend2); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _align = __webpack_require__(36); + +var _background = __webpack_require__(37); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _color = __webpack_require__(26); + +var _direction = __webpack_require__(38); + +var _font = __webpack_require__(39); + +var _size = __webpack_require__(40); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:clipboard'); + +var DOM_KEY = '__ql-matcher'; + +var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; + +var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var Clipboard = function (_Module) { + _inherits(Clipboard, _Module); + + function Clipboard(quill, options) { + _classCallCheck(this, Clipboard); + + var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); + + _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); + _this.container = _this.quill.addContainer('ql-clipboard'); + _this.container.setAttribute('contenteditable', true); + _this.container.setAttribute('tabindex', -1); + _this.matchers = []; + CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + selector = _ref2[0], + matcher = _ref2[1]; + + if (!options.matchVisual && matcher === matchSpacing) return; + _this.addMatcher(selector, matcher); + }); + return _this; + } + + _createClass(Clipboard, [{ + key: 'addMatcher', + value: function addMatcher(selector, matcher) { + this.matchers.push([selector, matcher]); + } + }, { + key: 'convert', + value: function convert(html) { + if (typeof html === 'string') { + this.container.innerHTML = html.replace(/\>\r?\n +\<'); // Remove spaces between tags + return this.convert(); + } + var formats = this.quill.getFormat(this.quill.selection.savedRange.index); + if (formats[_code2.default.blotName]) { + var text = this.container.innerText; + this.container.innerHTML = ''; + return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName])); + } + + var _prepareMatching = this.prepareMatching(), + _prepareMatching2 = _slicedToArray(_prepareMatching, 2), + elementMatchers = _prepareMatching2[0], + textMatchers = _prepareMatching2[1]; + + var delta = traverse(this.container, elementMatchers, textMatchers); + // Remove trailing newline + if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); + } + debug.log('convert', this.container.innerHTML, delta); + this.container.innerHTML = ''; + return delta; + } + }, { + key: 'dangerouslyPasteHTML', + value: function dangerouslyPasteHTML(index, html) { + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; + + if (typeof index === 'string') { + this.quill.setContents(this.convert(index), html); + this.quill.setSelection(0, _quill2.default.sources.SILENT); + } else { + var paste = this.convert(html); + this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); + this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT); + } + } + }, { + key: 'onPaste', + value: function onPaste(e) { + var _this2 = this; + + if (e.defaultPrevented || !this.quill.isEnabled()) return; + var range = this.quill.getSelection(); + var delta = new _quillDelta2.default().retain(range.index); + var scrollTop = this.quill.scrollingContainer.scrollTop; + this.container.focus(); + this.quill.selection.update(_quill2.default.sources.SILENT); + setTimeout(function () { + delta = delta.concat(_this2.convert()).delete(range.length); + _this2.quill.updateContents(delta, _quill2.default.sources.USER); + // range.length contributes to delta.length() + _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); + _this2.quill.scrollingContainer.scrollTop = scrollTop; + _this2.quill.focus(); + }, 1); + } + }, { + key: 'prepareMatching', + value: function prepareMatching() { + var _this3 = this; + + var elementMatchers = [], + textMatchers = []; + this.matchers.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + selector = _pair[0], + matcher = _pair[1]; + + switch (selector) { + case Node.TEXT_NODE: + textMatchers.push(matcher); + break; + case Node.ELEMENT_NODE: + elementMatchers.push(matcher); + break; + default: + [].forEach.call(_this3.container.querySelectorAll(selector), function (node) { + // TODO use weakmap + node[DOM_KEY] = node[DOM_KEY] || []; + node[DOM_KEY].push(matcher); + }); + break; + } + }); + return [elementMatchers, textMatchers]; + } + }]); + + return Clipboard; +}(_module2.default); + +Clipboard.DEFAULTS = { + matchers: [], + matchVisual: true +}; + +function applyFormat(delta, format, value) { + if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') { + return Object.keys(format).reduce(function (delta, key) { + return applyFormat(delta, key, format[key]); + }, delta); + } else { + return delta.reduce(function (delta, op) { + if (op.attributes && op.attributes[format]) { + return delta.push(op); + } else { + return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes)); + } + }, new _quillDelta2.default()); + } +} + +function computeStyle(node) { + if (node.nodeType !== Node.ELEMENT_NODE) return {}; + var DOM_KEY = '__ql-computed-style'; + return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); +} + +function deltaEndsWith(delta, text) { + var endText = ""; + for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { + var op = delta.ops[i]; + if (typeof op.insert !== 'string') break; + endText = op.insert + endText; + } + return endText.slice(-1 * text.length) === text; +} + +function isLine(node) { + if (node.childNodes.length === 0) return false; // Exclude embed blocks + var style = computeStyle(node); + return ['block', 'list-item'].indexOf(style.display) > -1; +} + +function traverse(node, elementMatchers, textMatchers) { + // Post-order + if (node.nodeType === node.TEXT_NODE) { + return textMatchers.reduce(function (delta, matcher) { + return matcher(node, delta); + }, new _quillDelta2.default()); + } else if (node.nodeType === node.ELEMENT_NODE) { + return [].reduce.call(node.childNodes || [], function (delta, childNode) { + var childrenDelta = traverse(childNode, elementMatchers, textMatchers); + if (childNode.nodeType === node.ELEMENT_NODE) { + childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + } + return delta.concat(childrenDelta); + }, new _quillDelta2.default()); + } else { + return new _quillDelta2.default(); + } +} + +function matchAlias(format, node, delta) { + return applyFormat(delta, format, true); +} + +function matchAttributor(node, delta) { + var attributes = _parchment2.default.Attributor.Attribute.keys(node); + var classes = _parchment2.default.Attributor.Class.keys(node); + var styles = _parchment2.default.Attributor.Style.keys(node); + var formats = {}; + attributes.concat(classes).concat(styles).forEach(function (name) { + var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); + if (attr != null) { + formats[attr.attrName] = attr.value(node); + if (formats[attr.attrName]) return; + } + attr = ATTRIBUTE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + formats[attr.attrName] = attr.value(node) || undefined; + } + attr = STYLE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + attr = STYLE_ATTRIBUTORS[name]; + formats[attr.attrName] = attr.value(node) || undefined; + } + }); + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + return delta; +} + +function matchBlot(node, delta) { + var match = _parchment2.default.query(node); + if (match == null) return delta; + if (match.prototype instanceof _parchment2.default.Embed) { + var embed = {}; + var value = match.value(node); + if (value != null) { + embed[match.blotName] = value; + delta = new _quillDelta2.default().insert(embed, match.formats(node)); + } + } else if (typeof match.formats === 'function') { + delta = applyFormat(delta, match.blotName, match.formats(node)); + } + return delta; +} + +function matchBreak(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + delta.insert('\n'); + } + return delta; +} + +function matchIgnore() { + return new _quillDelta2.default(); +} + +function matchIndent(node, delta) { + var match = _parchment2.default.query(node); + if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\n')) { + return delta; + } + var indent = -1, + parent = node.parentNode; + while (!parent.classList.contains('ql-clipboard')) { + if ((_parchment2.default.query(parent) || {}).blotName === 'list') { + indent += 1; + } + parent = parent.parentNode; + } + if (indent <= 0) return delta; + return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent })); +} + +function matchNewline(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) { + delta.insert('\n'); + } + } + return delta; +} + +function matchSpacing(node, delta) { + if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { + var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); + if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { + delta.insert('\n'); + } + } + return delta; +} + +function matchStyles(node, delta) { + var formats = {}; + var style = node.style || {}; + if (style.fontStyle && computeStyle(node).fontStyle === 'italic') { + formats.italic = true; + } + if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) { + formats.bold = true; + } + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + if (parseFloat(style.textIndent || 0) > 0) { + // Could be 0.5in + delta = new _quillDelta2.default().insert('\t').concat(delta); + } + return delta; +} + +function matchText(node, delta) { + var text = node.data; + // Word represents empty line with   + if (node.parentNode.tagName === 'O:P') { + return delta.insert(text.trim()); + } + if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) { + return delta; + } + if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { + // eslint-disable-next-line func-style + var replacer = function replacer(collapse, match) { + match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; + return match.length < 1 && collapse ? ' ' : match; + }; + text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); + text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace + if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { + text = text.replace(/^\s+/, replacer.bind(replacer, false)); + } + if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { + text = text.replace(/\s+$/, replacer.bind(replacer, false)); + } + } + return delta.insert(text); +} + +exports.default = Clipboard; +exports.matchAttributor = matchAttributor; +exports.matchBlot = matchBlot; +exports.matchNewline = matchNewline; +exports.matchSpacing = matchSpacing; +exports.matchText = matchText; + +/***/ }), +/* 56 */, +/* 57 */, +/* 58 */, +/* 59 */, +/* 60 */, +/* 61 */, +/* 62 */, +/* 63 */, +/* 64 */, +/* 65 */, +/* 66 */, +/* 67 */, +/* 68 */, +/* 69 */, +/* 70 */, +/* 71 */, +/* 72 */, +/* 73 */, +/* 74 */, +/* 75 */, +/* 76 */, +/* 77 */, +/* 78 */, +/* 79 */, +/* 80 */, +/* 81 */, +/* 82 */, +/* 83 */, +/* 84 */, +/* 85 */, +/* 86 */, +/* 87 */, +/* 88 */, +/* 89 */, +/* 90 */, +/* 91 */, +/* 92 */, +/* 93 */, +/* 94 */, +/* 95 */, +/* 96 */, +/* 97 */, +/* 98 */, +/* 99 */, +/* 100 */, +/* 101 */, +/* 102 */, +/* 103 */, +/* 104 */, +/* 105 */, +/* 106 */, +/* 107 */, +/* 108 */, +/* 109 */, +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(29); + + +/***/ }) +/******/ ])["default"]; +}); \ No newline at end of file diff -Nru bibledit-5.0.912/quill/quill.js bibledit-5.0.922/quill/quill.js --- bibledit-5.0.912/quill/quill.js 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/quill/quill.js 2018-03-12 06:39:22.000000000 +0000 @@ -1,36 +1,8 @@ /*! - * Quill Editor v1.1.5 + * Quill Editor v1.3.6 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') @@ -41,10701 +13,11477 @@ exports["Quill"] = factory(); else root["Quill"] = factory(); -})(this, function() { +})(typeof self !== 'undefined' ? self : this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; - +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { - +/******/ /******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) +/******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; - +/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} /******/ }; - +/******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - +/******/ /******/ // Flag the module as loaded -/******/ module.loaded = true; - +/******/ module.l = true; +/******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } - - +/******/ +/******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; - +/******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; - +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; - +/******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(0); +/******/ return __webpack_require__(__webpack_require__.s = 109); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; - module.exports = __webpack_require__(57); +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var format_1 = __webpack_require__(18); +var leaf_1 = __webpack_require__(19); +var scroll_1 = __webpack_require__(45); +var inline_1 = __webpack_require__(46); +var block_1 = __webpack_require__(47); +var embed_1 = __webpack_require__(48); +var text_1 = __webpack_require__(49); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(32); +var style_1 = __webpack_require__(33); +var store_1 = __webpack_require__(31); +var Registry = __webpack_require__(1); +var Parchment = { + Scope: Registry.Scope, + create: Registry.create, + find: Registry.find, + query: Registry.query, + register: Registry.register, + Container: container_1.default, + Format: format_1.default, + Leaf: leaf_1.default, + Embed: embed_1.default, + Scroll: scroll_1.default, + Block: block_1.default, + Inline: inline_1.default, + Text: text_1.default, + Attributor: { + Attribute: attributor_1.default, + Class: class_1.default, + Style: style_1.default, + Store: store_1.default, + }, +}; +exports.default = Parchment; -/***/ }, +/***/ }), /* 1 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - var _parchment = __webpack_require__(2); +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var ParchmentError = /** @class */ (function (_super) { + __extends(ParchmentError, _super); + function ParchmentError(message) { + var _this = this; + message = '[Parchment] ' + message; + _this = _super.call(this, message) || this; + _this.message = message; + _this.name = _this.constructor.name; + return _this; + } + return ParchmentError; +}(Error)); +exports.ParchmentError = ParchmentError; +var attributes = {}; +var classes = {}; +var tags = {}; +var types = {}; +exports.DATA_KEY = '__blot'; +var Scope; +(function (Scope) { + Scope[Scope["TYPE"] = 3] = "TYPE"; + Scope[Scope["LEVEL"] = 12] = "LEVEL"; + Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; + Scope[Scope["BLOT"] = 14] = "BLOT"; + Scope[Scope["INLINE"] = 7] = "INLINE"; + Scope[Scope["BLOCK"] = 11] = "BLOCK"; + Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; + Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; + Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; + Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; + Scope[Scope["ANY"] = 15] = "ANY"; +})(Scope = exports.Scope || (exports.Scope = {})); +function create(input, value) { + var match = query(input); + if (match == null) { + throw new ParchmentError("Unable to create " + input + " blot"); + } + var BlotClass = match; + var node = + // @ts-ignore + input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value); + return new BlotClass(node, value); +} +exports.create = create; +function find(node, bubble) { + if (bubble === void 0) { bubble = false; } + if (node == null) + return null; + // @ts-ignore + if (node[exports.DATA_KEY] != null) + return node[exports.DATA_KEY].blot; + if (bubble) + return find(node.parentNode, bubble); + return null; +} +exports.find = find; +function query(query, scope) { + if (scope === void 0) { scope = Scope.ANY; } + var match; + if (typeof query === 'string') { + match = types[query] || attributes[query]; + // @ts-ignore + } + else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) { + match = types['text']; + } + else if (typeof query === 'number') { + if (query & Scope.LEVEL & Scope.BLOCK) { + match = types['block']; + } + else if (query & Scope.LEVEL & Scope.INLINE) { + match = types['inline']; + } + } + else if (query instanceof HTMLElement) { + var names = (query.getAttribute('class') || '').split(/\s+/); + for (var i in names) { + match = classes[names[i]]; + if (match) + break; + } + match = match || tags[query.tagName]; + } + if (match == null) + return null; + // @ts-ignore + if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) + return match; + return null; +} +exports.query = query; +function register() { + var Definitions = []; + for (var _i = 0; _i < arguments.length; _i++) { + Definitions[_i] = arguments[_i]; + } + if (Definitions.length > 1) { + return Definitions.map(function (d) { + return register(d); + }); + } + var Definition = Definitions[0]; + if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { + throw new ParchmentError('Invalid definition'); + } + else if (Definition.blotName === 'abstract') { + throw new ParchmentError('Cannot register abstract class'); + } + types[Definition.blotName || Definition.attrName] = Definition; + if (typeof Definition.keyName === 'string') { + attributes[Definition.keyName] = Definition; + } + else { + if (Definition.className != null) { + classes[Definition.className] = Definition; + } + if (Definition.tagName != null) { + if (Array.isArray(Definition.tagName)) { + Definition.tagName = Definition.tagName.map(function (tagName) { + return tagName.toUpperCase(); + }); + } + else { + Definition.tagName = Definition.tagName.toUpperCase(); + } + var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; + tagNames.forEach(function (tag) { + if (tags[tag] == null || Definition.className == null) { + tags[tag] = Definition; + } + }); + } + } + return Definition; +} +exports.register = register; - var _parchment2 = _interopRequireDefault(_parchment); - var _quill = __webpack_require__(18); +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { - var _quill2 = _interopRequireDefault(_quill); +var diff = __webpack_require__(51); +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); +var op = __webpack_require__(20); + + +var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() + + +var Delta = function (ops) { + // Assume we are given a well formed ops + if (Array.isArray(ops)) { + this.ops = ops; + } else if (ops != null && Array.isArray(ops.ops)) { + this.ops = ops.ops; + } else { + this.ops = []; + } +}; + + +Delta.prototype.insert = function (text, attributes) { + var newOp = {}; + if (text.length === 0) return this; + newOp.insert = text; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype['delete'] = function (length) { + if (length <= 0) return this; + return this.push({ 'delete': length }); +}; + +Delta.prototype.retain = function (length, attributes) { + if (length <= 0) return this; + var newOp = { retain: length }; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype.push = function (newOp) { + var index = this.ops.length; + var lastOp = this.ops[index - 1]; + newOp = extend(true, {}, newOp); + if (typeof lastOp === 'object') { + if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { + this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; + return this; + } + // Since it does not matter if we insert before or after deleting at the same index, + // always prefer to insert first + if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { + index -= 1; + lastOp = this.ops[index - 1]; + if (typeof lastOp !== 'object') { + this.ops.unshift(newOp); + return this; + } + } + if (equal(newOp.attributes, lastOp.attributes)) { + if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { + this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { + this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } + } + } + if (index === this.ops.length) { + this.ops.push(newOp); + } else { + this.ops.splice(index, 0, newOp); + } + return this; +}; + +Delta.prototype.chop = function () { + var lastOp = this.ops[this.ops.length - 1]; + if (lastOp && lastOp.retain && !lastOp.attributes) { + this.ops.pop(); + } + return this; +}; + +Delta.prototype.filter = function (predicate) { + return this.ops.filter(predicate); +}; + +Delta.prototype.forEach = function (predicate) { + this.ops.forEach(predicate); +}; + +Delta.prototype.map = function (predicate) { + return this.ops.map(predicate); +}; + +Delta.prototype.partition = function (predicate) { + var passed = [], failed = []; + this.forEach(function(op) { + var target = predicate(op) ? passed : failed; + target.push(op); + }); + return [passed, failed]; +}; + +Delta.prototype.reduce = function (predicate, initial) { + return this.ops.reduce(predicate, initial); +}; + +Delta.prototype.changeLength = function () { + return this.reduce(function (length, elem) { + if (elem.insert) { + return length + op.length(elem); + } else if (elem.delete) { + return length - elem.delete; + } + return length; + }, 0); +}; + +Delta.prototype.length = function () { + return this.reduce(function (length, elem) { + return length + op.length(elem); + }, 0); +}; + +Delta.prototype.slice = function (start, end) { + start = start || 0; + if (typeof end !== 'number') end = Infinity; + var ops = []; + var iter = op.iterator(this.ops); + var index = 0; + while (index < end && iter.hasNext()) { + var nextOp; + if (index < start) { + nextOp = iter.next(start - index); + } else { + nextOp = iter.next(end - index); + ops.push(nextOp); + } + index += op.length(nextOp); + } + return new Delta(ops); +}; + + +Delta.prototype.compose = function (other) { + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else if (thisIter.peekType() === 'delete') { + delta.push(thisIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (typeof otherOp.retain === 'number') { + var newOp = {}; + if (typeof thisOp.retain === 'number') { + newOp.retain = length; + } else { + newOp.insert = thisOp.insert; + } + // Preserve null when composing with a retain, otherwise remove it for inserts + var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); + if (attributes) newOp.attributes = attributes; + delta.push(newOp); + // Other op should be delete, we could be an insert or retain + // Insert + delete cancels out + } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { + delta.push(otherOp); + } + } + } + return delta.chop(); +}; + +Delta.prototype.concat = function (other) { + var delta = new Delta(this.ops.slice()); + if (other.ops.length > 0) { + delta.push(other.ops[0]); + delta.ops = delta.ops.concat(other.ops.slice(1)); + } + return delta; +}; + +Delta.prototype.diff = function (other, index) { + if (this.ops === other.ops) { + return new Delta(); + } + var strings = [this, other].map(function (delta) { + return delta.map(function (op) { + if (op.insert != null) { + return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; + } + var prep = (delta === other) ? 'on' : 'with'; + throw new Error('diff() called ' + prep + ' non-document'); + }).join(''); + }); + var delta = new Delta(); + var diffResult = diff(strings[0], strings[1], index); + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + diffResult.forEach(function (component) { + var length = component[1].length; + while (length > 0) { + var opLength = 0; + switch (component[0]) { + case diff.INSERT: + opLength = Math.min(otherIter.peekLength(), length); + delta.push(otherIter.next(opLength)); + break; + case diff.DELETE: + opLength = Math.min(length, thisIter.peekLength()); + thisIter.next(opLength); + delta['delete'](opLength); + break; + case diff.EQUAL: + opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); + var thisOp = thisIter.next(opLength); + var otherOp = otherIter.next(opLength); + if (equal(thisOp.insert, otherOp.insert)) { + delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); + } else { + delta.push(otherOp)['delete'](opLength); + } + break; + } + length -= opLength; + } + }); + return delta.chop(); +}; + +Delta.prototype.eachLine = function (predicate, newline) { + newline = newline || '\n'; + var iter = op.iterator(this.ops); + var line = new Delta(); + var i = 0; + while (iter.hasNext()) { + if (iter.peekType() !== 'insert') return; + var thisOp = iter.peek(); + var start = op.length(thisOp) - iter.peekLength(); + var 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) === false) { + return; + } + i += 1; + line = new Delta(); + } + } + if (line.length() > 0) { + predicate(line, {}, i); + } +}; + +Delta.prototype.transform = function (other, priority) { + priority = !!priority; + if (typeof other === 'number') { + return this.transformPosition(other, priority); + } + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { + delta.retain(op.length(thisIter.next())); + } else if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (thisOp['delete']) { + // Our delete either makes their delete redundant or removes their retain + continue; + } else if (otherOp['delete']) { + delta.push(otherOp); + } else { + // We retain either their retain or insert + delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); + } + } + } + return delta.chop(); +}; + +Delta.prototype.transformPosition = function (index, priority) { + priority = !!priority; + var thisIter = op.iterator(this.ops); + var offset = 0; + while (thisIter.hasNext() && offset <= index) { + var length = thisIter.peekLength(); + var nextType = thisIter.peekType(); + thisIter.next(); + if (nextType === 'delete') { + index -= Math.min(length, index - offset); + continue; + } else if (nextType === 'insert' && (offset < index || !priority)) { + index += length; + } + offset += length; + } + return index; +}; - var _block = __webpack_require__(29); - var _block2 = _interopRequireDefault(_block); +module.exports = Delta; - var _break = __webpack_require__(31); - var _break2 = _interopRequireDefault(_break); +/***/ }), +/* 3 */ +/***/ (function(module, exports) { - var _container = __webpack_require__(46); +'use strict'; - var _container2 = _interopRequireDefault(_container); +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; - var _cursor = __webpack_require__(35); +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } - var _cursor2 = _interopRequireDefault(_cursor); + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); - var _embed = __webpack_require__(32); + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } - var _embed2 = _interopRequireDefault(_embed); + // Return the modified object + return target; +}; - var _inline = __webpack_require__(33); - var _inline2 = _interopRequireDefault(_inline); +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { - var _scroll = __webpack_require__(47); +"use strict"; - var _scroll2 = _interopRequireDefault(_scroll); - var _text = __webpack_require__(34); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; - var _text2 = _interopRequireDefault(_text); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var _clipboard = __webpack_require__(48); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - var _clipboard2 = _interopRequireDefault(_clipboard); +var _extend = __webpack_require__(3); - var _history = __webpack_require__(55); +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var NEWLINE_LENGTH = 1; + +var BlockEmbed = function (_Parchment$Embed) { + _inherits(BlockEmbed, _Parchment$Embed); + + function BlockEmbed() { + _classCallCheck(this, BlockEmbed); + + return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); + } + + _createClass(BlockEmbed, [{ + key: 'attach', + value: function attach() { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); + this.attributes = new _parchment2.default.Attributor.Store(this.domNode); + } + }, { + key: 'delta', + value: function delta() { + return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); + } + }, { + key: 'format', + value: function format(name, value) { + var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); + if (attribute != null) { + this.attributes.attribute(attribute, value); + } + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + this.format(name, value); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (typeof value === 'string' && value.endsWith('\n')) { + var block = _parchment2.default.create(Block.blotName); + this.parent.insertBefore(block, index === 0 ? this : this.next); + block.insertAt(0, value.slice(0, -1)); + } else { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); + } + } + }]); + + return BlockEmbed; +}(_parchment2.default.Embed); + +BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; +// It is important for cursor behavior BlockEmbeds use tags that are block level elements + + +var Block = function (_Parchment$Block) { + _inherits(Block, _Parchment$Block); + + function Block(domNode) { + _classCallCheck(this, Block); + + var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); + + _this2.cache = {}; + return _this2; + } + + _createClass(Block, [{ + key: 'delta', + value: function delta() { + if (this.cache.delta == null) { + this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { + if (leaf.length() === 0) { + return delta; + } else { + return delta.insert(leaf.value(), bubbleFormats(leaf)); + } + }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); + } + return this.cache.delta; + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); + this.cache = {}; + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length <= 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + if (index + length === this.length()) { + this.format(name, value); + } + } else { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); + } + this.cache = {}; + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); + if (value.length === 0) return; + var lines = value.split('\n'); + var text = lines.shift(); + if (text.length > 0) { + if (index < this.length() - 1 || this.children.tail == null) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); + } else { + this.children.tail.insertAt(this.children.tail.length(), text); + } + this.cache = {}; + } + var block = this; + lines.reduce(function (index, line) { + block = block.split(index, true); + block.insertAt(0, line); + return line.length; + }, index + text.length); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + var head = this.children.head; + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); + if (head instanceof _break2.default) { + head.remove(); + } + this.cache = {}; + } + }, { + key: 'length', + value: function length() { + if (this.cache.length == null) { + this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; + } + return this.cache.length; + } + }, { + key: 'moveChildren', + value: function moveChildren(target, ref) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); + this.cache = {}; + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context); + this.cache = {}; + } + }, { + key: 'path', + value: function path(index) { + return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); + } + }, { + key: 'removeChild', + value: function removeChild(child) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); + this.cache = {}; + } + }, { + key: 'split', + value: function split(index) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { + var clone = this.clone(); + if (index === 0) { + this.parent.insertBefore(clone, this); + return this; + } else { + this.parent.insertBefore(clone, this.next); + return clone; + } + } else { + var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); + this.cache = {}; + return next; + } + } + }]); + + return Block; +}(_parchment2.default.Block); + +Block.blotName = 'block'; +Block.tagName = 'P'; +Block.defaultChild = 'break'; +Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default]; + +function bubbleFormats(blot) { + var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (blot == null) return formats; + if (typeof blot.formats === 'function') { + formats = (0, _extend2.default)(formats, blot.formats()); + } + if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { + return formats; + } + return bubbleFormats(blot.parent, formats); +} + +exports.bubbleFormats = bubbleFormats; +exports.BlockEmbed = BlockEmbed; +exports.default = Block; - var _history2 = _interopRequireDefault(_history); +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { - var _keyboard = __webpack_require__(56); +"use strict"; - var _keyboard2 = _interopRequireDefault(_keyboard); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.overload = exports.expandConfig = undefined; - _quill2.default.register({ - 'blots/block': _block2.default, - 'blots/block/embed': _block.BlockEmbed, - 'blots/break': _break2.default, - 'blots/container': _container2.default, - 'blots/cursor': _cursor2.default, - 'blots/embed': _embed2.default, - 'blots/inline': _inline2.default, - 'blots/scroll': _scroll2.default, - 'blots/text': _text2.default, +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - 'modules/clipboard': _clipboard2.default, - 'modules/history': _history2.default, - 'modules/keyboard': _keyboard2.default - }); +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - _parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - module.exports = _quill2.default; +__webpack_require__(50); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _editor = __webpack_require__(14); + +var _editor2 = _interopRequireDefault(_editor); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _selection = __webpack_require__(15); + +var _selection2 = _interopRequireDefault(_selection); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _theme = __webpack_require__(34); + +var _theme2 = _interopRequireDefault(_theme); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill'); + +var Quill = function () { + _createClass(Quill, null, [{ + key: 'debug', + value: function debug(limit) { + if (limit === true) { + limit = 'log'; + } + _logger2.default.level(limit); + } + }, { + key: 'find', + value: function find(node) { + return node.__quill || _parchment2.default.find(node); + } + }, { + key: 'import', + value: function _import(name) { + if (this.imports[name] == null) { + debug.error('Cannot import ' + name + '. Are you sure it was registered?'); + } + return this.imports[name]; + } + }, { + key: 'register', + value: function register(path, target) { + var _this = this; + + var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (typeof path !== 'string') { + var name = path.attrName || path.blotName; + if (typeof name === 'string') { + // register(Blot | Attributor, overwrite) + this.register('formats/' + name, path, target); + } else { + Object.keys(path).forEach(function (key) { + _this.register(key, path[key], target); + }); + } + } else { + if (this.imports[path] != null && !overwrite) { + debug.warn('Overwriting ' + path + ' with', target); + } + this.imports[path] = target; + if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { + _parchment2.default.register(target); + } else if (path.startsWith('modules') && typeof target.register === 'function') { + target.register(); + } + } + } + }]); + + function Quill(container) { + var _this2 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Quill); + + this.options = expandConfig(container, options); + this.container = this.options.container; + if (this.container == null) { + return debug.error('Invalid Quill container', container); + } + if (this.options.debug) { + Quill.debug(this.options.debug); + } + var html = this.container.innerHTML.trim(); + this.container.classList.add('ql-container'); + this.container.innerHTML = ''; + this.container.__quill = this; + this.root = this.addContainer('ql-editor'); + this.root.classList.add('ql-blank'); + this.root.setAttribute('data-gramm', false); + this.scrollingContainer = this.options.scrollingContainer || this.root; + this.emitter = new _emitter4.default(); + this.scroll = _parchment2.default.create(this.root, { + emitter: this.emitter, + whitelist: this.options.formats + }); + this.editor = new _editor2.default(this.scroll); + this.selection = new _selection2.default(this.scroll, this.emitter); + this.theme = new this.options.theme(this, this.options); + this.keyboard = this.theme.addModule('keyboard'); + this.clipboard = this.theme.addModule('clipboard'); + this.history = this.theme.addModule('history'); + this.theme.init(); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { + if (type === _emitter4.default.events.TEXT_CHANGE) { + _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { + var range = _this2.selection.lastRange; + var index = range && range.length === 0 ? range.index : undefined; + modify.call(_this2, function () { + return _this2.editor.update(null, mutations, index); + }, source); + }); + var contents = this.clipboard.convert('
    ' + html + '


    '); + this.setContents(contents); + this.history.clear(); + if (this.options.placeholder) { + this.root.setAttribute('data-placeholder', this.options.placeholder); + } + if (this.options.readOnly) { + this.disable(); + } + } + + _createClass(Quill, [{ + key: 'addContainer', + value: function addContainer(container) { + var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (typeof container === 'string') { + var className = container; + container = document.createElement('div'); + container.classList.add(className); + } + this.container.insertBefore(container, refNode); + return container; + } + }, { + key: 'blur', + value: function blur() { + this.selection.setRange(null); + } + }, { + key: 'deleteText', + value: function deleteText(index, length, source) { + var _this3 = this; + + var _overload = overload(index, length, source); + + var _overload2 = _slicedToArray(_overload, 4); + + index = _overload2[0]; + length = _overload2[1]; + source = _overload2[3]; + + return modify.call(this, function () { + return _this3.editor.deleteText(index, length); + }, source, index, -1 * length); + } + }, { + key: 'disable', + value: function disable() { + this.enable(false); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.scroll.enable(enabled); + this.container.classList.toggle('ql-disabled', !enabled); + } + }, { + key: 'focus', + value: function focus() { + var scrollTop = this.scrollingContainer.scrollTop; + this.selection.focus(); + this.scrollingContainer.scrollTop = scrollTop; + this.scrollIntoView(); + } + }, { + key: 'format', + value: function format(name, value) { + var _this4 = this; + + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + return modify.call(this, function () { + var range = _this4.getSelection(true); + var change = new _quillDelta2.default(); + if (range == null) { + return change; + } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); + } else if (range.length === 0) { + _this4.selection.format(name, value); + return change; + } else { + change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); + } + _this4.setSelection(range, _emitter4.default.sources.SILENT); + return change; + }, source); + } + }, { + key: 'formatLine', + value: function formatLine(index, length, name, value, source) { + var _this5 = this; + + var formats = void 0; + + var _overload3 = overload(index, length, name, value, source); + + var _overload4 = _slicedToArray(_overload3, 4); + + index = _overload4[0]; + length = _overload4[1]; + formats = _overload4[2]; + source = _overload4[3]; + + return modify.call(this, function () { + return _this5.editor.formatLine(index, length, formats); + }, source, index, 0); + } + }, { + key: 'formatText', + value: function formatText(index, length, name, value, source) { + var _this6 = this; + + var formats = void 0; + + var _overload5 = overload(index, length, name, value, source); + + var _overload6 = _slicedToArray(_overload5, 4); + + index = _overload6[0]; + length = _overload6[1]; + formats = _overload6[2]; + source = _overload6[3]; + + return modify.call(this, function () { + return _this6.editor.formatText(index, length, formats); + }, source, index, 0); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var bounds = void 0; + if (typeof index === 'number') { + bounds = this.selection.getBounds(index, length); + } else { + bounds = this.selection.getBounds(index.index, index.length); + } + var containerBounds = this.container.getBoundingClientRect(); + return { + bottom: bounds.bottom - containerBounds.top, + height: bounds.height, + left: bounds.left - containerBounds.left, + right: bounds.right - containerBounds.left, + top: bounds.top - containerBounds.top, + width: bounds.width + }; + } + }, { + key: 'getContents', + value: function getContents() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload7 = overload(index, length); + + var _overload8 = _slicedToArray(_overload7, 2); + + index = _overload8[0]; + length = _overload8[1]; + + return this.editor.getContents(index, length); + } + }, { + key: 'getFormat', + value: function getFormat() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true); + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (typeof index === 'number') { + return this.editor.getFormat(index, length); + } else { + return this.editor.getFormat(index.index, index.length); + } + } + }, { + key: 'getIndex', + value: function getIndex(blot) { + return blot.offset(this.scroll); + } + }, { + key: 'getLength', + value: function getLength() { + return this.scroll.length(); + } + }, { + key: 'getLeaf', + value: function getLeaf(index) { + return this.scroll.leaf(index); + } + }, { + key: 'getLine', + value: function getLine(index) { + return this.scroll.line(index); + } + }, { + key: 'getLines', + value: function getLines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + if (typeof index !== 'number') { + return this.scroll.lines(index.index, index.length); + } else { + return this.scroll.lines(index, length); + } + } + }, { + key: 'getModule', + value: function getModule(name) { + return this.theme.modules[name]; + } + }, { + key: 'getSelection', + value: function getSelection() { + var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (focus) this.focus(); + this.update(); // Make sure we access getRange with editor in consistent state + return this.selection.getRange()[0]; + } + }, { + key: 'getText', + value: function getText() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload9 = overload(index, length); + + var _overload10 = _slicedToArray(_overload9, 2); + + index = _overload10[0]; + length = _overload10[1]; + + return this.editor.getText(index, length); + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return this.selection.hasFocus(); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + var _this7 = this; + + var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; + + return modify.call(this, function () { + return _this7.editor.insertEmbed(index, embed, value); + }, source, index); + } + }, { + key: 'insertText', + value: function insertText(index, text, name, value, source) { + var _this8 = this; + + var formats = void 0; + + var _overload11 = overload(index, 0, name, value, source); + + var _overload12 = _slicedToArray(_overload11, 4); + + index = _overload12[0]; + formats = _overload12[2]; + source = _overload12[3]; + + return modify.call(this, function () { + return _this8.editor.insertText(index, text, formats); + }, source, index, text.length); + } + }, { + key: 'isEnabled', + value: function isEnabled() { + return !this.container.classList.contains('ql-disabled'); + } + }, { + key: 'off', + value: function off() { + return this.emitter.off.apply(this.emitter, arguments); + } + }, { + key: 'on', + value: function on() { + return this.emitter.on.apply(this.emitter, arguments); + } + }, { + key: 'once', + value: function once() { + return this.emitter.once.apply(this.emitter, arguments); + } + }, { + key: 'pasteHTML', + value: function pasteHTML(index, html, source) { + this.clipboard.dangerouslyPasteHTML(index, html, source); + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length, source) { + var _this9 = this; + + var _overload13 = overload(index, length, source); + + var _overload14 = _slicedToArray(_overload13, 4); + + index = _overload14[0]; + length = _overload14[1]; + source = _overload14[3]; + + return modify.call(this, function () { + return _this9.editor.removeFormat(index, length); + }, source, index); + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView() { + this.selection.scrollIntoView(this.scrollingContainer); + } + }, { + key: 'setContents', + value: function setContents(delta) { + var _this10 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + var length = _this10.getLength(); + var deleted = _this10.editor.deleteText(0, length); + var applied = _this10.editor.applyDelta(delta); + var lastOp = applied.ops[applied.ops.length - 1]; + if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { + _this10.editor.deleteText(_this10.getLength() - 1, 1); + applied.delete(1); + } + var ret = deleted.compose(applied); + return ret; + }, source); + } + }, { + key: 'setSelection', + value: function setSelection(index, length, source) { + if (index == null) { + this.selection.setRange(null, length || Quill.sources.API); + } else { + var _overload15 = overload(index, length, source); + + var _overload16 = _slicedToArray(_overload15, 4); + + index = _overload16[0]; + length = _overload16[1]; + source = _overload16[3]; + + this.selection.setRange(new _selection.Range(index, length), source); + if (source !== _emitter4.default.sources.SILENT) { + this.selection.scrollIntoView(this.scrollingContainer); + } + } + } + }, { + key: 'setText', + value: function setText(text) { + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + var delta = new _quillDelta2.default().insert(text); + return this.setContents(delta, source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes + this.selection.update(source); + return change; + } + }, { + key: 'updateContents', + value: function updateContents(delta) { + var _this11 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + return _this11.editor.applyDelta(delta, source); + }, source, true); + } + }]); + + return Quill; +}(); + +Quill.DEFAULTS = { + bounds: null, + formats: null, + modules: {}, + placeholder: '', + readOnly: false, + scrollingContainer: null, + strict: true, + theme: 'default' +}; +Quill.events = _emitter4.default.events; +Quill.sources = _emitter4.default.sources; +// eslint-disable-next-line no-undef +Quill.version = false ? 'dev' : "1.3.6"; + +Quill.imports = { + 'delta': _quillDelta2.default, + 'parchment': _parchment2.default, + 'core/module': _module2.default, + 'core/theme': _theme2.default +}; + +function expandConfig(container, userConfig) { + userConfig = (0, _extend2.default)(true, { + container: container, + modules: { + clipboard: true, + keyboard: true, + history: true + } + }, userConfig); + if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { + userConfig.theme = _theme2.default; + } else { + userConfig.theme = Quill.import('themes/' + userConfig.theme); + if (userConfig.theme == null) { + throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); + } + } + var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); + [themeConfig, userConfig].forEach(function (config) { + config.modules = config.modules || {}; + Object.keys(config.modules).forEach(function (module) { + if (config.modules[module] === true) { + config.modules[module] = {}; + } + }); + }); + var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); + var moduleConfig = moduleNames.reduce(function (config, name) { + var moduleClass = Quill.import('modules/' + name); + if (moduleClass == null) { + debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); + } else { + config[name] = moduleClass.DEFAULTS || {}; + } + return config; + }, {}); + // Special case toolbar shorthand + if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { + userConfig.modules.toolbar = { + container: userConfig.modules.toolbar + }; + } + userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); + ['bounds', 'container', 'scrollingContainer'].forEach(function (key) { + if (typeof userConfig[key] === 'string') { + userConfig[key] = document.querySelector(userConfig[key]); + } + }); + userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { + if (userConfig.modules[name]) { + config[name] = userConfig.modules[name]; + } + return config; + }, {}); + return userConfig; +} + +// Handle selection preservation and TEXT_CHANGE emission +// common to modification APIs +function modify(modifier, source, index, shift) { + if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { + return new _quillDelta2.default(); + } + var range = index == null ? null : this.getSelection(); + var oldDelta = this.editor.delta; + var change = modifier(); + if (range != null) { + if (index === true) index = range.index; + if (shift == null) { + range = shiftRange(range, change, source); + } else if (shift !== 0) { + range = shiftRange(range, index, shift, source); + } + this.setSelection(range, _emitter4.default.sources.SILENT); + } + if (change.length() > 0) { + var _emitter; + + var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + return change; +} + +function overload(index, length, name, value, source) { + var formats = {}; + if (typeof index.index === 'number' && typeof index.length === 'number') { + // Allow for throwaway end (used by insertText/insertEmbed) + if (typeof length !== 'number') { + source = value, value = name, name = length, length = index.length, index = index.index; + } else { + length = index.length, index = index.index; + } + } else if (typeof length !== 'number') { + source = value, value = name, name = length, length = 0; + } + // Handle format being object, two format name/value strings or excluded + if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { + formats = name; + source = value; + } else if (typeof name === 'string') { + if (value != null) { + formats[name] = value; + } else { + source = name; + } + } + // Handle optional source + source = source || _emitter4.default.sources.API; + return [index, length, formats, source]; +} + +function shiftRange(range, index, length, source) { + if (range == null) return null; + var start = void 0, + end = void 0; + if (index instanceof _quillDelta2.default) { + var _map = [range.index, range.index + range.length].map(function (pos) { + return index.transformPosition(pos, source !== _emitter4.default.sources.USER); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + } else { + var _map3 = [range.index, range.index + range.length].map(function (pos) { + if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos; + if (length >= 0) { + return pos + length; + } else { + return Math.max(index, pos + length); + } + }); + + var _map4 = _slicedToArray(_map3, 2); + + start = _map4[0]; + end = _map4[1]; + } + return new _selection.Range(start, end - start); +} + +exports.expandConfig = expandConfig; +exports.overload = overload; +exports.default = Quill; -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { - "use strict"; - var container_1 = __webpack_require__(3); - var format_1 = __webpack_require__(7); - var leaf_1 = __webpack_require__(12); - var scroll_1 = __webpack_require__(13); - var inline_1 = __webpack_require__(14); - var block_1 = __webpack_require__(15); - var embed_1 = __webpack_require__(16); - var text_1 = __webpack_require__(17); - var attributor_1 = __webpack_require__(8); - var class_1 = __webpack_require__(10); - var style_1 = __webpack_require__(11); - var store_1 = __webpack_require__(9); - var Registry = __webpack_require__(6); - var Parchment = { - Scope: Registry.Scope, - create: Registry.create, - find: Registry.find, - query: Registry.query, - register: Registry.register, - Container: container_1.default, - Format: format_1.default, - Leaf: leaf_1.default, - Embed: embed_1.default, - Scroll: scroll_1.default, - Block: block_1.default, - Inline: inline_1.default, - Text: text_1.default, - Attributor: { - Attribute: attributor_1.default, - Class: class_1.default, - Style: style_1.default, - Store: store_1.default - } - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = Parchment; +"use strict"; -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { +Object.defineProperty(exports, "__esModule", { + value: true +}); - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var linked_list_1 = __webpack_require__(4); - var shadow_1 = __webpack_require__(5); - var Registry = __webpack_require__(6); - var ContainerBlot = (function (_super) { - __extends(ContainerBlot, _super); - function ContainerBlot() { - _super.apply(this, arguments); - } - ContainerBlot.prototype.appendChild = function (other) { - this.insertBefore(other); - }; - ContainerBlot.prototype.attach = function () { - var _this = this; - _super.prototype.attach.call(this); - this.children = new linked_list_1.default(); - // Need to be reversed for if DOM nodes already in order - [].slice.call(this.domNode.childNodes).reverse().forEach(function (node) { - try { - var child = makeBlot(node); - _this.insertBefore(child, _this.children.head); - } - catch (err) { - if (err instanceof Registry.ParchmentError) - return; - else - throw err; - } - }); - }; - ContainerBlot.prototype.deleteAt = function (index, length) { - if (index === 0 && length === this.length()) { - return this.remove(); - } - this.children.forEachAt(index, length, function (child, offset, length) { - child.deleteAt(offset, length); - }); - }; - ContainerBlot.prototype.descendant = function (criteria, index) { - var _a = this.children.find(index), child = _a[0], offset = _a[1]; - if ((criteria.blotName == null && criteria(child)) || - (criteria.blotName != null && child instanceof criteria)) { - return [child, offset]; - } - else if (child instanceof ContainerBlot) { - return child.descendant(criteria, offset); - } - else { - return [null, -1]; - } - }; - ContainerBlot.prototype.descendants = function (criteria, index, length) { - if (index === void 0) { index = 0; } - if (length === void 0) { length = Number.MAX_VALUE; } - var descendants = [], lengthLeft = length; - this.children.forEachAt(index, length, function (child, index, length) { - if ((criteria.blotName == null && criteria(child)) || - (criteria.blotName != null && child instanceof criteria)) { - descendants.push(child); - } - if (child instanceof ContainerBlot) { - descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); - } - lengthLeft -= length; - }); - return descendants; - }; - ContainerBlot.prototype.detach = function () { - this.children.forEach(function (child) { - child.detach(); - }); - _super.prototype.detach.call(this); - }; - ContainerBlot.prototype.formatAt = function (index, length, name, value) { - this.children.forEachAt(index, length, function (child, offset, length) { - child.formatAt(offset, length, name, value); - }); - }; - ContainerBlot.prototype.insertAt = function (index, value, def) { - var _a = this.children.find(index), child = _a[0], offset = _a[1]; - if (child) { - child.insertAt(offset, value, def); - } - else { - var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def); - this.appendChild(blot); - } - }; - ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { - if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function (child) { - return childBlot instanceof child; - })) { - throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); - } - childBlot.insertInto(this, refBlot); - }; - ContainerBlot.prototype.length = function () { - return this.children.reduce(function (memo, child) { - return memo + child.length(); - }, 0); - }; - ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { - this.children.forEach(function (child) { - targetParent.insertBefore(child, refNode); - }); - }; - ContainerBlot.prototype.optimize = function () { - _super.prototype.optimize.call(this); - if (this.children.length === 0) { - if (this.statics.defaultChild != null) { - var child = Registry.create(this.statics.defaultChild); - this.appendChild(child); - child.optimize(); - } - else { - this.remove(); - } - } - }; - ContainerBlot.prototype.path = function (index, inclusive) { - if (inclusive === void 0) { inclusive = false; } - var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; - var position = [[this, index]]; - if (child instanceof ContainerBlot) { - return position.concat(child.path(offset, inclusive)); - } - else if (child != null) { - position.push([child, offset]); - } - return position; - }; - ContainerBlot.prototype.removeChild = function (child) { - this.children.remove(child); - }; - ContainerBlot.prototype.replace = function (target) { - if (target instanceof ContainerBlot) { - target.moveChildren(this); - } - _super.prototype.replace.call(this, target); - }; - ContainerBlot.prototype.split = function (index, force) { - if (force === void 0) { force = false; } - if (!force) { - if (index === 0) - return this; - if (index === this.length()) - return this.next; - } - var after = this.clone(); - this.parent.insertBefore(after, this.next); - this.children.forEachAt(index, this.length(), function (child, offset, length) { - child = child.split(offset, force); - after.appendChild(child); - }); - return after; - }; - ContainerBlot.prototype.unwrap = function () { - this.moveChildren(this.parent, this.next); - this.remove(); - }; - ContainerBlot.prototype.update = function (mutations) { - var _this = this; - var addedNodes = [], removedNodes = []; - mutations.forEach(function (mutation) { - if (mutation.target === _this.domNode && mutation.type === 'childList') { - addedNodes.push.apply(addedNodes, mutation.addedNodes); - removedNodes.push.apply(removedNodes, mutation.removedNodes); - } - }); - removedNodes.forEach(function (node) { - if (node.parentNode != null && - (document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY)) { - // Node has not actually been removed - return; - } - var blot = Registry.find(node); - if (blot == null) - return; - if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { - blot.detach(); - } - }); - addedNodes.filter(function (node) { - return node.parentNode == _this.domNode; - }).sort(function (a, b) { - if (a === b) - return 0; - if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { - return 1; - } - return -1; - }).forEach(function (node) { - var refBlot = null; - if (node.nextSibling != null) { - refBlot = Registry.find(node.nextSibling); - } - var blot = makeBlot(node); - if (blot.next != refBlot || blot.next == null) { - if (blot.parent != null) { - blot.parent.removeChild(_this); - } - _this.insertBefore(blot, refBlot); - } - }); - }; - return ContainerBlot; - }(shadow_1.default)); - function makeBlot(node) { - var blot = Registry.find(node); - if (blot == null) { - try { - blot = Registry.create(node); - } - catch (e) { - blot = Registry.create(Registry.Scope.INLINE); - [].slice.call(node.childNodes).forEach(function (child) { - blot.domNode.appendChild(child); - }); - node.parentNode.replaceChild(blot.domNode, node); - blot.attach(); - } - } - return blot; - } - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = ContainerBlot; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -/***/ }, -/* 4 */ -/***/ function(module, exports) { +var _text = __webpack_require__(7); - "use strict"; - var LinkedList = (function () { - function LinkedList() { - this.head = this.tail = undefined; - this.length = 0; - } - LinkedList.prototype.append = function () { - var nodes = []; - for (var _i = 0; _i < arguments.length; _i++) { - nodes[_i - 0] = arguments[_i]; - } - this.insertBefore(nodes[0], undefined); - if (nodes.length > 1) { - this.append.apply(this, nodes.slice(1)); - } - }; - LinkedList.prototype.contains = function (node) { - var cur, next = this.iterator(); - while (cur = next()) { - if (cur === node) - return true; - } - return false; - }; - LinkedList.prototype.insertBefore = function (node, refNode) { - node.next = refNode; - if (refNode != null) { - node.prev = refNode.prev; - if (refNode.prev != null) { - refNode.prev.next = node; - } - refNode.prev = node; - if (refNode === this.head) { - this.head = node; - } - } - else if (this.tail != null) { - this.tail.next = node; - node.prev = this.tail; - this.tail = node; - } - else { - node.prev = undefined; - this.head = this.tail = node; - } - this.length += 1; - }; - LinkedList.prototype.offset = function (target) { - var index = 0, cur = this.head; - while (cur != null) { - if (cur === target) - return index; - index += cur.length(); - cur = cur.next; - } - return -1; - }; - LinkedList.prototype.remove = function (node) { - if (!this.contains(node)) - return; - if (node.prev != null) - node.prev.next = node.next; - if (node.next != null) - node.next.prev = node.prev; - if (node === this.head) - this.head = node.next; - if (node === this.tail) - this.tail = node.prev; - this.length -= 1; - }; - LinkedList.prototype.iterator = function (curNode) { - if (curNode === void 0) { curNode = this.head; } - // TODO use yield when we can - return function () { - var ret = curNode; - if (curNode != null) - curNode = curNode.next; - return ret; - }; - }; - LinkedList.prototype.find = function (index, inclusive) { - if (inclusive === void 0) { inclusive = false; } - var cur, next = this.iterator(); - while (cur = next()) { - var length_1 = cur.length(); - if (index < length_1 || (inclusive && index === length_1 && (cur.next == null || cur.next.length() !== 0))) { - return [cur, index]; - } - index -= length_1; - } - return [null, 0]; - }; - LinkedList.prototype.forEach = function (callback) { - var cur, next = this.iterator(); - while (cur = next()) { - callback(cur); - } - }; - LinkedList.prototype.forEachAt = function (index, length, callback) { - if (length <= 0) - return; - var _a = this.find(index), startNode = _a[0], offset = _a[1]; - var cur, curIndex = index - offset, next = this.iterator(startNode); - while ((cur = next()) && curIndex < index + length) { - var curLength = cur.length(); - if (index > curIndex) { - callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); - } - else { - callback(cur, 0, Math.min(curLength, index + length - curIndex)); - } - curIndex += curLength; - } - }; - LinkedList.prototype.map = function (callback) { - return this.reduce(function (memo, cur) { - memo.push(callback(cur)); - return memo; - }, []); - }; - LinkedList.prototype.reduce = function (callback, memo) { - var cur, next = this.iterator(); - while (cur = next()) { - memo = callback(memo, cur); - } - return memo; - }; - return LinkedList; - }()); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = LinkedList; +var _text2 = _interopRequireDefault(_text); +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Inline = function (_Parchment$Inline) { + _inherits(Inline, _Parchment$Inline); + + function Inline() { + _classCallCheck(this, Inline); + + return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); + } + + _createClass(Inline, [{ + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { + var blot = this.isolate(index, length); + if (value) { + blot.wrap(name, value); + } + } else { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context); + if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { + var parent = this.parent.isolate(this.offset(), this.length()); + this.moveChildren(parent); + parent.wrap(this); + } + } + }], [{ + key: 'compare', + value: function compare(self, other) { + var selfIndex = Inline.order.indexOf(self); + var otherIndex = Inline.order.indexOf(other); + if (selfIndex >= 0 || otherIndex >= 0) { + return selfIndex - otherIndex; + } else if (self === other) { + return 0; + } else if (self < other) { + return -1; + } else { + return 1; + } + } + }]); + + return Inline; +}(_parchment2.default.Inline); + +Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default]; +// Lower index means deeper in the DOM tree, since not found (-1) is for embeds +Inline.order = ['cursor', 'inline', // Must be lower +'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher +]; -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { +exports.default = Inline; - "use strict"; - var Registry = __webpack_require__(6); - var ShadowBlot = (function () { - function ShadowBlot(domNode) { - this.domNode = domNode; - this.attach(); - } - Object.defineProperty(ShadowBlot.prototype, "statics", { - // Hack for accessing inherited static methods - get: function () { - return this.constructor; - }, - enumerable: true, - configurable: true - }); - ShadowBlot.create = function (value) { - if (this.tagName == null) { - throw new Registry.ParchmentError('Blot definition missing tagName'); - } - var node; - if (Array.isArray(this.tagName)) { - if (typeof value === 'string') { - value = value.toUpperCase(); - if (parseInt(value).toString() === value) { - value = parseInt(value); - } - } - if (typeof value === 'number') { - node = document.createElement(this.tagName[value - 1]); - } - else if (this.tagName.indexOf(value) > -1) { - node = document.createElement(value); - } - else { - node = document.createElement(this.tagName[0]); - } - } - else { - node = document.createElement(this.tagName); - } - if (this.className) { - node.classList.add(this.className); - } - return node; - }; - ShadowBlot.prototype.attach = function () { - this.domNode[Registry.DATA_KEY] = { blot: this }; - }; - ShadowBlot.prototype.clone = function () { - var domNode = this.domNode.cloneNode(); - return Registry.create(domNode); - }; - ShadowBlot.prototype.detach = function () { - if (this.parent != null) - this.parent.removeChild(this); - delete this.domNode[Registry.DATA_KEY]; - }; - ShadowBlot.prototype.deleteAt = function (index, length) { - var blot = this.isolate(index, length); - blot.remove(); - }; - ShadowBlot.prototype.formatAt = function (index, length, name, value) { - var blot = this.isolate(index, length); - if (Registry.query(name, Registry.Scope.BLOT) != null && value) { - blot.wrap(name, value); - } - else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { - var parent_1 = Registry.create(this.statics.scope); - blot.wrap(parent_1); - parent_1.format(name, value); - } - }; - ShadowBlot.prototype.insertAt = function (index, value, def) { - var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def); - var ref = this.split(index); - this.parent.insertBefore(blot, ref); - }; - ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { - if (this.parent != null) { - this.parent.children.remove(this); - } - parentBlot.children.insertBefore(this, refBlot); - if (refBlot != null) { - var refDomNode = refBlot.domNode; - } - if (this.next == null || this.domNode.nextSibling != refDomNode) { - parentBlot.domNode.insertBefore(this.domNode, refDomNode); - } - this.parent = parentBlot; - }; - ShadowBlot.prototype.isolate = function (index, length) { - var target = this.split(index); - target.split(length); - return target; - }; - ShadowBlot.prototype.length = function () { - return 1; - }; - ; - ShadowBlot.prototype.offset = function (root) { - if (root === void 0) { root = this.parent; } - if (this.parent == null || this == root) - return 0; - return this.parent.children.offset(this) + this.parent.offset(root); - }; - ShadowBlot.prototype.optimize = function () { - // TODO clean up once we use WeakMap - if (this.domNode[Registry.DATA_KEY] != null) { - delete this.domNode[Registry.DATA_KEY].mutations; - } - }; - ShadowBlot.prototype.remove = function () { - if (this.domNode.parentNode != null) { - this.domNode.parentNode.removeChild(this.domNode); - } - this.detach(); - }; - ShadowBlot.prototype.replace = function (target) { - if (target.parent == null) - return; - target.parent.insertBefore(this, target.next); - target.remove(); - }; - ShadowBlot.prototype.replaceWith = function (name, value) { - var replacement = typeof name === 'string' ? Registry.create(name, value) : name; - replacement.replace(this); - return replacement; - }; - ShadowBlot.prototype.split = function (index, force) { - return index === 0 ? this : this.next; - }; - ShadowBlot.prototype.update = function (mutations) { - if (mutations === void 0) { mutations = []; } - // Nothing to do by default - }; - ShadowBlot.prototype.wrap = function (name, value) { - var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; - if (this.parent != null) { - this.parent.insertBefore(wrapper, this.next); - } - wrapper.appendChild(this); - return wrapper; - }; - ShadowBlot.blotName = 'abstract'; - return ShadowBlot; - }()); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = ShadowBlot; +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; -/***/ }, -/* 6 */ -/***/ function(module, exports) { - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var ParchmentError = (function (_super) { - __extends(ParchmentError, _super); - function ParchmentError(message) { - message = '[Parchment] ' + message; - _super.call(this, message); - this.message = message; - this.name = this.constructor.name; - } - return ParchmentError; - }(Error)); - exports.ParchmentError = ParchmentError; - var attributes = {}; - var classes = {}; - var tags = {}; - var types = {}; - exports.DATA_KEY = '__blot'; - (function (Scope) { - Scope[Scope["TYPE"] = 3] = "TYPE"; - Scope[Scope["LEVEL"] = 12] = "LEVEL"; - Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; - Scope[Scope["BLOT"] = 14] = "BLOT"; - Scope[Scope["INLINE"] = 7] = "INLINE"; - Scope[Scope["BLOCK"] = 11] = "BLOCK"; - Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; - Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; - Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; - Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; - Scope[Scope["ANY"] = 15] = "ANY"; - })(exports.Scope || (exports.Scope = {})); - var Scope = exports.Scope; - ; - function create(input, value) { - var match = query(input); - if (match == null) { - throw new ParchmentError("Unable to create " + input + " blot"); - } - var BlotClass = match; - var node = input instanceof Node ? input : BlotClass.create(value); - return new BlotClass(node, value); - } - exports.create = create; - function find(node, bubble) { - if (bubble === void 0) { bubble = false; } - if (node == null) - return null; - if (node[exports.DATA_KEY] != null) - return node[exports.DATA_KEY].blot; - if (bubble) - return find(node.parentNode, bubble); - return null; - } - exports.find = find; - function query(query, scope) { - if (scope === void 0) { scope = Scope.ANY; } - var match; - if (typeof query === 'string') { - match = types[query] || attributes[query]; - } - else if (query instanceof Text) { - match = types['text']; - } - else if (typeof query === 'number') { - if (query & Scope.LEVEL & Scope.BLOCK) { - match = types['block']; - } - else if (query & Scope.LEVEL & Scope.INLINE) { - match = types['inline']; - } - } - else if (query instanceof HTMLElement) { - var names = (query.getAttribute('class') || '').split(/\s+/); - for (var i in names) { - match = classes[names[i]]; - if (match) - break; - } - match = match || tags[query.tagName]; - } - if (match == null) { - if (query instanceof Node) { - console.log(query.nodeType); - } - } - if (match == null) - return null; - if ((scope & Scope.LEVEL & match.scope) && (scope & Scope.TYPE & match.scope)) - return match; - return null; - } - exports.query = query; - function register() { - var Definitions = []; - for (var _i = 0; _i < arguments.length; _i++) { - Definitions[_i - 0] = arguments[_i]; - } - if (Definitions.length > 1) { - return Definitions.map(function (d) { - return register(d); - }); - } - var Definition = Definitions[0]; - if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { - throw new ParchmentError('Invalid definition'); - } - else if (Definition.blotName === 'abstract') { - throw new ParchmentError('Cannot register abstract class'); - } - types[Definition.blotName || Definition.attrName] = Definition; - if (typeof Definition.keyName === 'string') { - attributes[Definition.keyName] = Definition; - } - else { - if (Definition.className != null) { - classes[Definition.className] = Definition; - } - if (Definition.tagName != null) { - if (Array.isArray(Definition.tagName)) { - Definition.tagName = Definition.tagName.map(function (tagName) { - return tagName.toUpperCase(); - }); - } - else { - Definition.tagName = Definition.tagName.toUpperCase(); - } - var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; - tagNames.forEach(function (tag) { - if (tags[tag] == null || Definition.className == null) { - tags[tag] = Definition; - } - }); - } - } - return Definition; - } - exports.register = register; +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _parchment = __webpack_require__(0); -/***/ }, -/* 7 */ -/***/ function(module, exports, __webpack_require__) { +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var attributor_1 = __webpack_require__(8); - var store_1 = __webpack_require__(9); - var container_1 = __webpack_require__(3); - var Registry = __webpack_require__(6); - var FormatBlot = (function (_super) { - __extends(FormatBlot, _super); - function FormatBlot() { - _super.apply(this, arguments); - } - FormatBlot.formats = function (domNode) { - if (typeof this.tagName === 'string') { - return true; - } - else if (Array.isArray(this.tagName)) { - return domNode.tagName.toLowerCase(); - } - return undefined; - }; - FormatBlot.prototype.attach = function () { - _super.prototype.attach.call(this); - this.attributes = new store_1.default(this.domNode); - }; - FormatBlot.prototype.format = function (name, value) { - var format = Registry.query(name); - if (format instanceof attributor_1.default) { - this.attributes.attribute(format, value); - } - else if (value) { - if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { - this.replaceWith(name, value); - } - } - }; - FormatBlot.prototype.formats = function () { - var formats = this.attributes.values(); - var format = this.statics.formats(this.domNode); - if (format != null) { - formats[this.statics.blotName] = format; - } - return formats; - }; - FormatBlot.prototype.replaceWith = function (name, value) { - var replacement = _super.prototype.replaceWith.call(this, name, value); - this.attributes.copy(replacement); - return replacement; - }; - FormatBlot.prototype.update = function (mutations) { - var _this = this; - _super.prototype.update.call(this, mutations); - if (mutations.some(function (mutation) { - return mutation.target === _this.domNode && mutation.type === 'attributes'; - })) { - this.attributes.build(); - } - }; - FormatBlot.prototype.wrap = function (name, value) { - var wrapper = _super.prototype.wrap.call(this, name, value); - if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { - this.attributes.move(wrapper); - } - return wrapper; - }; - return FormatBlot; - }(container_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = FormatBlot; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -/***/ }, +var TextBlot = function (_Parchment$Text) { + _inherits(TextBlot, _Parchment$Text); + + function TextBlot() { + _classCallCheck(this, TextBlot); + + return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); + } + + return TextBlot; +}(_parchment2.default.Text); + +exports.default = TextBlot; + +/***/ }), /* 8 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _eventemitter = __webpack_require__(54); + +var _eventemitter2 = _interopRequireDefault(_eventemitter); + +var _logger = __webpack_require__(10); - "use strict"; - var Registry = __webpack_require__(6); - var Attributor = (function () { - function Attributor(attrName, keyName, options) { - if (options === void 0) { options = {}; } - this.attrName = attrName; - this.keyName = keyName; - var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; - if (options.scope != null) { - // Ignore type bits, force attribute bit - this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; - } - else { - this.scope = Registry.Scope.ATTRIBUTE; - } - if (options.whitelist != null) - this.whitelist = options.whitelist; - } - Attributor.keys = function (node) { - return [].map.call(node.attributes, function (item) { - return item.name; - }); - }; - Attributor.prototype.add = function (node, value) { - if (!this.canAdd(node, value)) - return false; - node.setAttribute(this.keyName, value); - return true; - }; - Attributor.prototype.canAdd = function (node, value) { - var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); - if (match != null && (this.whitelist == null || this.whitelist.indexOf(value) > -1)) { - return true; - } - return false; - }; - Attributor.prototype.remove = function (node) { - node.removeAttribute(this.keyName); - }; - Attributor.prototype.value = function (node) { - return node.getAttribute(this.keyName); - }; - return Attributor; - }()); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = Attributor; +var _logger2 = _interopRequireDefault(_logger); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/***/ }, +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:events'); + +var EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click']; + +EVENTS.forEach(function (eventName) { + document.addEventListener(eventName, function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) { + // TODO use WeakMap + if (node.__quill && node.__quill.emitter) { + var _node$__quill$emitter; + + (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args); + } + }); + }); +}); + +var Emitter = function (_EventEmitter) { + _inherits(Emitter, _EventEmitter); + + function Emitter() { + _classCallCheck(this, Emitter); + + var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); + + _this.listeners = {}; + _this.on('error', debug.error); + return _this; + } + + _createClass(Emitter, [{ + key: 'emit', + value: function emit() { + debug.log.apply(debug, arguments); + _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); + } + }, { + key: 'handleDOM', + value: function handleDOM(event) { + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + (this.listeners[event.type] || []).forEach(function (_ref) { + var node = _ref.node, + handler = _ref.handler; + + if (event.target === node || node.contains(event.target)) { + handler.apply(undefined, [event].concat(args)); + } + }); + } + }, { + key: 'listenDOM', + value: function listenDOM(eventName, node, handler) { + if (!this.listeners[eventName]) { + this.listeners[eventName] = []; + } + this.listeners[eventName].push({ node: node, handler: handler }); + } + }]); + + return Emitter; +}(_eventemitter2.default); + +Emitter.events = { + EDITOR_CHANGE: 'editor-change', + SCROLL_BEFORE_UPDATE: 'scroll-before-update', + SCROLL_OPTIMIZE: 'scroll-optimize', + SCROLL_UPDATE: 'scroll-update', + SELECTION_CHANGE: 'selection-change', + TEXT_CHANGE: 'text-change' +}; +Emitter.sources = { + API: 'api', + SILENT: 'silent', + USER: 'user' +}; + +exports.default = Emitter; + +/***/ }), /* 9 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - "use strict"; - var attributor_1 = __webpack_require__(8); - var class_1 = __webpack_require__(10); - var style_1 = __webpack_require__(11); - var Registry = __webpack_require__(6); - var AttributorStore = (function () { - function AttributorStore(domNode) { - this.attributes = {}; - this.domNode = domNode; - this.build(); - } - AttributorStore.prototype.attribute = function (attribute, value) { - if (value) { - if (attribute.add(this.domNode, value)) { - if (attribute.value(this.domNode) != null) { - this.attributes[attribute.attrName] = attribute; - } - else { - delete this.attributes[attribute.attrName]; - } - } - } - else { - attribute.remove(this.domNode); - delete this.attributes[attribute.attrName]; - } - }; - AttributorStore.prototype.build = function () { - var _this = this; - this.attributes = {}; - var attributes = attributor_1.default.keys(this.domNode); - var classes = class_1.default.keys(this.domNode); - var styles = style_1.default.keys(this.domNode); - attributes.concat(classes).concat(styles).forEach(function (name) { - var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); - if (attr instanceof attributor_1.default) { - _this.attributes[attr.attrName] = attr; - } - }); - }; - AttributorStore.prototype.copy = function (target) { - var _this = this; - Object.keys(this.attributes).forEach(function (key) { - var value = _this.attributes[key].value(_this.domNode); - target.format(key, value); - }); - }; - AttributorStore.prototype.move = function (target) { - var _this = this; - this.copy(target); - Object.keys(this.attributes).forEach(function (key) { - _this.attributes[key].remove(_this.domNode); - }); - this.attributes = {}; - }; - AttributorStore.prototype.values = function () { - var _this = this; - return Object.keys(this.attributes).reduce(function (attributes, name) { - attributes[name] = _this.attributes[name].value(_this.domNode); - return attributes; - }, {}); - }; - return AttributorStore; - }()); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = AttributorStore; +"use strict"; -/***/ }, +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Module = function Module(quill) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Module); + + this.quill = quill; + this.options = options; +}; + +Module.DEFAULTS = {}; + +exports.default = Module; + +/***/ }), /* 10 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var attributor_1 = __webpack_require__(8); - function match(node, prefix) { - var className = node.getAttribute('class') || ''; - return className.split(/\s+/).filter(function (name) { - return name.indexOf(prefix + "-") === 0; - }); - } - var ClassAttributor = (function (_super) { - __extends(ClassAttributor, _super); - function ClassAttributor() { - _super.apply(this, arguments); - } - ClassAttributor.keys = function (node) { - return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { - return name.split('-').slice(0, -1).join('-'); - }); - }; - ClassAttributor.prototype.add = function (node, value) { - if (!this.canAdd(node, value)) - return false; - this.remove(node); - node.classList.add(this.keyName + "-" + value); - return true; - }; - ClassAttributor.prototype.remove = function (node) { - var matches = match(node, this.keyName); - matches.forEach(function (name) { - node.classList.remove(name); - }); - if (node.classList.length === 0) { - node.removeAttribute('class'); - } - }; - ClassAttributor.prototype.value = function (node) { - var result = match(node, this.keyName)[0] || ''; - return result.slice(this.keyName.length + 1); // +1 for hyphen - }; - return ClassAttributor; - }(attributor_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = ClassAttributor; +"use strict"; -/***/ }, +Object.defineProperty(exports, "__esModule", { + value: true +}); +var levels = ['error', 'warn', 'log', 'info']; +var level = 'warn'; + +function debug(method) { + if (levels.indexOf(method) <= levels.indexOf(level)) { + var _console; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + (_console = console)[method].apply(_console, args); // eslint-disable-line no-console + } +} + +function namespace(ns) { + return levels.reduce(function (logger, method) { + logger[method] = debug.bind(console, method, ns); + return logger; + }, {}); +} + +debug.level = namespace.level = function (newLevel) { + level = newLevel; +}; + +exports.default = namespace; + +/***/ }), /* 11 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var attributor_1 = __webpack_require__(8); - function camelize(name) { - var parts = name.split('-'); - var rest = parts.slice(1).map(function (part) { - return part[0].toUpperCase() + part.slice(1); - }).join(''); - return parts[0] + rest; - } - var StyleAttributor = (function (_super) { - __extends(StyleAttributor, _super); - function StyleAttributor() { - _super.apply(this, arguments); - } - StyleAttributor.keys = function (node) { - return (node.getAttribute('style') || '').split(';').map(function (value) { - var arr = value.split(':'); - return arr[0].trim(); - }); - }; - StyleAttributor.prototype.add = function (node, value) { - if (!this.canAdd(node, value)) - return false; - node.style[camelize(this.keyName)] = value; - return true; - }; - StyleAttributor.prototype.remove = function (node) { - node.style[camelize(this.keyName)] = ''; - if (!node.getAttribute('style')) { - node.removeAttribute('style'); - } - }; - StyleAttributor.prototype.value = function (node) { - return node.style[camelize(this.keyName)]; - }; - return StyleAttributor; - }(attributor_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = StyleAttributor; +var pSlice = Array.prototype.slice; +var objectKeys = __webpack_require__(52); +var isArguments = __webpack_require__(53); + +var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } +} + +function isUndefinedOrNull(value) { + return value === null || value === undefined; +} + +function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; +} + +function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; +} -/***/ }, +/***/ }), /* 12 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var shadow_1 = __webpack_require__(5); - var Registry = __webpack_require__(6); - var LeafBlot = (function (_super) { - __extends(LeafBlot, _super); - function LeafBlot() { - _super.apply(this, arguments); - } - LeafBlot.value = function (domNode) { - return true; - }; - LeafBlot.prototype.index = function (node, offset) { - if (node !== this.domNode) - return -1; - return Math.min(offset, 1); - }; - LeafBlot.prototype.position = function (index, inclusive) { - var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); - if (index > 0) - offset += 1; - return [this.parent.domNode, offset]; - }; - LeafBlot.prototype.value = function () { - return (_a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a); - var _a; - }; - LeafBlot.scope = Registry.Scope.INLINE_BLOT; - return LeafBlot; - }(shadow_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = LeafBlot; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var Attributor = /** @class */ (function () { + function Attributor(attrName, keyName, options) { + if (options === void 0) { options = {}; } + this.attrName = attrName; + this.keyName = keyName; + var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; + if (options.scope != null) { + // Ignore type bits, force attribute bit + this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; + } + else { + this.scope = Registry.Scope.ATTRIBUTE; + } + if (options.whitelist != null) + this.whitelist = options.whitelist; + } + Attributor.keys = function (node) { + return [].map.call(node.attributes, function (item) { + return item.name; + }); + }; + Attributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + node.setAttribute(this.keyName, value); + return true; + }; + Attributor.prototype.canAdd = function (node, value) { + var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); + if (match == null) + return false; + if (this.whitelist == null) + return true; + if (typeof value === 'string') { + return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1; + } + else { + return this.whitelist.indexOf(value) > -1; + } + }; + Attributor.prototype.remove = function (node) { + node.removeAttribute(this.keyName); + }; + Attributor.prototype.value = function (node) { + var value = node.getAttribute(this.keyName); + if (this.canAdd(node, value) && value) { + return value; + } + return ''; + }; + return Attributor; +}()); +exports.default = Attributor; -/***/ }, + +/***/ }), /* 13 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Code = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var container_1 = __webpack_require__(3); - var Registry = __webpack_require__(6); - var OBSERVER_CONFIG = { - attributes: true, - characterData: true, - characterDataOldValue: true, - childList: true, - subtree: true - }; - var MAX_OPTIMIZE_ITERATIONS = 100; - var ScrollBlot = (function (_super) { - __extends(ScrollBlot, _super); - function ScrollBlot(node) { - var _this = this; - _super.call(this, node); - this.parent = null; - this.observer = new MutationObserver(function (mutations) { - _this.update(mutations); - }); - this.observer.observe(this.domNode, OBSERVER_CONFIG); - } - ScrollBlot.prototype.detach = function () { - _super.prototype.detach.call(this); - this.observer.disconnect(); - }; - ScrollBlot.prototype.deleteAt = function (index, length) { - this.update(); - if (index === 0 && length === this.length()) { - this.children.forEach(function (child) { - child.remove(); - }); - } - else { - _super.prototype.deleteAt.call(this, index, length); - } - }; - ScrollBlot.prototype.formatAt = function (index, length, name, value) { - this.update(); - _super.prototype.formatAt.call(this, index, length, name, value); - }; - ScrollBlot.prototype.insertAt = function (index, value, def) { - this.update(); - _super.prototype.insertAt.call(this, index, value, def); - }; - ScrollBlot.prototype.optimize = function (mutations) { - var _this = this; - if (mutations === void 0) { mutations = []; } - _super.prototype.optimize.call(this); - mutations.push.apply(mutations, this.observer.takeRecords()); - // TODO use WeakMap - var mark = function (blot, markParent) { - if (markParent === void 0) { markParent = true; } - if (blot == null || blot === _this) - return; - if (blot.domNode.parentNode == null) - return; - if (blot.domNode[Registry.DATA_KEY].mutations == null) { - blot.domNode[Registry.DATA_KEY].mutations = []; - } - if (markParent) - mark(blot.parent); - }; - var optimize = function (blot) { - if (blot.domNode[Registry.DATA_KEY] == null || blot.domNode[Registry.DATA_KEY].mutations == null) { - return; - } - if (blot instanceof container_1.default) { - blot.children.forEach(optimize); - } - blot.optimize(); - }; - var remaining = mutations; - for (var i = 0; remaining.length > 0; i += 1) { - if (i >= MAX_OPTIMIZE_ITERATIONS) { - throw new Error('[Parchment] Maximum optimize iterations reached'); - } - remaining.forEach(function (mutation) { - var blot = Registry.find(mutation.target, true); - if (blot == null) - return; - if (blot.domNode === mutation.target) { - if (mutation.type === 'childList') { - mark(Registry.find(mutation.previousSibling, false)); - [].forEach.call(mutation.addedNodes, function (node) { - var child = Registry.find(node, false); - mark(child, false); - if (child instanceof container_1.default) { - child.children.forEach(function (grandChild) { - mark(grandChild, false); - }); - } - }); - } - else if (mutation.type === 'attributes') { - mark(blot.prev); - } - } - mark(blot); - }); - this.children.forEach(optimize); - remaining = this.observer.takeRecords(); - mutations.push.apply(mutations, remaining); - } - }; - ScrollBlot.prototype.update = function (mutations) { - var _this = this; - mutations = mutations || this.observer.takeRecords(); - // TODO use WeakMap - mutations.map(function (mutation) { - var blot = Registry.find(mutation.target, true); - if (blot == null) - return; - if (blot.domNode[Registry.DATA_KEY].mutations == null) { - blot.domNode[Registry.DATA_KEY].mutations = [mutation]; - return blot; - } - else { - blot.domNode[Registry.DATA_KEY].mutations.push(mutation); - return null; - } - }).forEach(function (blot) { - if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null) - return; - blot.update(blot.domNode[Registry.DATA_KEY].mutations || []); - }); - if (this.domNode[Registry.DATA_KEY].mutations != null) { - _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations); - } - this.optimize(mutations); - }; - ScrollBlot.blotName = 'scroll'; - ScrollBlot.defaultChild = 'block'; - ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; - ScrollBlot.tagName = 'DIV'; - return ScrollBlot; - }(container_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = ScrollBlot; +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Code = function (_Inline) { + _inherits(Code, _Inline); + + function Code() { + _classCallCheck(this, Code); + + return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); + } + + return Code; +}(_inline2.default); + +Code.blotName = 'code'; +Code.tagName = 'CODE'; + +var CodeBlock = function (_Block) { + _inherits(CodeBlock, _Block); + + function CodeBlock() { + _classCallCheck(this, CodeBlock); + + return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); + } + + _createClass(CodeBlock, [{ + key: 'delta', + value: function delta() { + var _this3 = this; + + var text = this.domNode.textContent; + if (text.endsWith('\n')) { + // Should always be true + text = text.slice(0, -1); + } + return text.split('\n').reduce(function (delta, frag) { + return delta.insert(frag).insert('\n', _this3.formats()); + }, new _quillDelta2.default()); + } + }, { + key: 'format', + value: function format(name, value) { + if (name === this.statics.blotName && value) return; + + var _descendant = this.descendant(_text2.default, this.length() - 1), + _descendant2 = _slicedToArray(_descendant, 1), + text = _descendant2[0]; + + if (text != null) { + text.deleteAt(text.length() - 1, 1); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length === 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { + return; + } + var nextNewline = this.newlineIndex(index); + if (nextNewline < 0 || nextNewline >= index + length) return; + var prevNewline = this.newlineIndex(index, true) + 1; + var isolateLength = nextNewline - prevNewline + 1; + var blot = this.isolate(prevNewline, isolateLength); + var next = blot.next; + blot.format(name, value); + if (next instanceof CodeBlock) { + next.formatAt(0, index - prevNewline + length - isolateLength, name, value); + } + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return; + + var _descendant3 = this.descendant(_text2.default, index), + _descendant4 = _slicedToArray(_descendant3, 2), + text = _descendant4[0], + offset = _descendant4[1]; + + text.insertAt(offset, value); + } + }, { + key: 'length', + value: function length() { + var length = this.domNode.textContent.length; + if (!this.domNode.textContent.endsWith('\n')) { + return length + 1; + } + return length; + } + }, { + key: 'newlineIndex', + value: function newlineIndex(searchIndex) { + var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (!reverse) { + var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); + return offset > -1 ? searchIndex + offset : -1; + } else { + return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + if (!this.domNode.textContent.endsWith('\n')) { + this.appendChild(_parchment2.default.create('text', '\n')); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { + next.optimize(context); + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); + [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { + var blot = _parchment2.default.find(node); + if (blot == null) { + node.parentNode.removeChild(node); + } else if (blot instanceof _parchment2.default.Embed) { + blot.remove(); + } else { + blot.unwrap(); + } + }); + } + }], [{ + key: 'create', + value: function create(value) { + var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); + domNode.setAttribute('spellcheck', false); + return domNode; + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return CodeBlock; +}(_block2.default); + +CodeBlock.blotName = 'code-block'; +CodeBlock.tagName = 'PRE'; +CodeBlock.TAB = ' '; -/***/ }, +exports.Code = Code; +exports.default = CodeBlock; + +/***/ }), /* 14 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var format_1 = __webpack_require__(7); - var Registry = __webpack_require__(6); - // Shallow object comparison - function isEqual(obj1, obj2) { - if (Object.keys(obj1).length !== Object.keys(obj2).length) - return false; - for (var prop in obj1) { - if (obj1[prop] !== obj2[prop]) - return false; - } - return true; - } - var InlineBlot = (function (_super) { - __extends(InlineBlot, _super); - function InlineBlot() { - _super.apply(this, arguments); - } - InlineBlot.formats = function (domNode) { - if (domNode.tagName === InlineBlot.tagName) - return undefined; - return _super.formats.call(this, domNode); - }; - InlineBlot.prototype.format = function (name, value) { - var _this = this; - if (name === this.statics.blotName && !value) { - this.children.forEach(function (child) { - if (!(child instanceof format_1.default)) { - child = child.wrap(InlineBlot.blotName, true); - } - _this.attributes.copy(child); - }); - this.unwrap(); - } - else { - _super.prototype.format.call(this, name, value); - } - }; - InlineBlot.prototype.formatAt = function (index, length, name, value) { - if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { - var blot = this.isolate(index, length); - blot.format(name, value); - } - else { - _super.prototype.formatAt.call(this, index, length, name, value); - } - }; - InlineBlot.prototype.optimize = function () { - _super.prototype.optimize.call(this); - var formats = this.formats(); - if (Object.keys(formats).length === 0) { - return this.unwrap(); // unformatted span - } - var next = this.next; - if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { - next.moveChildren(this); - next.remove(); - } - }; - InlineBlot.blotName = 'inline'; - InlineBlot.scope = Registry.Scope.INLINE_BLOT; - InlineBlot.tagName = 'SPAN'; - return InlineBlot; - }(format_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = InlineBlot; +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -/***/ }, +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _cursor = __webpack_require__(24); + +var _cursor2 = _interopRequireDefault(_cursor); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var ASCII = /^[ -~]*$/; + +var Editor = function () { + function Editor(scroll) { + _classCallCheck(this, Editor); + + this.scroll = scroll; + this.delta = this.getDelta(); + } + + _createClass(Editor, [{ + key: 'applyDelta', + value: function applyDelta(delta) { + var _this = this; + + var consumeNextNewline = false; + this.scroll.update(); + var scrollLength = this.scroll.length(); + this.scroll.batchStart(); + delta = normalizeDelta(delta); + delta.reduce(function (index, op) { + var length = op.retain || op.delete || op.insert.length || 1; + var attributes = op.attributes || {}; + if (op.insert != null) { + if (typeof op.insert === 'string') { + var text = op.insert; + if (text.endsWith('\n') && consumeNextNewline) { + consumeNextNewline = false; + text = text.slice(0, -1); + } + if (index >= scrollLength && !text.endsWith('\n')) { + consumeNextNewline = true; + } + _this.scroll.insertAt(index, text); + + var _scroll$line = _this.scroll.line(index), + _scroll$line2 = _slicedToArray(_scroll$line, 2), + line = _scroll$line2[0], + offset = _scroll$line2[1]; + + var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); + if (line instanceof _block2.default) { + var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), + _line$descendant2 = _slicedToArray(_line$descendant, 1), + leaf = _line$descendant2[0]; + + formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); + } + attributes = _op2.default.attributes.diff(formats, attributes) || {}; + } else if (_typeof(op.insert) === 'object') { + var key = Object.keys(op.insert)[0]; // There should only be one key + if (key == null) return index; + _this.scroll.insertAt(index, key, op.insert[key]); + } + scrollLength += length; + } + Object.keys(attributes).forEach(function (name) { + _this.scroll.formatAt(index, length, name, attributes[name]); + }); + return index + length; + }, 0); + delta.reduce(function (index, op) { + if (typeof op.delete === 'number') { + _this.scroll.deleteAt(index, op.delete); + return index; + } + return index + (op.retain || op.insert.length || 1); + }, 0); + this.scroll.batchEnd(); + return this.update(delta); + } + }, { + key: 'deleteText', + value: function deleteText(index, length) { + this.scroll.deleteAt(index, length); + return this.update(new _quillDelta2.default().retain(index).delete(length)); + } + }, { + key: 'formatLine', + value: function formatLine(index, length) { + var _this2 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + this.scroll.update(); + Object.keys(formats).forEach(function (format) { + if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return; + var lines = _this2.scroll.lines(index, Math.max(length, 1)); + var lengthRemaining = length; + lines.forEach(function (line) { + var lineLength = line.length(); + if (!(line instanceof _code2.default)) { + line.format(format, formats[format]); + } else { + var codeIndex = index - line.offset(_this2.scroll); + var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; + line.formatAt(codeIndex, codeLength, format, formats[format]); + } + lengthRemaining -= lineLength; + }); + }); + this.scroll.optimize(); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'formatText', + value: function formatText(index, length) { + var _this3 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + Object.keys(formats).forEach(function (format) { + _this3.scroll.formatAt(index, length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'getContents', + value: function getContents(index, length) { + return this.delta.slice(index, index + length); + } + }, { + key: 'getDelta', + value: function getDelta() { + return this.scroll.lines().reduce(function (delta, line) { + return delta.concat(line.delta()); + }, new _quillDelta2.default()); + } + }, { + key: 'getFormat', + value: function getFormat(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var lines = [], + leaves = []; + if (length === 0) { + this.scroll.path(index).forEach(function (path) { + var _path = _slicedToArray(path, 1), + blot = _path[0]; + + if (blot instanceof _block2.default) { + lines.push(blot); + } else if (blot instanceof _parchment2.default.Leaf) { + leaves.push(blot); + } + }); + } else { + lines = this.scroll.lines(index, length); + leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); + } + var formatsArr = [lines, leaves].map(function (blots) { + if (blots.length === 0) return {}; + var formats = (0, _block.bubbleFormats)(blots.shift()); + while (Object.keys(formats).length > 0) { + var blot = blots.shift(); + if (blot == null) return formats; + formats = combineFormats((0, _block.bubbleFormats)(blot), formats); + } + return formats; + }); + return _extend2.default.apply(_extend2.default, formatsArr); + } + }, { + key: 'getText', + value: function getText(index, length) { + return this.getContents(index, length).filter(function (op) { + return typeof op.insert === 'string'; + }).map(function (op) { + return op.insert; + }).join(''); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + this.scroll.insertAt(index, embed, value); + return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); + } + }, { + key: 'insertText', + value: function insertText(index, text) { + var _this4 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + this.scroll.insertAt(index, text); + Object.keys(formats).forEach(function (format) { + _this4.scroll.formatAt(index, text.length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); + } + }, { + key: 'isBlank', + value: function isBlank() { + if (this.scroll.children.length == 0) return true; + if (this.scroll.children.length > 1) return false; + var block = this.scroll.children.head; + if (block.statics.blotName !== _block2.default.blotName) return false; + if (block.children.length > 1) return false; + return block.children.head instanceof _break2.default; + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length) { + var text = this.getText(index, length); + + var _scroll$line3 = this.scroll.line(index + length), + _scroll$line4 = _slicedToArray(_scroll$line3, 2), + line = _scroll$line4[0], + offset = _scroll$line4[1]; + + var suffixLength = 0, + suffix = new _quillDelta2.default(); + if (line != null) { + if (!(line instanceof _code2.default)) { + suffixLength = line.length() - offset; + } else { + suffixLength = line.newlineIndex(offset) - offset + 1; + } + suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); + } + var contents = this.getContents(index, length + suffixLength); + var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); + var delta = new _quillDelta2.default().retain(index).concat(diff); + return this.applyDelta(delta); + } + }, { + key: 'update', + value: function update(change) { + var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + + var oldDelta = this.delta; + if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) { + // Optimization for character changes + var textBlot = _parchment2.default.find(mutations[0].target); + var formats = (0, _block.bubbleFormats)(textBlot); + var index = textBlot.offset(this.scroll); + var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); + var oldText = new _quillDelta2.default().insert(oldValue); + var newText = new _quillDelta2.default().insert(textBlot.value()); + var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); + change = diffDelta.reduce(function (delta, op) { + if (op.insert) { + return delta.insert(op.insert, formats); + } else { + return delta.push(op); + } + }, new _quillDelta2.default()); + this.delta = oldDelta.compose(change); + } else { + this.delta = this.getDelta(); + if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { + change = oldDelta.diff(this.delta, cursorIndex); + } + } + return change; + } + }]); + + return Editor; +}(); + +function combineFormats(formats, combined) { + return Object.keys(combined).reduce(function (merged, name) { + if (formats[name] == null) return merged; + if (combined[name] === formats[name]) { + merged[name] = combined[name]; + } else if (Array.isArray(combined[name])) { + if (combined[name].indexOf(formats[name]) < 0) { + merged[name] = combined[name].concat([formats[name]]); + } + } else { + merged[name] = [combined[name], formats[name]]; + } + return merged; + }, {}); +} + +function normalizeDelta(delta) { + return delta.reduce(function (delta, op) { + if (op.insert === 1) { + var attributes = (0, _clone2.default)(op.attributes); + delete attributes['image']; + return delta.insert({ image: op.attributes.image }, attributes); + } + if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { + op = (0, _clone2.default)(op); + if (op.attributes.list) { + op.attributes.list = 'ordered'; + } else { + op.attributes.list = 'bullet'; + delete op.attributes.bullet; + } + } + if (typeof op.insert === 'string') { + var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + return delta.insert(text, op.attributes); + } + return delta.push(op); + }, new _quillDelta2.default()); +} + +exports.default = Editor; + +/***/ }), /* 15 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Range = undefined; - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var format_1 = __webpack_require__(7); - var Registry = __webpack_require__(6); - var BlockBlot = (function (_super) { - __extends(BlockBlot, _super); - function BlockBlot() { - _super.apply(this, arguments); - } - BlockBlot.formats = function (domNode) { - var tagName = Registry.query(BlockBlot.blotName).tagName; - if (domNode.tagName === tagName) - return undefined; - return _super.formats.call(this, domNode); - }; - BlockBlot.prototype.format = function (name, value) { - if (Registry.query(name, Registry.Scope.BLOCK) == null) { - return; - } - else if (name === this.statics.blotName && !value) { - this.replaceWith(BlockBlot.blotName); - } - else { - _super.prototype.format.call(this, name, value); - } - }; - BlockBlot.prototype.formatAt = function (index, length, name, value) { - if (Registry.query(name, Registry.Scope.BLOCK) != null) { - this.format(name, value); - } - else { - _super.prototype.formatAt.call(this, index, length, name, value); - } - }; - BlockBlot.prototype.insertAt = function (index, value, def) { - if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { - // Insert text or inline - _super.prototype.insertAt.call(this, index, value, def); - } - else { - var after = this.split(index); - var blot = Registry.create(value, def); - after.parent.insertBefore(blot, after); - } - }; - BlockBlot.blotName = 'block'; - BlockBlot.scope = Registry.Scope.BLOCK_BLOT; - BlockBlot.tagName = 'P'; - return BlockBlot; - }(format_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = BlockBlot; +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -/***/ }, +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill:selection'); + +var Range = function Range(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + _classCallCheck(this, Range); + + this.index = index; + this.length = length; +}; + +var Selection = function () { + function Selection(scroll, emitter) { + var _this = this; + + _classCallCheck(this, Selection); + + this.emitter = emitter; + this.scroll = scroll; + this.composing = false; + this.mouseDown = false; + this.root = this.scroll.domNode; + this.cursor = _parchment2.default.create('cursor', this); + // savedRange is last non-null range + this.lastRange = this.savedRange = new Range(0, 0); + this.handleComposition(); + this.handleDragging(); + this.emitter.listenDOM('selectionchange', document, function () { + if (!_this.mouseDown) { + setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1); + } + }); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { + if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { + _this.update(_emitter4.default.sources.SILENT); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { + if (!_this.hasFocus()) return; + var native = _this.getNativeRange(); + if (native == null) return; + if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle + // TODO unclear if this has negative side effects + _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { + try { + _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); + } catch (ignored) {} + }); + }); + this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) { + if (context.range) { + var _context$range = context.range, + startNode = _context$range.startNode, + startOffset = _context$range.startOffset, + endNode = _context$range.endNode, + endOffset = _context$range.endOffset; + + _this.setNativeRange(startNode, startOffset, endNode, endOffset); + } + }); + this.update(_emitter4.default.sources.SILENT); + } + + _createClass(Selection, [{ + key: 'handleComposition', + value: function handleComposition() { + var _this2 = this; + + this.root.addEventListener('compositionstart', function () { + _this2.composing = true; + }); + this.root.addEventListener('compositionend', function () { + _this2.composing = false; + if (_this2.cursor.parent) { + var range = _this2.cursor.restore(); + if (!range) return; + setTimeout(function () { + _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset); + }, 1); + } + }); + } + }, { + key: 'handleDragging', + value: function handleDragging() { + var _this3 = this; + + this.emitter.listenDOM('mousedown', document.body, function () { + _this3.mouseDown = true; + }); + this.emitter.listenDOM('mouseup', document.body, function () { + _this3.mouseDown = false; + _this3.update(_emitter4.default.sources.USER); + }); + } + }, { + key: 'focus', + value: function focus() { + if (this.hasFocus()) return; + this.root.focus(); + this.setRange(this.savedRange); + } + }, { + key: 'format', + value: function format(_format, value) { + if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return; + this.scroll.update(); + var nativeRange = this.getNativeRange(); + if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; + if (nativeRange.start.node !== this.cursor.textNode) { + var blot = _parchment2.default.find(nativeRange.start.node, false); + if (blot == null) return; + // TODO Give blot ability to not split + if (blot instanceof _parchment2.default.Leaf) { + var after = blot.split(nativeRange.start.offset); + blot.parent.insertBefore(this.cursor, after); + } else { + blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen + } + this.cursor.attach(); + } + this.cursor.format(_format, value); + this.scroll.optimize(); + this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); + this.update(); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var scrollLength = this.scroll.length(); + index = Math.min(index, scrollLength - 1); + length = Math.min(index + length, scrollLength - 1) - index; + var node = void 0, + _scroll$leaf = this.scroll.leaf(index), + _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), + leaf = _scroll$leaf2[0], + offset = _scroll$leaf2[1]; + if (leaf == null) return null; + + var _leaf$position = leaf.position(offset, true); + + var _leaf$position2 = _slicedToArray(_leaf$position, 2); + + node = _leaf$position2[0]; + offset = _leaf$position2[1]; + + var range = document.createRange(); + if (length > 0) { + range.setStart(node, offset); + + var _scroll$leaf3 = this.scroll.leaf(index + length); + + var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); + + leaf = _scroll$leaf4[0]; + offset = _scroll$leaf4[1]; + + if (leaf == null) return null; + + var _leaf$position3 = leaf.position(offset, true); + + var _leaf$position4 = _slicedToArray(_leaf$position3, 2); + + node = _leaf$position4[0]; + offset = _leaf$position4[1]; + + range.setEnd(node, offset); + return range.getBoundingClientRect(); + } else { + var side = 'left'; + var rect = void 0; + if (node instanceof Text) { + if (offset < node.data.length) { + range.setStart(node, offset); + range.setEnd(node, offset + 1); + } else { + range.setStart(node, offset - 1); + range.setEnd(node, offset); + side = 'right'; + } + rect = range.getBoundingClientRect(); + } else { + rect = leaf.domNode.getBoundingClientRect(); + if (offset > 0) side = 'right'; + } + return { + bottom: rect.top + rect.height, + height: rect.height, + left: rect[side], + right: rect[side], + top: rect.top, + width: 0 + }; + } + } + }, { + key: 'getNativeRange', + value: function getNativeRange() { + var selection = document.getSelection(); + if (selection == null || selection.rangeCount <= 0) return null; + var nativeRange = selection.getRangeAt(0); + if (nativeRange == null) return null; + var range = this.normalizeNative(nativeRange); + debug.info('getNativeRange', range); + return range; + } + }, { + key: 'getRange', + value: function getRange() { + var normalized = this.getNativeRange(); + if (normalized == null) return [null, null]; + var range = this.normalizedToRange(normalized); + return [range, normalized]; + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return document.activeElement === this.root; + } + }, { + key: 'normalizedToRange', + value: function normalizedToRange(range) { + var _this4 = this; + + var positions = [[range.start.node, range.start.offset]]; + if (!range.native.collapsed) { + positions.push([range.end.node, range.end.offset]); + } + var indexes = positions.map(function (position) { + var _position = _slicedToArray(position, 2), + node = _position[0], + offset = _position[1]; + + var blot = _parchment2.default.find(node, true); + var index = blot.offset(_this4.scroll); + if (offset === 0) { + return index; + } else if (blot instanceof _parchment2.default.Container) { + return index + blot.length(); + } else { + return index + blot.index(node, offset); + } + }); + var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1); + var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes))); + return new Range(start, end - start); + } + }, { + key: 'normalizeNative', + value: function normalizeNative(nativeRange) { + if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { + return null; + } + var range = { + start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, + end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, + native: nativeRange + }; + [range.start, range.end].forEach(function (position) { + var node = position.node, + offset = position.offset; + while (!(node instanceof Text) && node.childNodes.length > 0) { + if (node.childNodes.length > offset) { + node = node.childNodes[offset]; + offset = 0; + } else if (node.childNodes.length === offset) { + node = node.lastChild; + offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; + } else { + break; + } + } + position.node = node, position.offset = offset; + }); + return range; + } + }, { + key: 'rangeToNative', + value: function rangeToNative(range) { + var _this5 = this; + + var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; + var args = []; + var scrollLength = this.scroll.length(); + indexes.forEach(function (index, i) { + index = Math.min(scrollLength - 1, index); + var node = void 0, + _scroll$leaf5 = _this5.scroll.leaf(index), + _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), + leaf = _scroll$leaf6[0], + offset = _scroll$leaf6[1]; + var _leaf$position5 = leaf.position(offset, i !== 0); + + var _leaf$position6 = _slicedToArray(_leaf$position5, 2); + + node = _leaf$position6[0]; + offset = _leaf$position6[1]; + + args.push(node, offset); + }); + if (args.length < 2) { + args = args.concat(args); + } + return args; + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView(scrollingContainer) { + var range = this.lastRange; + if (range == null) return; + var bounds = this.getBounds(range.index, range.length); + if (bounds == null) return; + var limit = this.scroll.length() - 1; + + var _scroll$line = this.scroll.line(Math.min(range.index, limit)), + _scroll$line2 = _slicedToArray(_scroll$line, 1), + first = _scroll$line2[0]; + + var last = first; + if (range.length > 0) { + var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit)); + + var _scroll$line4 = _slicedToArray(_scroll$line3, 1); + + last = _scroll$line4[0]; + } + if (first == null || last == null) return; + var scrollBounds = scrollingContainer.getBoundingClientRect(); + if (bounds.top < scrollBounds.top) { + scrollingContainer.scrollTop -= scrollBounds.top - bounds.top; + } else if (bounds.bottom > scrollBounds.bottom) { + scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom; + } + } + }, { + key: 'setNativeRange', + value: function setNativeRange(startNode, startOffset) { + var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; + var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; + var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); + if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { + return; + } + var selection = document.getSelection(); + if (selection == null) return; + if (startNode != null) { + if (!this.hasFocus()) this.root.focus(); + var native = (this.getNativeRange() || {}).native; + if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) { + + if (startNode.tagName == "BR") { + startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode); + startNode = startNode.parentNode; + } + if (endNode.tagName == "BR") { + endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode); + endNode = endNode.parentNode; + } + var range = document.createRange(); + range.setStart(startNode, startOffset); + range.setEnd(endNode, endOffset); + selection.removeAllRanges(); + selection.addRange(range); + } + } else { + selection.removeAllRanges(); + this.root.blur(); + document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) + } + } + }, { + key: 'setRange', + value: function setRange(range) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + if (typeof force === 'string') { + source = force; + force = false; + } + debug.info('setRange', range); + if (range != null) { + var args = this.rangeToNative(range); + this.setNativeRange.apply(this, _toConsumableArray(args).concat([force])); + } else { + this.setNativeRange(null); + } + this.update(source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var oldRange = this.lastRange; + + var _getRange = this.getRange(), + _getRange2 = _slicedToArray(_getRange, 2), + lastRange = _getRange2[0], + nativeRange = _getRange2[1]; + + this.lastRange = lastRange; + if (this.lastRange != null) { + this.savedRange = this.lastRange; + } + if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { + var _emitter; + + if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { + this.cursor.restore(); + } + var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + } + }]); + + return Selection; +}(); + +function contains(parent, descendant) { + try { + // Firefox inserts inaccessible nodes around video elements + descendant.parentNode; + } catch (e) { + return false; + } + // IE11 has bug with Text nodes + // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect + if (descendant instanceof Text) { + descendant = descendant.parentNode; + } + return parent.contains(descendant); +} + +exports.Range = Range; +exports.default = Selection; + +/***/ }), /* 16 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var leaf_1 = __webpack_require__(12); - var EmbedBlot = (function (_super) { - __extends(EmbedBlot, _super); - function EmbedBlot() { - _super.apply(this, arguments); - } - EmbedBlot.formats = function (domNode) { - return undefined; - }; - EmbedBlot.prototype.format = function (name, value) { - // super.formatAt wraps, which is what we want in general, - // but this allows subclasses to overwrite for formats - // that just apply to particular embeds - _super.prototype.formatAt.call(this, 0, this.length(), name, value); - }; - EmbedBlot.prototype.formatAt = function (index, length, name, value) { - if (index === 0 && length === this.length()) { - this.format(name, value); - } - else { - _super.prototype.formatAt.call(this, index, length, name, value); - } - }; - EmbedBlot.prototype.formats = function () { - return this.statics.formats(this.domNode); - }; - return EmbedBlot; - }(leaf_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = EmbedBlot; +"use strict"; -/***/ }, -/* 17 */ -/***/ function(module, exports, __webpack_require__) { +Object.defineProperty(exports, "__esModule", { + value: true +}); - "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var leaf_1 = __webpack_require__(12); - var Registry = __webpack_require__(6); - var TextBlot = (function (_super) { - __extends(TextBlot, _super); - function TextBlot(node) { - _super.call(this, node); - this.text = this.statics.value(this.domNode); - } - TextBlot.create = function (value) { - return document.createTextNode(value); - }; - TextBlot.value = function (domNode) { - return domNode.data; - }; - TextBlot.prototype.deleteAt = function (index, length) { - this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); - }; - TextBlot.prototype.index = function (node, offset) { - if (this.domNode === node) { - return offset; - } - return -1; - }; - TextBlot.prototype.insertAt = function (index, value, def) { - if (def == null) { - this.text = this.text.slice(0, index) + value + this.text.slice(index); - this.domNode.data = this.text; - } - else { - _super.prototype.insertAt.call(this, index, value, def); - } - }; - TextBlot.prototype.length = function () { - return this.text.length; - }; - TextBlot.prototype.optimize = function () { - _super.prototype.optimize.call(this); - this.text = this.statics.value(this.domNode); - if (this.text.length === 0) { - this.remove(); - } - else if (this.next instanceof TextBlot && this.next.prev === this) { - this.insertAt(this.length(), this.next.value()); - this.next.remove(); - } - }; - TextBlot.prototype.position = function (index, inclusive) { - if (inclusive === void 0) { inclusive = false; } - return [this.domNode, index]; - }; - TextBlot.prototype.split = function (index, force) { - if (force === void 0) { force = false; } - if (!force) { - if (index === 0) - return this; - if (index === this.length()) - return this.next; - } - var after = Registry.create(this.domNode.splitText(index)); - this.parent.insertBefore(after, this.next); - this.text = this.statics.value(this.domNode); - return after; - }; - TextBlot.prototype.update = function (mutations) { - var _this = this; - if (mutations.some(function (mutation) { - return mutation.type === 'characterData' && mutation.target === _this.domNode; - })) { - this.text = this.statics.value(this.domNode); - } - }; - TextBlot.prototype.value = function () { - return this.text; - }; - TextBlot.blotName = 'text'; - TextBlot.scope = Registry.Scope.INLINE_BLOT; - return TextBlot; - }(leaf_1.default)); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = TextBlot; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -/***/ }, -/* 18 */ -/***/ function(module, exports, __webpack_require__) { +var _parchment = __webpack_require__(0); - 'use strict'; +var _parchment2 = _interopRequireDefault(_parchment); - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.overload = exports.expandConfig = undefined; - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - __webpack_require__(19); - - var _quillDelta = __webpack_require__(20); - - var _quillDelta2 = _interopRequireDefault(_quillDelta); - - var _editor = __webpack_require__(27); - - var _editor2 = _interopRequireDefault(_editor); - - var _emitter3 = __webpack_require__(36); - - var _emitter4 = _interopRequireDefault(_emitter3); - - var _module = __webpack_require__(43); - - var _module2 = _interopRequireDefault(_module); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _selection = __webpack_require__(44); - - var _selection2 = _interopRequireDefault(_selection); - - var _extend = __webpack_require__(30); - - var _extend2 = _interopRequireDefault(_extend); - - var _logger = __webpack_require__(38); - - var _logger2 = _interopRequireDefault(_logger); - - var _theme = __webpack_require__(45); - - var _theme2 = _interopRequireDefault(_theme); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var debug = (0, _logger2.default)('quill'); - - var Quill = function () { - _createClass(Quill, null, [{ - key: 'debug', - value: function debug(limit) { - if (limit === true) { - limit = 'log'; - } - _logger2.default.level(limit); - } - }, { - key: 'import', - value: function _import(name) { - if (this.imports[name] == null) { - debug.error('Cannot import ' + name + '. Are you sure it was registered?'); - } - return this.imports[name]; - } - }, { - key: 'register', - value: function register(path, target) { - var _this = this; - - var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (typeof path !== 'string') { - var name = path.attrName || path.blotName; - if (typeof name === 'string') { - // register(Blot | Attributor, overwrite) - this.register('formats/' + name, path, target); - } else { - Object.keys(path).forEach(function (key) { - _this.register(key, path[key], target); - }); - } - } else { - if (this.imports[path] != null && !overwrite) { - debug.warn('Overwriting ' + path + ' with', target); - } - this.imports[path] = target; - if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { - _parchment2.default.register(target); - } - } - } - }]); - - function Quill(container) { - var _this2 = this; - - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, Quill); - - this.options = expandConfig(container, options); - this.container = this.options.container; - if (this.container == null) { - return debug.error('Invalid Quill container', container); - } - if (this.options.debug) { - Quill.debug(this.options.debug); - } - var html = this.container.innerHTML.trim(); - this.container.classList.add('ql-container'); - this.container.innerHTML = ''; - this.root = this.addContainer('ql-editor'); - this.root.classList.add('ql-blank'); - this.emitter = new _emitter4.default(); - this.scroll = _parchment2.default.create(this.root, { - emitter: this.emitter, - whitelist: this.options.formats - }); - this.editor = new _editor2.default(this.scroll); - this.selection = new _selection2.default(this.scroll, this.emitter); - this.theme = new this.options.theme(this, this.options); - this.keyboard = this.theme.addModule('keyboard'); - this.clipboard = this.theme.addModule('clipboard'); - this.history = this.theme.addModule('history'); - this.theme.init(); - this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { - if (type === _emitter4.default.events.TEXT_CHANGE) { - _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); - } - }); - this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { - var range = _this2.selection.lastRange; - var index = range && range.length === 0 ? range.index : undefined; - modify.call(_this2, function () { - return _this2.editor.update(null, mutations, index); - }, source); - }); - var contents = this.clipboard.convert('
    ' + html + '


    '); - this.setContents(contents); - this.history.clear(); - if (this.options.placeholder) { - this.root.setAttribute('data-placeholder', this.options.placeholder); - } - if (this.options.readOnly) { - this.disable(); - } - } - - _createClass(Quill, [{ - key: 'addContainer', - value: function addContainer(container) { - var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - if (typeof container === 'string') { - var className = container; - container = document.createElement('div'); - container.classList.add(className); - } - this.container.insertBefore(container, refNode); - return container; - } - }, { - key: 'blur', - value: function blur() { - this.selection.setRange(null); - } - }, { - key: 'deleteText', - value: function deleteText(index, length, source) { - var _this3 = this; - - var _overload = overload(index, length, source); - - var _overload2 = _slicedToArray(_overload, 4); - - index = _overload2[0]; - length = _overload2[1]; - source = _overload2[3]; - - return modify.call(this, function () { - return _this3.editor.deleteText(index, length); - }, source, index, -1 * length); - } - }, { - key: 'disable', - value: function disable() { - this.enable(false); - } - }, { - key: 'enable', - value: function enable() { - var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - - this.scroll.enable(enabled); - this.container.classList.toggle('ql-disabled', !enabled); - if (!enabled) { - this.blur(); - } - } - }, { - key: 'focus', - value: function focus() { - this.selection.focus(); - this.selection.scrollIntoView(); - } - }, { - key: 'format', - value: function format(name, value) { - var _this4 = this; - - var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; - - return modify.call(this, function () { - var range = _this4.getSelection(true); - var change = new _quillDelta2.default(); - if (range == null) { - return change; - } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { - change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); - } else if (range.length === 0) { - _this4.selection.format(name, value); - return change; - } else { - change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); - } - _this4.setSelection(range, _emitter4.default.sources.SILENT); - return change; - }, source); - } - }, { - key: 'formatLine', - value: function formatLine(index, length, name, value, source) { - var _this5 = this; - - var formats = void 0; - - var _overload3 = overload(index, length, name, value, source); - - var _overload4 = _slicedToArray(_overload3, 4); - - index = _overload4[0]; - length = _overload4[1]; - formats = _overload4[2]; - source = _overload4[3]; - - return modify.call(this, function () { - return _this5.editor.formatLine(index, length, formats); - }, source, index, 0); - } - }, { - key: 'formatText', - value: function formatText(index, length, name, value, source) { - var _this6 = this; - - var formats = void 0; - - var _overload5 = overload(index, length, name, value, source); - - var _overload6 = _slicedToArray(_overload5, 4); - - index = _overload6[0]; - length = _overload6[1]; - formats = _overload6[2]; - source = _overload6[3]; - - return modify.call(this, function () { - return _this6.editor.formatText(index, length, formats); - }, source, index, 0); - } - }, { - key: 'getBounds', - value: function getBounds(index) { - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - if (typeof index === 'number') { - return this.selection.getBounds(index, length); - } else { - return this.selection.getBounds(index.index, index.length); - } - } - }, { - key: 'getContents', - value: function getContents() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; - - var _overload7 = overload(index, length); - - var _overload8 = _slicedToArray(_overload7, 2); - - index = _overload8[0]; - length = _overload8[1]; - - return this.editor.getContents(index, length); - } - }, { - key: 'getFormat', - value: function getFormat() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(); - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - if (typeof index === 'number') { - return this.editor.getFormat(index, length); - } else { - return this.editor.getFormat(index.index, index.length); - } - } - }, { - key: 'getLength', - value: function getLength() { - return this.scroll.length(); - } - }, { - key: 'getModule', - value: function getModule(name) { - return this.theme.modules[name]; - } - }, { - key: 'getSelection', - value: function getSelection() { - var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - - if (focus) this.focus(); - this.update(); // Make sure we access getRange with editor in consistent state - return this.selection.getRange()[0]; - } - }, { - key: 'getText', - value: function getText() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; - - var _overload9 = overload(index, length); - - var _overload10 = _slicedToArray(_overload9, 2); - - index = _overload10[0]; - length = _overload10[1]; - - return this.editor.getText(index, length); - } - }, { - key: 'hasFocus', - value: function hasFocus() { - return this.selection.hasFocus(); - } - }, { - key: 'insertEmbed', - value: function insertEmbed(index, embed, value) { - var _this7 = this; - - var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; - - return modify.call(this, function () { - return _this7.editor.insertEmbed(index, embed, value); - }, source, index); - } - }, { - key: 'insertText', - value: function insertText(index, text, name, value, source) { - var _this8 = this; - - var formats = void 0; - - var _overload11 = overload(index, 0, name, value, source); - - var _overload12 = _slicedToArray(_overload11, 4); - - index = _overload12[0]; - formats = _overload12[2]; - source = _overload12[3]; - - return modify.call(this, function () { - return _this8.editor.insertText(index, text, formats); - }, source, index, text.length); - } - }, { - key: 'isEnabled', - value: function isEnabled() { - return !this.container.classList.contains('ql-disabled'); - } - }, { - key: 'off', - value: function off() { - return this.emitter.off.apply(this.emitter, arguments); - } - }, { - key: 'on', - value: function on() { - return this.emitter.on.apply(this.emitter, arguments); - } - }, { - key: 'once', - value: function once() { - return this.emitter.once.apply(this.emitter, arguments); - } - }, { - key: 'pasteHTML', - value: function pasteHTML(index, html, source) { - this.clipboard.dangerouslyPasteHTML(index, html, source); - } - }, { - key: 'removeFormat', - value: function removeFormat(index, length, source) { - var _this9 = this; - - var _overload13 = overload(index, length, source); - - var _overload14 = _slicedToArray(_overload13, 4); - - index = _overload14[0]; - length = _overload14[1]; - source = _overload14[3]; - - return modify.call(this, function () { - return _this9.editor.removeFormat(index, length); - }, source, index); - } - }, { - key: 'setContents', - value: function setContents(delta) { - var _this10 = this; - - var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; - - return modify.call(this, function () { - delta = new _quillDelta2.default(delta); - var length = _this10.getLength(); - var deleted = _this10.editor.deleteText(0, length); - var applied = _this10.editor.applyDelta(delta); - var lastOp = applied.ops[applied.ops.length - 1]; - if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { - _this10.editor.deleteText(_this10.getLength() - 1, 1); - applied.delete(1); - } - var ret = deleted.compose(applied); - return ret; - }, source); - } - }, { - key: 'setSelection', - value: function setSelection(index, length, source) { - if (index == null) { - this.selection.setRange(null, length || Quill.sources.API); - } else { - var _overload15 = overload(index, length, source); - - var _overload16 = _slicedToArray(_overload15, 4); - - index = _overload16[0]; - length = _overload16[1]; - source = _overload16[3]; - - this.selection.setRange(new _selection.Range(index, length), source); - } - this.selection.scrollIntoView(); - } - }, { - key: 'setText', - value: function setText(text) { - var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; - - var delta = new _quillDelta2.default().insert(text); - return this.setContents(delta, source); - } - }, { - key: 'update', - value: function update() { - var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; - - var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes - this.selection.update(source); - return change; - } - }, { - key: 'updateContents', - value: function updateContents(delta) { - var _this11 = this; - - var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; - - return modify.call(this, function () { - delta = new _quillDelta2.default(delta); - return _this11.editor.applyDelta(delta, source); - }, source, true); - } - }]); - - return Quill; - }(); - - Quill.DEFAULTS = { - bounds: null, - formats: null, - modules: {}, - placeholder: '', - readOnly: false, - strict: true, - theme: 'default' - }; - Quill.events = _emitter4.default.events; - Quill.sources = _emitter4.default.sources; - // eslint-disable-next-line no-undef - Quill.version = false ? 'dev' : ("1.1.5"); - - Quill.imports = { - 'delta': _quillDelta2.default, - 'parchment': _parchment2.default, - 'core/module': _module2.default, - 'core/theme': _theme2.default - }; - - function expandConfig(container, userConfig) { - userConfig = (0, _extend2.default)(true, { - container: container, - modules: { - clipboard: true, - keyboard: true, - history: true - } - }, userConfig); - if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { - userConfig.theme = _theme2.default; - } else { - userConfig.theme = Quill.import('themes/' + userConfig.theme); - if (userConfig.theme == null) { - throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); - } - } - var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); - [themeConfig, userConfig].forEach(function (config) { - config.modules = config.modules || {}; - Object.keys(config.modules).forEach(function (module) { - if (config.modules[module] === true) { - config.modules[module] = {}; - } - }); - }); - var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); - var moduleConfig = moduleNames.reduce(function (config, name) { - var moduleClass = Quill.import('modules/' + name); - if (moduleClass == null) { - debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); - } else { - config[name] = moduleClass.DEFAULTS || {}; - } - return config; - }, {}); - // Special case toolbar shorthand - if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { - userConfig.modules.toolbar = { - container: userConfig.modules.toolbar - }; - } - userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); - ['bounds', 'container'].forEach(function (key) { - if (typeof userConfig[key] === 'string') { - userConfig[key] = document.querySelector(userConfig[key]); - } - }); - userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { - if (userConfig.modules[name]) { - config[name] = userConfig.modules[name]; - } - return config; - }, {}); - return userConfig; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Break = function (_Parchment$Embed) { + _inherits(Break, _Parchment$Embed); + + function Break() { + _classCallCheck(this, Break); + + return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); + } + + _createClass(Break, [{ + key: 'insertInto', + value: function insertInto(parent, ref) { + if (parent.children.length === 0) { + _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); + } else { + this.remove(); + } + } + }, { + key: 'length', + value: function length() { + return 0; + } + }, { + key: 'value', + value: function value() { + return ''; + } + }], [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + return Break; +}(_parchment2.default.Embed); - // Handle selection preservation and TEXT_CHANGE emission - // common to modification APIs - function modify(modifier, source, index, shift) { - if (!this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { - return new _quillDelta2.default(); - } - var range = index == null ? null : this.getSelection(); - var oldDelta = this.editor.delta; - var change = modifier(); - if (range != null) { - if (index === true) index = range.index; - if (shift == null) { - range = shiftRange(range, change, source); - } else if (shift !== 0) { - range = shiftRange(range, index, shift, source); - } - this.setSelection(range, _emitter4.default.sources.SILENT); - } - if (change.length() > 0) { - var _emitter; - - var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; - (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); - if (source !== _emitter4.default.sources.SILENT) { - var _emitter2; - - (_emitter2 = this.emitter).emit.apply(_emitter2, args); - } - } - return change; - } +Break.blotName = 'break'; +Break.tagName = 'BR'; - function overload(index, length, name, value, source) { - var formats = {}; - if (typeof index.index === 'number' && typeof index.length === 'number') { - // Allow for throwaway end (used by insertText/insertEmbed) - if (typeof length !== 'number') { - source = value, value = name, name = length, length = index.length, index = index.index; - } else { - length = index.length, index = index.index; - } - } else if (typeof length !== 'number') { - source = value, value = name, name = length, length = 0; - } - // Handle format being object, two format name/value strings or excluded - if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { - formats = name; - source = value; - } else if (typeof name === 'string') { - if (value != null) { - formats[name] = value; - } else { - source = name; - } - } - // Handle optional source - source = source || _emitter4.default.sources.API; - return [index, length, formats, source]; - } +exports.default = Break; - function shiftRange(range, index, length, source) { - if (range == null) return null; - var start = void 0, - end = void 0; - if (index instanceof _quillDelta2.default) { - var _map = [range.index, range.index + range.length].map(function (pos) { - return index.transformPosition(pos, source === _emitter4.default.sources.USER); - }); - - var _map2 = _slicedToArray(_map, 2); - - start = _map2[0]; - end = _map2[1]; - } else { - var _map3 = [range.index, range.index + range.length].map(function (pos) { - if (pos < index || pos === index && source !== _emitter4.default.sources.USER) return pos; - if (length >= 0) { - return pos + length; - } else { - return Math.max(index, pos + length); - } - }); - - var _map4 = _slicedToArray(_map3, 2); - - start = _map4[0]; - end = _map4[1]; - } - return new _selection.Range(start, end - start); - } +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { - exports.expandConfig = expandConfig; - exports.overload = overload; - exports.default = Quill; +"use strict"; -/***/ }, -/* 19 */ -/***/ function(module, exports) { +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var linked_list_1 = __webpack_require__(44); +var shadow_1 = __webpack_require__(30); +var Registry = __webpack_require__(1); +var ContainerBlot = /** @class */ (function (_super) { + __extends(ContainerBlot, _super); + function ContainerBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.build(); + return _this; + } + ContainerBlot.prototype.appendChild = function (other) { + this.insertBefore(other); + }; + ContainerBlot.prototype.attach = function () { + _super.prototype.attach.call(this); + this.children.forEach(function (child) { + child.attach(); + }); + }; + ContainerBlot.prototype.build = function () { + var _this = this; + this.children = new linked_list_1.default(); + // Need to be reversed for if DOM nodes already in order + [].slice + .call(this.domNode.childNodes) + .reverse() + .forEach(function (node) { + try { + var child = makeBlot(node); + _this.insertBefore(child, _this.children.head || undefined); + } + catch (err) { + if (err instanceof Registry.ParchmentError) + return; + else + throw err; + } + }); + }; + ContainerBlot.prototype.deleteAt = function (index, length) { + if (index === 0 && length === this.length()) { + return this.remove(); + } + this.children.forEachAt(index, length, function (child, offset, length) { + child.deleteAt(offset, length); + }); + }; + ContainerBlot.prototype.descendant = function (criteria, index) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + return [child, offset]; + } + else if (child instanceof ContainerBlot) { + return child.descendant(criteria, offset); + } + else { + return [null, -1]; + } + }; + ContainerBlot.prototype.descendants = function (criteria, index, length) { + if (index === void 0) { index = 0; } + if (length === void 0) { length = Number.MAX_VALUE; } + var descendants = []; + var lengthLeft = length; + this.children.forEachAt(index, length, function (child, index, length) { + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + descendants.push(child); + } + if (child instanceof ContainerBlot) { + descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); + } + lengthLeft -= length; + }); + return descendants; + }; + ContainerBlot.prototype.detach = function () { + this.children.forEach(function (child) { + child.detach(); + }); + _super.prototype.detach.call(this); + }; + ContainerBlot.prototype.formatAt = function (index, length, name, value) { + this.children.forEachAt(index, length, function (child, offset, length) { + child.formatAt(offset, length, name, value); + }); + }; + ContainerBlot.prototype.insertAt = function (index, value, def) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if (child) { + child.insertAt(offset, value, def); + } + else { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + this.appendChild(blot); + } + }; + ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { + if (this.statics.allowedChildren != null && + !this.statics.allowedChildren.some(function (child) { + return childBlot instanceof child; + })) { + throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); + } + childBlot.insertInto(this, refBlot); + }; + ContainerBlot.prototype.length = function () { + return this.children.reduce(function (memo, child) { + return memo + child.length(); + }, 0); + }; + ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { + this.children.forEach(function (child) { + targetParent.insertBefore(child, refNode); + }); + }; + ContainerBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + if (this.children.length === 0) { + if (this.statics.defaultChild != null) { + var child = Registry.create(this.statics.defaultChild); + this.appendChild(child); + child.optimize(context); + } + else { + this.remove(); + } + } + }; + ContainerBlot.prototype.path = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; + var position = [[this, index]]; + if (child instanceof ContainerBlot) { + return position.concat(child.path(offset, inclusive)); + } + else if (child != null) { + position.push([child, offset]); + } + return position; + }; + ContainerBlot.prototype.removeChild = function (child) { + this.children.remove(child); + }; + ContainerBlot.prototype.replace = function (target) { + if (target instanceof ContainerBlot) { + target.moveChildren(this); + } + _super.prototype.replace.call(this, target); + }; + ContainerBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = this.clone(); + this.parent.insertBefore(after, this.next); + this.children.forEachAt(index, this.length(), function (child, offset, length) { + child = child.split(offset, force); + after.appendChild(child); + }); + return after; + }; + ContainerBlot.prototype.unwrap = function () { + this.moveChildren(this.parent, this.next); + this.remove(); + }; + ContainerBlot.prototype.update = function (mutations, context) { + var _this = this; + var addedNodes = []; + var removedNodes = []; + mutations.forEach(function (mutation) { + if (mutation.target === _this.domNode && mutation.type === 'childList') { + addedNodes.push.apply(addedNodes, mutation.addedNodes); + removedNodes.push.apply(removedNodes, mutation.removedNodes); + } + }); + removedNodes.forEach(function (node) { + // Check node has actually been removed + // One exception is Chrome does not immediately remove IFRAMEs + // from DOM but MutationRecord is correct in its reported removal + if (node.parentNode != null && + // @ts-ignore + node.tagName !== 'IFRAME' && + document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return; + } + var blot = Registry.find(node); + if (blot == null) + return; + if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { + blot.detach(); + } + }); + addedNodes + .filter(function (node) { + return node.parentNode == _this.domNode; + }) + .sort(function (a, b) { + if (a === b) + return 0; + if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { + return 1; + } + return -1; + }) + .forEach(function (node) { + var refBlot = null; + if (node.nextSibling != null) { + refBlot = Registry.find(node.nextSibling); + } + var blot = makeBlot(node); + if (blot.next != refBlot || blot.next == null) { + if (blot.parent != null) { + blot.parent.removeChild(_this); + } + _this.insertBefore(blot, refBlot || undefined); + } + }); + }; + return ContainerBlot; +}(shadow_1.default)); +function makeBlot(node) { + var blot = Registry.find(node); + if (blot == null) { + try { + blot = Registry.create(node); + } + catch (e) { + blot = Registry.create(Registry.Scope.INLINE); + [].slice.call(node.childNodes).forEach(function (child) { + // @ts-ignore + blot.domNode.appendChild(child); + }); + if (node.parentNode) { + node.parentNode.replaceChild(blot.domNode, node); + } + blot.attach(); + } + } + return blot; +} +exports.default = ContainerBlot; - 'use strict'; - var elem = document.createElement('div'); - elem.classList.toggle('test-class', false); - if (elem.classList.contains('test-class')) { - (function () { - var _toggle = DOMTokenList.prototype.toggle; - DOMTokenList.prototype.toggle = function (token, force) { - if (arguments.length > 1 && !this.contains(token) === !force) { - return force; - } else { - return _toggle.call(this, token); - } - }; - })(); - } +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { - if (!String.prototype.startsWith) { - String.prototype.startsWith = function (searchString, position) { - position = position || 0; - return this.substr(position, searchString.length) === searchString; - }; - } +"use strict"; - if (!String.prototype.endsWith) { - String.prototype.endsWith = function (searchString, position) { - var subjectString = this.toString(); - if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - var lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - } +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var store_1 = __webpack_require__(31); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var FormatBlot = /** @class */ (function (_super) { + __extends(FormatBlot, _super); + function FormatBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.attributes = new store_1.default(_this.domNode); + return _this; + } + FormatBlot.formats = function (domNode) { + if (typeof this.tagName === 'string') { + return true; + } + else if (Array.isArray(this.tagName)) { + return domNode.tagName.toLowerCase(); + } + return undefined; + }; + FormatBlot.prototype.format = function (name, value) { + var format = Registry.query(name); + if (format instanceof attributor_1.default) { + this.attributes.attribute(format, value); + } + else if (value) { + if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { + this.replaceWith(name, value); + } + } + }; + FormatBlot.prototype.formats = function () { + var formats = this.attributes.values(); + var format = this.statics.formats(this.domNode); + if (format != null) { + formats[this.statics.blotName] = format; + } + return formats; + }; + FormatBlot.prototype.replaceWith = function (name, value) { + var replacement = _super.prototype.replaceWith.call(this, name, value); + this.attributes.copy(replacement); + return replacement; + }; + FormatBlot.prototype.update = function (mutations, context) { + var _this = this; + _super.prototype.update.call(this, mutations, context); + if (mutations.some(function (mutation) { + return mutation.target === _this.domNode && mutation.type === 'attributes'; + })) { + this.attributes.build(); + } + }; + FormatBlot.prototype.wrap = function (name, value) { + var wrapper = _super.prototype.wrap.call(this, name, value); + if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { + this.attributes.move(wrapper); + } + return wrapper; + }; + return FormatBlot; +}(container_1.default)); +exports.default = FormatBlot; - if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, "find", { - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; - } - } - return undefined; - } - }); - } - // Disable resizing in Firefox - document.addEventListener("DOMContentLoaded", function () { - document.execCommand("enableObjectResizing", false, false); - }); +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var shadow_1 = __webpack_require__(30); +var Registry = __webpack_require__(1); +var LeafBlot = /** @class */ (function (_super) { + __extends(LeafBlot, _super); + function LeafBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + LeafBlot.value = function (domNode) { + return true; + }; + LeafBlot.prototype.index = function (node, offset) { + if (this.domNode === node || + this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return Math.min(offset, 1); + } + return -1; + }; + LeafBlot.prototype.position = function (index, inclusive) { + var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); + if (index > 0) + offset += 1; + return [this.parent.domNode, offset]; + }; + LeafBlot.prototype.value = function () { + return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a; + var _a; + }; + LeafBlot.scope = Registry.Scope.INLINE_BLOT; + return LeafBlot; +}(shadow_1.default)); +exports.default = LeafBlot; + -/***/ }, +/***/ }), /* 20 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - var diff = __webpack_require__(21); - var equal = __webpack_require__(22); - var extend = __webpack_require__(25); - var op = __webpack_require__(26); - - - var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() - - - var Delta = function (ops) { - // Assume we are given a well formed ops - if (Array.isArray(ops)) { - this.ops = ops; - } else if (ops != null && Array.isArray(ops.ops)) { - this.ops = ops.ops; - } else { - this.ops = []; - } - }; - - - Delta.prototype.insert = function (text, attributes) { - var newOp = {}; - if (text.length === 0) return this; - newOp.insert = text; - if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { - newOp.attributes = attributes; - } - return this.push(newOp); - }; - - Delta.prototype['delete'] = function (length) { - if (length <= 0) return this; - return this.push({ 'delete': length }); - }; - - Delta.prototype.retain = function (length, attributes) { - if (length <= 0) return this; - var newOp = { retain: length }; - if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { - newOp.attributes = attributes; - } - return this.push(newOp); - }; - - Delta.prototype.push = function (newOp) { - var index = this.ops.length; - var lastOp = this.ops[index - 1]; - newOp = extend(true, {}, newOp); - if (typeof lastOp === 'object') { - if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { - this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; - return this; - } - // Since it does not matter if we insert before or after deleting at the same index, - // always prefer to insert first - if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { - index -= 1; - lastOp = this.ops[index - 1]; - if (typeof lastOp !== 'object') { - this.ops.unshift(newOp); - return this; - } - } - if (equal(newOp.attributes, lastOp.attributes)) { - if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { - this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; - if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes - return this; - } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { - this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; - if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes - return this; - } - } - } - if (index === this.ops.length) { - this.ops.push(newOp); - } else { - this.ops.splice(index, 0, newOp); - } - return this; - }; - - Delta.prototype.filter = function (predicate) { - return this.ops.filter(predicate); - }; - - Delta.prototype.forEach = function (predicate) { - this.ops.forEach(predicate); - }; - - Delta.prototype.map = function (predicate) { - return this.ops.map(predicate); - }; - - Delta.prototype.partition = function (predicate) { - var passed = [], failed = []; - this.forEach(function(op) { - var target = predicate(op) ? passed : failed; - target.push(op); - }); - return [passed, failed]; - }; - - Delta.prototype.reduce = function (predicate, initial) { - return this.ops.reduce(predicate, initial); - }; - - Delta.prototype.chop = function () { - var lastOp = this.ops[this.ops.length - 1]; - if (lastOp && lastOp.retain && !lastOp.attributes) { - this.ops.pop(); - } - return this; - }; - - Delta.prototype.length = function () { - return this.reduce(function (length, elem) { - return length + op.length(elem); - }, 0); - }; - - Delta.prototype.slice = function (start, end) { - start = start || 0; - if (typeof end !== 'number') end = Infinity; - var ops = []; - var iter = op.iterator(this.ops); - var index = 0; - while (index < end && iter.hasNext()) { - var nextOp; - if (index < start) { - nextOp = iter.next(start - index); - } else { - nextOp = iter.next(end - index); - ops.push(nextOp); - } - index += op.length(nextOp); - } - return new Delta(ops); - }; - - - Delta.prototype.compose = function (other) { - var thisIter = op.iterator(this.ops); - var otherIter = op.iterator(other.ops); - var delta = new Delta(); - while (thisIter.hasNext() || otherIter.hasNext()) { - if (otherIter.peekType() === 'insert') { - delta.push(otherIter.next()); - } else if (thisIter.peekType() === 'delete') { - delta.push(thisIter.next()); - } else { - var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); - var thisOp = thisIter.next(length); - var otherOp = otherIter.next(length); - if (typeof otherOp.retain === 'number') { - var newOp = {}; - if (typeof thisOp.retain === 'number') { - newOp.retain = length; - } else { - newOp.insert = thisOp.insert; - } - // Preserve null when composing with a retain, otherwise remove it for inserts - var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); - if (attributes) newOp.attributes = attributes; - delta.push(newOp); - // Other op should be delete, we could be an insert or retain - // Insert + delete cancels out - } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { - delta.push(otherOp); - } - } - } - return delta.chop(); - }; - - Delta.prototype.concat = function (other) { - var delta = new Delta(this.ops.slice()); - if (other.ops.length > 0) { - delta.push(other.ops[0]); - delta.ops = delta.ops.concat(other.ops.slice(1)); - } - return delta; - }; - - Delta.prototype.diff = function (other, index) { - if (this.ops === other.ops) { - return new Delta(); - } - var strings = [this, other].map(function (delta) { - return delta.map(function (op) { - if (op.insert != null) { - return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; - } - var prep = (delta === other) ? 'on' : 'with'; - throw new Error('diff() called ' + prep + ' non-document'); - }).join(''); - }); - var delta = new Delta(); - var diffResult = diff(strings[0], strings[1], index); - var thisIter = op.iterator(this.ops); - var otherIter = op.iterator(other.ops); - diffResult.forEach(function (component) { - var length = component[1].length; - while (length > 0) { - var opLength = 0; - switch (component[0]) { - case diff.INSERT: - opLength = Math.min(otherIter.peekLength(), length); - delta.push(otherIter.next(opLength)); - break; - case diff.DELETE: - opLength = Math.min(length, thisIter.peekLength()); - thisIter.next(opLength); - delta['delete'](opLength); - break; - case diff.EQUAL: - opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); - var thisOp = thisIter.next(opLength); - var otherOp = otherIter.next(opLength); - if (equal(thisOp.insert, otherOp.insert)) { - delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); - } else { - delta.push(otherOp)['delete'](opLength); - } - break; - } - length -= opLength; - } - }); - return delta.chop(); - }; - - Delta.prototype.eachLine = function (predicate, newline) { - newline = newline || '\n'; - var iter = op.iterator(this.ops); - var line = new Delta(); - while (iter.hasNext()) { - if (iter.peekType() !== 'insert') return; - var thisOp = iter.peek(); - var start = op.length(thisOp) - iter.peekLength(); - var 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 { - predicate(line, iter.next(1).attributes || {}); - line = new Delta(); - } - } - if (line.length() > 0) { - predicate(line, {}); - } - }; - - Delta.prototype.transform = function (other, priority) { - priority = !!priority; - if (typeof other === 'number') { - return this.transformPosition(other, priority); - } - var thisIter = op.iterator(this.ops); - var otherIter = op.iterator(other.ops); - var delta = new Delta(); - while (thisIter.hasNext() || otherIter.hasNext()) { - if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { - delta.retain(op.length(thisIter.next())); - } else if (otherIter.peekType() === 'insert') { - delta.push(otherIter.next()); - } else { - var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); - var thisOp = thisIter.next(length); - var otherOp = otherIter.next(length); - if (thisOp['delete']) { - // Our delete either makes their delete redundant or removes their retain - continue; - } else if (otherOp['delete']) { - delta.push(otherOp); - } else { - // We retain either their retain or insert - delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); - } - } - } - return delta.chop(); - }; - - Delta.prototype.transformPosition = function (index, priority) { - priority = !!priority; - var thisIter = op.iterator(this.ops); - var offset = 0; - while (thisIter.hasNext() && offset <= index) { - var length = thisIter.peekLength(); - var nextType = thisIter.peekType(); - thisIter.next(); - if (nextType === 'delete') { - index -= Math.min(length, index - offset); - continue; - } else if (nextType === 'insert' && (offset < index || !priority)) { - index += length; - } - offset += length; - } - return index; - }; +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); - module.exports = Delta; +var lib = { + attributes: { + compose: function (a, b, keepNull) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = extend(true, {}, b); + if (!keepNull) { + attributes = Object.keys(attributes).reduce(function (copy, key) { + if (attributes[key] != null) { + copy[key] = attributes[key]; + } + return copy; + }, {}); + } + for (var key in a) { + if (a[key] !== undefined && b[key] === undefined) { + attributes[key] = a[key]; + } + } + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + diff: function(a, b) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { + if (!equal(a[key], b[key])) { + attributes[key] = b[key] === undefined ? null : b[key]; + } + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + transform: function (a, b, priority) { + if (typeof a !== 'object') return b; + if (typeof b !== 'object') return undefined; + if (!priority) return b; // b simply overwrites us without priority + var attributes = Object.keys(b).reduce(function (attributes, key) { + if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + } + }, + + iterator: function (ops) { + return new Iterator(ops); + }, + + length: function (op) { + if (typeof op['delete'] === 'number') { + return op['delete']; + } else if (typeof op.retain === 'number') { + return op.retain; + } else { + return typeof op.insert === 'string' ? op.insert.length : 1; + } + } +}; + + +function Iterator(ops) { + this.ops = ops; + this.index = 0; + this.offset = 0; +}; + +Iterator.prototype.hasNext = function () { + return this.peekLength() < Infinity; +}; + +Iterator.prototype.next = function (length) { + if (!length) length = Infinity; + var nextOp = this.ops[this.index]; + if (nextOp) { + var offset = this.offset; + var opLength = lib.length(nextOp) + if (length >= opLength - offset) { + length = opLength - offset; + this.index += 1; + this.offset = 0; + } else { + this.offset += length; + } + if (typeof nextOp['delete'] === 'number') { + return { 'delete': length }; + } else { + var retOp = {}; + if (nextOp.attributes) { + retOp.attributes = nextOp.attributes; + } + if (typeof nextOp.retain === 'number') { + retOp.retain = length; + } else if (typeof nextOp.insert === 'string') { + retOp.insert = nextOp.insert.substr(offset, length); + } else { + // offset should === 0, length should === 1 + retOp.insert = nextOp.insert; + } + return retOp; + } + } else { + return { retain: Infinity }; + } +}; + +Iterator.prototype.peek = function () { + return this.ops[this.index]; +}; + +Iterator.prototype.peekLength = function () { + if (this.ops[this.index]) { + // Should never return 0 if our index is being managed correctly + return lib.length(this.ops[this.index]) - this.offset; + } else { + return Infinity; + } +}; + +Iterator.prototype.peekType = function () { + if (this.ops[this.index]) { + if (typeof this.ops[this.index]['delete'] === 'number') { + return 'delete'; + } else if (typeof this.ops[this.index].retain === 'number') { + return 'retain'; + } else { + return 'insert'; + } + } + return 'retain'; +}; -/***/ }, -/* 21 */ -/***/ function(module, exports) { +module.exports = lib; - /** - * This library modifies the diff-patch-match library by Neil Fraser - * by removing the patch and match functionality and certain advanced - * options in the diff function. The original license is as follows: - * - * === - * - * Diff Match and Patch - * - * Copyright 2006 Google Inc. - * http://code.google.com/p/google-diff-match-patch/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - /** - * The data structure representing a diff is an array of tuples: - * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] - * which means: delete 'Hello', add 'Goodbye' and keep ' world.' - */ - var DIFF_DELETE = -1; - var DIFF_INSERT = 1; - var DIFF_EQUAL = 0; - - - /** - * Find the differences between two texts. Simplifies the problem by stripping - * any common prefix or suffix off the texts before diffing. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {Int} cursor_pos Expected edit position in text1 (optional) - * @return {Array} Array of diff tuples. - */ - function diff_main(text1, text2, cursor_pos) { - // Check for equality (speedup). - if (text1 == text2) { - if (text1) { - return [[DIFF_EQUAL, text1]]; - } - return []; - } - - // Check cursor_pos within bounds - if (cursor_pos < 0 || text1.length < cursor_pos) { - cursor_pos = null; - } - - // Trim off common prefix (speedup). - var commonlength = diff_commonPrefix(text1, text2); - var commonprefix = text1.substring(0, commonlength); - text1 = text1.substring(commonlength); - text2 = text2.substring(commonlength); - - // Trim off common suffix (speedup). - 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); - - // Compute the diff on the middle block. - var diffs = diff_compute_(text1, text2); - - // Restore the prefix and suffix. - if (commonprefix) { - diffs.unshift([DIFF_EQUAL, commonprefix]); - } - if (commonsuffix) { - diffs.push([DIFF_EQUAL, commonsuffix]); - } - diff_cleanupMerge(diffs); - if (cursor_pos != null) { - diffs = fix_cursor(diffs, cursor_pos); - } - return diffs; - }; - - - /** - * Find the differences between two texts. Assumes that the texts do not - * have any common prefix or suffix. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @return {Array} Array of diff tuples. - */ - function diff_compute_(text1, text2) { - var diffs; - - if (!text1) { - // Just add some text (speedup). - return [[DIFF_INSERT, text2]]; - } - - if (!text2) { - // Just delete some text (speedup). - return [[DIFF_DELETE, text1]]; - } - - var longtext = text1.length > text2.length ? text1 : text2; - var shorttext = text1.length > text2.length ? text2 : text1; - var i = longtext.indexOf(shorttext); - if (i != -1) { - // Shorter text is inside the longer text (speedup). - diffs = [[DIFF_INSERT, longtext.substring(0, i)], - [DIFF_EQUAL, shorttext], - [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; - // Swap insertions for deletions if diff is reversed. - if (text1.length > text2.length) { - diffs[0][0] = diffs[2][0] = DIFF_DELETE; - } - return diffs; - } - - if (shorttext.length == 1) { - // Single character string. - // After the previous speedup, the character can't be an equality. - return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; - } - - // Check to see if the problem can be split in two. - var hm = diff_halfMatch_(text1, text2); - if (hm) { - // A half-match was found, sort out the return data. - var text1_a = hm[0]; - var text1_b = hm[1]; - var text2_a = hm[2]; - var text2_b = hm[3]; - var mid_common = hm[4]; - // Send both pairs off for separate processing. - var diffs_a = diff_main(text1_a, text2_a); - var diffs_b = diff_main(text1_b, text2_b); - // Merge the results. - return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); - } - - return diff_bisect_(text1, text2); - }; - - - /** - * Find the 'middle snake' of a diff, split the problem in two - * and return the recursively constructed diff. - * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @return {Array} Array of diff tuples. - * @private - */ - function diff_bisect_(text1, text2) { - // Cache the text lengths to prevent multiple calls. - var text1_length = text1.length; - var text2_length = text2.length; - var max_d = Math.ceil((text1_length + text2_length) / 2); - var v_offset = max_d; - var v_length = 2 * max_d; - var v1 = new Array(v_length); - var v2 = new Array(v_length); - // Setting all elements to -1 is faster in Chrome & Firefox than mixing - // integers and undefined. - for (var x = 0; x < v_length; x++) { - v1[x] = -1; - v2[x] = -1; - } - v1[v_offset + 1] = 0; - v2[v_offset + 1] = 0; - var delta = text1_length - text2_length; - // If the total number of characters is odd, then the front path will collide - // with the reverse path. - var front = (delta % 2 != 0); - // Offsets for start and end of k loop. - // Prevents mapping of space beyond the grid. - var k1start = 0; - var k1end = 0; - var k2start = 0; - var k2end = 0; - for (var d = 0; d < max_d; d++) { - // Walk the front path one step. - for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { - var k1_offset = v_offset + k1; - var x1; - if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { - x1 = v1[k1_offset + 1]; - } else { - x1 = v1[k1_offset - 1] + 1; - } - var y1 = x1 - k1; - while (x1 < text1_length && y1 < text2_length && - text1.charAt(x1) == text2.charAt(y1)) { - x1++; - y1++; - } - v1[k1_offset] = x1; - if (x1 > text1_length) { - // Ran off the right of the graph. - k1end += 2; - } else if (y1 > text2_length) { - // Ran off the bottom of the graph. - k1start += 2; - } else if (front) { - var k2_offset = v_offset + delta - k1; - if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { - // Mirror x2 onto top-left coordinate system. - var x2 = text1_length - v2[k2_offset]; - if (x1 >= x2) { - // Overlap detected. - return diff_bisectSplit_(text1, text2, x1, y1); - } - } - } - } - - // Walk the reverse path one step. - for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { - var k2_offset = v_offset + k2; - var x2; - if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { - x2 = v2[k2_offset + 1]; - } else { - x2 = v2[k2_offset - 1] + 1; - } - var y2 = x2 - k2; - while (x2 < text1_length && y2 < text2_length && - text1.charAt(text1_length - x2 - 1) == - text2.charAt(text2_length - y2 - 1)) { - x2++; - y2++; - } - v2[k2_offset] = x2; - if (x2 > text1_length) { - // Ran off the left of the graph. - k2end += 2; - } else if (y2 > text2_length) { - // Ran off the top of the graph. - 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]; - var y1 = v_offset + x1 - k1_offset; - // Mirror x2 onto top-left coordinate system. - x2 = text1_length - x2; - if (x1 >= x2) { - // Overlap detected. - return diff_bisectSplit_(text1, text2, x1, y1); - } - } - } - } - } - // Diff took too long and hit the deadline or - // number of diffs equals number of characters, no commonality at all. - return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; - }; - - - /** - * Given the location of the 'middle snake', split the diff in two parts - * and recurse. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {number} x Index of split point in text1. - * @param {number} y Index of split point in text2. - * @return {Array} Array of diff tuples. - */ - function diff_bisectSplit_(text1, text2, x, y) { - var text1a = text1.substring(0, x); - var text2a = text2.substring(0, y); - var text1b = text1.substring(x); - var text2b = text2.substring(y); - - // Compute both diffs serially. - var diffs = diff_main(text1a, text2a); - var diffsb = diff_main(text1b, text2b); - - return diffs.concat(diffsb); - }; - - - /** - * Determine the common prefix of two strings. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {number} The number of characters common to the start of each - * string. - */ - function diff_commonPrefix(text1, text2) { - // Quick check for common null cases. - if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { - return 0; - } - // Binary search. - // Performance analysis: http://neil.fraser.name/news/2007/10/09/ - var pointermin = 0; - var pointermax = Math.min(text1.length, text2.length); - var pointermid = pointermax; - var pointerstart = 0; - while (pointermin < pointermid) { - if (text1.substring(pointerstart, pointermid) == - text2.substring(pointerstart, pointermid)) { - pointermin = pointermid; - pointerstart = pointermin; - } else { - pointermax = pointermid; - } - pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); - } - return pointermid; - }; - - - /** - * Determine the common suffix of two strings. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {number} The number of characters common to the end of each string. - */ - function diff_commonSuffix(text1, text2) { - // Quick check for common null cases. - if (!text1 || !text2 || - text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { - return 0; - } - // Binary search. - // Performance analysis: http://neil.fraser.name/news/2007/10/09/ - var pointermin = 0; - var pointermax = Math.min(text1.length, text2.length); - var pointermid = pointermax; - var pointerend = 0; - while (pointermin < pointermid) { - if (text1.substring(text1.length - pointermid, text1.length - pointerend) == - text2.substring(text2.length - pointermid, text2.length - pointerend)) { - pointermin = pointermid; - pointerend = pointermin; - } else { - pointermax = pointermid; - } - pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); - } - return pointermid; - }; - - - /** - * Do the two texts share a substring which is at least half the length of the - * longer text? - * This speedup can produce non-minimal diffs. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {Array.} Five element Array, containing the prefix of - * text1, the suffix of text1, the prefix of text2, the suffix of - * text2 and the common middle. Or null if there was no match. - */ - function diff_halfMatch_(text1, text2) { - var longtext = text1.length > text2.length ? text1 : text2; - var shorttext = text1.length > text2.length ? text2 : text1; - if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { - return null; // Pointless. - } - - /** - * Does a substring of shorttext exist within longtext such that the substring - * is at least half the length of longtext? - * Closure, but does not reference any external variables. - * @param {string} longtext Longer string. - * @param {string} shorttext Shorter string. - * @param {number} i Start index of quarter length substring within longtext. - * @return {Array.} Five element Array, containing the prefix of - * longtext, the suffix of longtext, the prefix of shorttext, the suffix - * of shorttext and the common middle. Or null if there was no match. - * @private - */ - function diff_halfMatchI_(longtext, shorttext, i) { - // Start with a 1/4 length substring at position i as a seed. - var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); - var j = -1; - var best_common = ''; - var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; - while ((j = shorttext.indexOf(seed, j + 1)) != -1) { - var prefixLength = diff_commonPrefix(longtext.substring(i), - shorttext.substring(j)); - var suffixLength = diff_commonSuffix(longtext.substring(0, i), - shorttext.substring(0, j)); - if (best_common.length < suffixLength + prefixLength) { - best_common = shorttext.substring(j - suffixLength, j) + - shorttext.substring(j, j + prefixLength); - best_longtext_a = longtext.substring(0, i - suffixLength); - best_longtext_b = longtext.substring(i + prefixLength); - best_shorttext_a = shorttext.substring(0, j - suffixLength); - best_shorttext_b = shorttext.substring(j + prefixLength); - } - } - if (best_common.length * 2 >= longtext.length) { - return [best_longtext_a, best_longtext_b, - best_shorttext_a, best_shorttext_b, best_common]; - } else { - return null; - } - } - - // First check if the second quarter is the seed for a half-match. - var hm1 = diff_halfMatchI_(longtext, shorttext, - Math.ceil(longtext.length / 4)); - // Check again based on the third quarter. - var hm2 = diff_halfMatchI_(longtext, shorttext, - Math.ceil(longtext.length / 2)); - var hm; - if (!hm1 && !hm2) { - return null; - } else if (!hm2) { - hm = hm1; - } else if (!hm1) { - hm = hm2; - } else { - // Both matched. Select the longest. - hm = hm1[4].length > hm2[4].length ? hm1 : hm2; - } - - // A half-match was found, sort out the return data. - var text1_a, text1_b, text2_a, text2_b; - if (text1.length > text2.length) { - text1_a = hm[0]; - text1_b = hm[1]; - text2_a = hm[2]; - text2_b = hm[3]; - } else { - 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]; - }; - - - /** - * Reorder and merge like edit sections. Merge equalities. - * Any edit section can move as long as it doesn't cross an equality. - * @param {Array} diffs Array of diff tuples. - */ - function diff_cleanupMerge(diffs) { - diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. - var pointer = 0; - var count_delete = 0; - var count_insert = 0; - var text_delete = ''; - var text_insert = ''; - var commonlength; - while (pointer < diffs.length) { - 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: - // Upon reaching an equality, check for prior redundancies. - if (count_delete + count_insert > 1) { - if (count_delete !== 0 && count_insert !== 0) { - // Factor out any common prefixies. - commonlength = diff_commonPrefix(text_insert, text_delete); - if (commonlength !== 0) { - if ((pointer - count_delete - count_insert) > 0 && - diffs[pointer - count_delete - count_insert - 1][0] == - DIFF_EQUAL) { - diffs[pointer - count_delete - count_insert - 1][1] += - text_insert.substring(0, commonlength); - } else { - diffs.splice(0, 0, [DIFF_EQUAL, - text_insert.substring(0, commonlength)]); - pointer++; - } - text_insert = text_insert.substring(commonlength); - text_delete = text_delete.substring(commonlength); - } - // Factor out any common suffixies. - commonlength = diff_commonSuffix(text_insert, text_delete); - if (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); - } - } - // Delete the offending records and add the merged ones. - if (count_delete === 0) { - diffs.splice(pointer - count_insert, - count_delete + count_insert, [DIFF_INSERT, text_insert]); - } else if (count_insert === 0) { - diffs.splice(pointer - count_delete, - count_delete + count_insert, [DIFF_DELETE, text_delete]); - } else { - diffs.splice(pointer - count_delete - count_insert, - count_delete + count_insert, [DIFF_DELETE, text_delete], - [DIFF_INSERT, text_insert]); - } - pointer = pointer - count_delete - count_insert + - (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; - } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { - // Merge this equality with the previous one. - diffs[pointer - 1][1] += diffs[pointer][1]; - diffs.splice(pointer, 1); - } else { - pointer++; - } - count_insert = 0; - count_delete = 0; - text_delete = ''; - text_insert = ''; - break; - } - } - if (diffs[diffs.length - 1][1] === '') { - diffs.pop(); // Remove the dummy entry at the end. - } - - // Second pass: look for single edits surrounded on both sides by equalities - // which can be shifted sideways to eliminate an equality. - // e.g: ABAC -> ABAC - var changes = false; - pointer = 1; - // Intentionally ignore the first and last element (don't need checking). - while (pointer < diffs.length - 1) { - if (diffs[pointer - 1][0] == DIFF_EQUAL && - diffs[pointer + 1][0] == DIFF_EQUAL) { - // This is a single edit surrounded by equalities. - if (diffs[pointer][1].substring(diffs[pointer][1].length - - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { - // Shift the edit over the previous equality. - 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 = true; - } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == - diffs[pointer + 1][1]) { - // Shift the edit over the next equality. - 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 = true; - } - } - pointer++; - } - // If shifts were made, the diff needs reordering and another shift sweep. - if (changes) { - diff_cleanupMerge(diffs); - } - }; - - - var diff = diff_main; - diff.INSERT = DIFF_INSERT; - diff.DELETE = DIFF_DELETE; - diff.EQUAL = DIFF_EQUAL; - - module.exports = diff; - - /* - * Modify a diff such that the cursor position points to the start of a change: - * E.g. - * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) - * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] - * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) - * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] - * - * @param {Array} diffs Array of diff tuples - * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! - * @return {Array} A tuple [cursor location in the modified diff, modified diff] - */ - function cursor_normalize_diff (diffs, cursor_pos) { - if (cursor_pos === 0) { - return [DIFF_EQUAL, diffs]; - } - for (var current_pos = 0, i = 0; i < diffs.length; i++) { - var d = diffs[i]; - if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { - var next_pos = current_pos + d[1].length; - if (cursor_pos === next_pos) { - return [i + 1, diffs]; - } else if (cursor_pos < next_pos) { - // copy to prevent side effects - diffs = diffs.slice(); - // split d into two diff changes - var split_pos = cursor_pos - current_pos; - var d_left = [d[0], d[1].slice(0, split_pos)]; - var d_right = [d[0], d[1].slice(split_pos)]; - diffs.splice(i, 1, d_left, d_right); - return [i + 1, diffs]; - } else { - current_pos = next_pos; - } - } - } - throw new Error('cursor_pos is out of bounds!') - } - /* - * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). - * - * Case 1) - * Check if a naive shift is possible: - * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) - * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result - * Case 2) - * Check if the following shifts are possible: - * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] - * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] - * ^ ^ - * d d_next - * - * @param {Array} diffs Array of diff tuples - * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! - * @return {Array} Array of diff tuples - */ - function fix_cursor (diffs, cursor_pos) { - var norm = cursor_normalize_diff(diffs, cursor_pos); - var ndiffs = norm[1]; - var cursor_pointer = norm[0]; - var d = ndiffs[cursor_pointer]; - var d_next = ndiffs[cursor_pointer + 1]; - - if (d == null) { - // Text was deleted from end of original string, - // cursor is now out of bounds in new string - return diffs; - } else if (d[0] !== DIFF_EQUAL) { - // A modification happened at the cursor location. - // This is the expected outcome, so we can return the original diff. - return diffs; - } else { - if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { - // Case 1) - // It is possible to perform a naive shift - ndiffs.splice(cursor_pointer, 2, d_next, d) - return merge_tuples(ndiffs, cursor_pointer, 2) - } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { - // Case 2) - // d[1] is a prefix of d_next[1] - // We can assume that d_next[0] !== 0, since d[0] === 0 - // Shift edit locations.. - ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); - var suffix = d_next[1].slice(d[1].length); - if (suffix.length > 0) { - ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); - } - return merge_tuples(ndiffs, cursor_pointer, 3) - } else { - // Not possible to perform any modification - return diffs; - } - } +/***/ }), +/* 21 */ +/***/ (function(module, exports) { - } +var clone = (function() { +'use strict'; - /* - * Try to merge tuples with their neigbors in a given range. - * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] - * - * @param {Array} diffs Array of diff tuples. - * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). - * @param {Int} length Number of consecutive elements to check. - * @return {Array} Array of merged diff tuples. - */ - function merge_tuples (diffs, start, length) { - // Check from (start-1) to (start+length). - for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { - if (i + 1 < diffs.length) { - var left_d = diffs[i]; - var right_d = diffs[i+1]; - if (left_d[0] === right_d[1]) { - diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); - } - } - } - return diffs; - } +function _instanceof(obj, type) { + return type != null && obj instanceof type; +} + +var nativeMap; +try { + nativeMap = Map; +} catch(_) { + // maybe a reference error because no `Map`. Give it a dummy value that no + // value will ever be an instanceof. + nativeMap = function() {}; +} + +var nativeSet; +try { + nativeSet = Set; +} catch(_) { + nativeSet = function() {}; +} + +var nativePromise; +try { + nativePromise = Promise; +} catch(_) { + nativePromise = function() {}; +} + +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). + * @param `includeNonEnumerable` - set to true if the non-enumerable properties + * should be cloned as well. Non-enumerable properties on the prototype + * chain will be ignored. (optional - false by default) +*/ +function clone(parent, circular, depth, prototype, includeNonEnumerable) { + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + includeNonEnumerable = circular.includeNonEnumerable; + circular = circular.circular; + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth === 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (_instanceof(parent, nativeMap)) { + child = new nativeMap(); + } else if (_instanceof(parent, nativeSet)) { + child = new nativeSet(); + } else if (_instanceof(parent, nativePromise)) { + child = new nativePromise(function (resolve, reject) { + parent.then(function(value) { + resolve(_clone(value, depth - 1)); + }, function(err) { + reject(_clone(err, depth - 1)); + }); + }); + } else if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + child = new Buffer(parent.length); + parent.copy(child); + return child; + } else if (_instanceof(parent, Error)) { + child = Object.create(parent); + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + if (_instanceof(parent, nativeMap)) { + parent.forEach(function(value, key) { + var keyChild = _clone(key, depth - 1); + var valueChild = _clone(value, depth - 1); + child.set(keyChild, valueChild); + }); + } + if (_instanceof(parent, nativeSet)) { + parent.forEach(function(value) { + var entryChild = _clone(value, depth - 1); + child.add(entryChild); + }); + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(parent); + for (var i = 0; i < symbols.length; i++) { + // Don't need to worry about cloning a symbol because it is a primitive, + // like a number or string. + var symbol = symbols[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, symbol); + if (descriptor && !descriptor.enumerable && !includeNonEnumerable) { + continue; + } + child[symbol] = _clone(parent[symbol], depth - 1); + if (!descriptor.enumerable) { + Object.defineProperty(child, symbol, { + enumerable: false + }); + } + } + } + + if (includeNonEnumerable) { + var allPropertyNames = Object.getOwnPropertyNames(parent); + for (var i = 0; i < allPropertyNames.length; i++) { + var propertyName = allPropertyNames[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName); + if (descriptor && descriptor.enumerable) { + continue; + } + child[propertyName] = _clone(parent[propertyName], depth - 1); + Object.defineProperty(child, propertyName, { + enumerable: false + }); + } + } + + return child; + } + + return _clone(parent, depth); +} + +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); +}; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +} +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +} +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +} +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +} +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +} +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} -/***/ }, +/***/ }), /* 22 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - var pSlice = Array.prototype.slice; - var objectKeys = __webpack_require__(23); - var isArguments = __webpack_require__(24); - - var deepEqual = module.exports = function (actual, expected, opts) { - if (!opts) opts = {}; - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { - return opts.strict ? actual === expected : actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected, opts); - } - } +"use strict"; - function isUndefinedOrNull(value) { - return value === null || value === undefined; - } - function isBuffer (x) { - if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; - if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { - return false; - } - if (x.length > 0 && typeof x[0] !== 'number') return false; - return true; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); - function objEquiv(a, b, opts) { - var i, key; - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return deepEqual(a, b, opts); - } - if (isBuffer(a)) { - if (!isBuffer(b)) { - return false; - } - if (a.length !== b.length) return false; - for (i = 0; i < a.length; i++) { - if (a[i] !== b[i]) return false; - } - return true; - } - try { - var ka = objectKeys(a), - kb = objectKeys(b); - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!deepEqual(a[key], b[key], opts)) return false; - } - return typeof a === typeof b; - } +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); +var _parchment2 = _interopRequireDefault(_parchment); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _container = __webpack_require__(25); + +var _container2 = _interopRequireDefault(_container); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function isLine(blot) { + return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; +} + +var Scroll = function (_Parchment$Scroll) { + _inherits(Scroll, _Parchment$Scroll); + + function Scroll(domNode, config) { + _classCallCheck(this, Scroll); + + var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); + + _this.emitter = config.emitter; + if (Array.isArray(config.whitelist)) { + _this.whitelist = config.whitelist.reduce(function (whitelist, format) { + whitelist[format] = true; + return whitelist; + }, {}); + } + // Some reason fixes composition issues with character languages in Windows/Chrome, Safari + _this.domNode.addEventListener('DOMNodeInserted', function () {}); + _this.optimize(); + _this.enable(); + return _this; + } + + _createClass(Scroll, [{ + key: 'batchStart', + value: function batchStart() { + this.batch = true; + } + }, { + key: 'batchEnd', + value: function batchEnd() { + this.batch = false; + this.optimize(); + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + var _line = this.line(index), + _line2 = _slicedToArray(_line, 2), + first = _line2[0], + offset = _line2[1]; + + var _line3 = this.line(index + length), + _line4 = _slicedToArray(_line3, 1), + last = _line4[0]; + + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); + if (last != null && first !== last && offset > 0) { + if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) { + this.optimize(); + return; + } + if (first instanceof _code2.default) { + var newlineIndex = first.newlineIndex(first.length(), true); + if (newlineIndex > -1) { + first = first.split(newlineIndex + 1); + if (first === last) { + this.optimize(); + return; + } + } + } else if (last instanceof _code2.default) { + var _newlineIndex = last.newlineIndex(0); + if (_newlineIndex > -1) { + last.split(_newlineIndex + 1); + } + } + var ref = last.children.head instanceof _break2.default ? null : last.children.head; + first.moveChildren(last, ref); + first.remove(); + } + this.optimize(); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.domNode.setAttribute('contenteditable', enabled); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, format, value) { + if (this.whitelist != null && !this.whitelist[format]) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); + this.optimize(); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null && this.whitelist != null && !this.whitelist[value]) return; + if (index >= this.length()) { + if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { + var blot = _parchment2.default.create(this.statics.defaultChild); + this.appendChild(blot); + if (def == null && value.endsWith('\n')) { + value = value.slice(0, -1); + } + blot.insertAt(0, value, def); + } else { + var embed = _parchment2.default.create(value, def); + this.appendChild(embed); + } + } else { + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); + } + this.optimize(); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { + var wrapper = _parchment2.default.create(this.statics.defaultChild); + wrapper.appendChild(blot); + blot = wrapper; + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); + } + }, { + key: 'leaf', + value: function leaf(index) { + return this.path(index).pop() || [null, -1]; + } + }, { + key: 'line', + value: function line(index) { + if (index === this.length()) { + return this.line(index - 1); + } + return this.descendant(isLine, index); + } + }, { + key: 'lines', + value: function lines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + var getLines = function getLines(blot, index, length) { + var lines = [], + lengthLeft = length; + blot.children.forEachAt(index, length, function (child, index, length) { + if (isLine(child)) { + lines.push(child); + } else if (child instanceof _parchment2.default.Container) { + lines = lines.concat(getLines(child, index, lengthLeft)); + } + lengthLeft -= length; + }); + return lines; + }; + return getLines(this, index, length); + } + }, { + key: 'optimize', + value: function optimize() { + var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (this.batch === true) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context); + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context); + } + } + }, { + key: 'path', + value: function path(index) { + return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self + } + }, { + key: 'update', + value: function update(mutations) { + if (this.batch === true) return; + var source = _emitter2.default.sources.USER; + if (typeof mutations === 'string') { + source = mutations; + } + if (!Array.isArray(mutations)) { + mutations = this.observer.takeRecords(); + } + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); + } + } + }]); + + return Scroll; +}(_parchment2.default.Scroll); + +Scroll.blotName = 'scroll'; +Scroll.className = 'ql-editor'; +Scroll.tagName = 'DIV'; +Scroll.defaultChild = 'block'; +Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; -/***/ }, +exports.default = Scroll; + +/***/ }), /* 23 */ -/***/ function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { - exports = module.exports = typeof Object.keys === 'function' - ? Object.keys : shim; +"use strict"; - exports.shim = shim; - function shim (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SHORTKEY = exports.default = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:keyboard'); + +var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; + +var Keyboard = function (_Module) { + _inherits(Keyboard, _Module); + + _createClass(Keyboard, null, [{ + key: 'match', + value: function match(evt, binding) { + binding = normalize(binding); + if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { + return !!binding[key] !== evt[key] && binding[key] !== null; + })) { + return false; + } + return binding.key === (evt.which || evt.keyCode); + } + }]); + + function Keyboard(quill, options) { + _classCallCheck(this, Keyboard); + + var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); + + _this.bindings = {}; + Object.keys(_this.options.bindings).forEach(function (name) { + if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) { + return; + } + if (_this.options.bindings[name]) { + _this.addBinding(_this.options.bindings[name]); + } + }); + _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); + _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); + if (/Firefox/i.test(navigator.userAgent)) { + // Need to handle delete and backspace for Firefox in the general case #1171 + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete); + } else { + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete); + } + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace); + _this.listen(); + return _this; + } + + _createClass(Keyboard, [{ + key: 'addBinding', + value: function addBinding(key) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var binding = normalize(key); + if (binding == null || binding.key == null) { + return debug.warn('Attempted to add invalid keyboard binding', binding); + } + if (typeof context === 'function') { + context = { handler: context }; + } + if (typeof handler === 'function') { + handler = { handler: handler }; + } + binding = (0, _extend2.default)(binding, context, handler); + this.bindings[binding.key] = this.bindings[binding.key] || []; + this.bindings[binding.key].push(binding); + } + }, { + key: 'listen', + value: function listen() { + var _this2 = this; + + this.quill.root.addEventListener('keydown', function (evt) { + if (evt.defaultPrevented) return; + var which = evt.which || evt.keyCode; + var bindings = (_this2.bindings[which] || []).filter(function (binding) { + return Keyboard.match(evt, binding); + }); + if (bindings.length === 0) return; + var range = _this2.quill.getSelection(); + if (range == null || !_this2.quill.hasFocus()) return; + + var _quill$getLine = _this2.quill.getLine(range.index), + _quill$getLine2 = _slicedToArray(_quill$getLine, 2), + line = _quill$getLine2[0], + offset = _quill$getLine2[1]; + + var _quill$getLeaf = _this2.quill.getLeaf(range.index), + _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), + leafStart = _quill$getLeaf2[0], + offsetStart = _quill$getLeaf2[1]; + + var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), + _ref2 = _slicedToArray(_ref, 2), + leafEnd = _ref2[0], + offsetEnd = _ref2[1]; + + var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; + var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; + var curContext = { + collapsed: range.length === 0, + empty: range.length === 0 && line.length() <= 1, + format: _this2.quill.getFormat(range), + offset: offset, + prefix: prefixText, + suffix: suffixText + }; + var prevented = bindings.some(function (binding) { + if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; + if (binding.empty != null && binding.empty !== curContext.empty) return false; + if (binding.offset != null && binding.offset !== curContext.offset) return false; + if (Array.isArray(binding.format)) { + // any format is present + if (binding.format.every(function (name) { + return curContext.format[name] == null; + })) { + return false; + } + } else if (_typeof(binding.format) === 'object') { + // all formats must match + if (!Object.keys(binding.format).every(function (name) { + if (binding.format[name] === true) return curContext.format[name] != null; + if (binding.format[name] === false) return curContext.format[name] == null; + return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); + })) { + return false; + } + } + if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; + if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; + return binding.handler.call(_this2, range, curContext) !== true; + }); + if (prevented) { + evt.preventDefault(); + } + }); + } + }]); + + return Keyboard; +}(_module2.default); + +Keyboard.keys = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + ESCAPE: 27, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46 +}; + +Keyboard.DEFAULTS = { + bindings: { + 'bold': makeFormatHandler('bold'), + 'italic': makeFormatHandler('italic'), + 'underline': makeFormatHandler('underline'), + 'indent': { + // highlight tab or tab at beginning of list, indent or blockquote + key: Keyboard.keys.TAB, + format: ['blockquote', 'indent', 'list'], + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '+1', _quill2.default.sources.USER); + } + }, + 'outdent': { + key: Keyboard.keys.TAB, + shiftKey: true, + format: ['blockquote', 'indent', 'list'], + // highlight tab or tab at beginning of list, indent or blockquote + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } + }, + 'outdent backspace': { + key: Keyboard.keys.BACKSPACE, + collapsed: true, + shiftKey: null, + metaKey: null, + ctrlKey: null, + altKey: null, + format: ['indent', 'list'], + offset: 0, + handler: function handler(range, context) { + if (context.format.indent != null) { + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } else if (context.format.list != null) { + this.quill.format('list', false, _quill2.default.sources.USER); + } + } + }, + 'indent code-block': makeCodeBlockHandler(true), + 'outdent code-block': makeCodeBlockHandler(false), + 'remove tab': { + key: Keyboard.keys.TAB, + shiftKey: true, + collapsed: true, + prefix: /\t$/, + handler: function handler(range) { + this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); + } + }, + 'tab': { + key: Keyboard.keys.TAB, + handler: function handler(range) { + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\t'); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + } + }, + 'list empty enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['list'], + empty: true, + handler: function handler(range, context) { + this.quill.format('list', false, _quill2.default.sources.USER); + if (context.format.indent) { + this.quill.format('indent', false, _quill2.default.sources.USER); + } + } + }, + 'checklist enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: { list: 'checked' }, + handler: function handler(range) { + var _quill$getLine3 = this.quill.getLine(range.index), + _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), + line = _quill$getLine4[0], + offset = _quill$getLine4[1]; + + var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' }); + var delta = new _quillDelta2.default().retain(range.index).insert('\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'header enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['header'], + suffix: /^$/, + handler: function handler(range, context) { + var _quill$getLine5 = this.quill.getLine(range.index), + _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), + line = _quill$getLine6[0], + offset = _quill$getLine6[1]; + + var delta = new _quillDelta2.default().retain(range.index).insert('\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'list autofill': { + key: ' ', + collapsed: true, + format: { list: false }, + prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/, + handler: function handler(range, context) { + var length = context.prefix.length; + + var _quill$getLine7 = this.quill.getLine(range.index), + _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), + line = _quill$getLine8[0], + offset = _quill$getLine8[1]; + + if (offset > length) return true; + var value = void 0; + switch (context.prefix.trim()) { + case '[]':case '[ ]': + value = 'unchecked'; + break; + case '[x]': + value = 'checked'; + break; + case '-':case '*': + value = 'bullet'; + break; + default: + value = 'ordered'; + } + this.quill.insertText(range.index, ' ', _quill2.default.sources.USER); + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); + } + }, + 'code exit': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['code-block'], + prefix: /\n\n$/, + suffix: /^\s+$/, + handler: function handler(range) { + var _quill$getLine9 = this.quill.getLine(range.index), + _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), + line = _quill$getLine10[0], + offset = _quill$getLine10[1]; + + var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1); + this.quill.updateContents(delta, _quill2.default.sources.USER); + } + }, + 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false), + 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true), + 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false), + 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true) + } +}; + +function makeEmbedArrowHandler(key, shiftKey) { + var _ref3; + + var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix'; + return _ref3 = { + key: key, + shiftKey: shiftKey, + altKey: null + }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) { + var index = range.index; + if (key === Keyboard.keys.RIGHT) { + index += range.length + 1; + } + + var _quill$getLeaf3 = this.quill.getLeaf(index), + _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), + leaf = _quill$getLeaf4[0]; + + if (!(leaf instanceof _parchment2.default.Embed)) return true; + if (key === Keyboard.keys.LEFT) { + if (shiftKey) { + this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index - 1, _quill2.default.sources.USER); + } + } else { + if (shiftKey) { + this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER); + } + } + return false; + }), _ref3; +} + +function handleBackspace(range, context) { + if (range.index === 0 || this.quill.getLength() <= 1) return; + + var _quill$getLine11 = this.quill.getLine(range.index), + _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), + line = _quill$getLine12[0]; + + var formats = {}; + if (context.offset === 0) { + var _quill$getLine13 = this.quill.getLine(range.index - 1), + _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), + prev = _quill$getLine14[0]; + + if (prev != null && prev.length() > 1) { + var curFormats = line.formats(); + var prevFormats = this.quill.getFormat(range.index - 1, 1); + formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; + } + } + // Check for astral symbols + var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1; + this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER); + } + this.quill.focus(); +} + +function handleDelete(range, context) { + // Check for astral symbols + var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1; + if (range.index >= this.quill.getLength() - length) return; + var formats = {}, + nextLength = 0; + + var _quill$getLine15 = this.quill.getLine(range.index), + _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), + line = _quill$getLine16[0]; + + if (context.offset >= line.length() - 1) { + var _quill$getLine17 = this.quill.getLine(range.index + 1), + _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), + next = _quill$getLine18[0]; + + if (next) { + var curFormats = line.formats(); + var nextFormats = this.quill.getFormat(range.index, 1); + formats = _op2.default.attributes.diff(curFormats, nextFormats) || {}; + nextLength = next.length(); + } + } + this.quill.deleteText(range.index, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER); + } +} + +function handleDeleteRange(range) { + var lines = this.quill.getLines(range); + var formats = {}; + if (lines.length > 1) { + var firstFormats = lines[0].formats(); + var lastFormats = lines[lines.length - 1].formats(); + formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {}; + } + this.quill.deleteText(range, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER); + } + this.quill.setSelection(range.index, _quill2.default.sources.SILENT); + this.quill.focus(); +} + +function handleEnter(range, context) { + var _this3 = this; + + if (range.length > 0) { + this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change + } + var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { + if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { + lineFormats[format] = context.format[format]; + } + return lineFormats; + }, {}); + this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); + // Earlier scroll.deleteAt might have messed up our selection, + // so insertText's built in selection preservation is not reliable + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.focus(); + Object.keys(context.format).forEach(function (name) { + if (lineFormats[name] != null) return; + if (Array.isArray(context.format[name])) return; + if (name === 'link') return; + _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); + }); +} + +function makeCodeBlockHandler(indent) { + return { + key: Keyboard.keys.TAB, + shiftKey: !indent, + format: { 'code-block': true }, + handler: function handler(range) { + var CodeBlock = _parchment2.default.query('code-block'); + var index = range.index, + length = range.length; + + var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + block = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (block == null) return; + var scrollIndex = this.quill.getIndex(block); + var start = block.newlineIndex(offset, true) + 1; + var end = block.newlineIndex(scrollIndex + offset + length); + var lines = block.domNode.textContent.slice(start, end).split('\n'); + offset = 0; + lines.forEach(function (line, i) { + if (indent) { + block.insertAt(start + offset, CodeBlock.TAB); + offset += CodeBlock.TAB.length; + if (i === 0) { + index += CodeBlock.TAB.length; + } else { + length += CodeBlock.TAB.length; + } + } else if (line.startsWith(CodeBlock.TAB)) { + block.deleteAt(start + offset, CodeBlock.TAB.length); + offset -= CodeBlock.TAB.length; + if (i === 0) { + index -= CodeBlock.TAB.length; + } else { + length -= CodeBlock.TAB.length; + } + } + offset += line.length + 1; + }); + this.quill.update(_quill2.default.sources.USER); + this.quill.setSelection(index, length, _quill2.default.sources.SILENT); + } + }; +} + +function makeFormatHandler(format) { + return { + key: format[0].toUpperCase(), + shortKey: true, + handler: function handler(range, context) { + this.quill.format(format, !context.format[format], _quill2.default.sources.USER); + } + }; +} + +function normalize(binding) { + if (typeof binding === 'string' || typeof binding === 'number') { + return normalize({ key: binding }); + } + if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { + binding = (0, _clone2.default)(binding, false); + } + if (typeof binding.key === 'string') { + if (Keyboard.keys[binding.key.toUpperCase()] != null) { + binding.key = Keyboard.keys[binding.key.toUpperCase()]; + } else if (binding.key.length === 1) { + binding.key = binding.key.toUpperCase().charCodeAt(0); + } else { + return null; + } + } + if (binding.shortKey) { + binding[SHORTKEY] = binding.shortKey; + delete binding.shortKey; + } + return binding; +} -/***/ }, +exports.default = Keyboard; +exports.SHORTKEY = SHORTKEY; + +/***/ }), /* 24 */ -/***/ function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - var supportsArgumentsClass = (function(){ - return Object.prototype.toString.call(arguments) - })() == '[object Arguments]'; - - exports = module.exports = supportsArgumentsClass ? supported : unsupported; - - exports.supported = supported; - function supported(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; - }; - - exports.unsupported = unsupported; - function unsupported(object){ - return object && - typeof object == 'object' && - typeof object.length == 'number' && - Object.prototype.hasOwnProperty.call(object, 'callee') && - !Object.prototype.propertyIsEnumerable.call(object, 'callee') || - false; - }; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _parchment = __webpack_require__(0); -/***/ }, +var _parchment2 = _interopRequireDefault(_parchment); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Cursor = function (_Parchment$Embed) { + _inherits(Cursor, _Parchment$Embed); + + _createClass(Cursor, null, [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + function Cursor(domNode, selection) { + _classCallCheck(this, Cursor); + + var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); + + _this.selection = selection; + _this.textNode = document.createTextNode(Cursor.CONTENTS); + _this.domNode.appendChild(_this.textNode); + _this._length = 0; + return _this; + } + + _createClass(Cursor, [{ + key: 'detach', + value: function detach() { + // super.detach() will also clear domNode.__blot + if (this.parent != null) this.parent.removeChild(this); + } + }, { + key: 'format', + value: function format(name, value) { + if (this._length !== 0) { + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); + } + var target = this, + index = 0; + while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { + index += target.offset(target.parent); + target = target.parent; + } + if (target != null) { + this._length = Cursor.CONTENTS.length; + target.optimize(); + target.formatAt(index, Cursor.CONTENTS.length, name, value); + this._length = 0; + } + } + }, { + key: 'index', + value: function index(node, offset) { + if (node === this.textNode) return 0; + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'length', + value: function length() { + return this._length; + } + }, { + key: 'position', + value: function position() { + return [this.textNode, this.textNode.data.length]; + } + }, { + key: 'remove', + value: function remove() { + _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); + this.parent = null; + } + }, { + key: 'restore', + value: function restore() { + if (this.selection.composing || this.parent == null) return; + var textNode = this.textNode; + var range = this.selection.getNativeRange(); + var restoreText = void 0, + start = void 0, + end = void 0; + if (range != null && range.start.node === textNode && range.end.node === textNode) { + var _ref = [textNode, range.start.offset, range.end.offset]; + restoreText = _ref[0]; + start = _ref[1]; + end = _ref[2]; + } + // Link format will insert text outside of anchor tag + while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { + this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); + } + if (this.textNode.data !== Cursor.CONTENTS) { + var text = this.textNode.data.split(Cursor.CONTENTS).join(''); + if (this.next instanceof _text2.default) { + restoreText = this.next.domNode; + this.next.insertAt(0, text); + this.textNode.data = Cursor.CONTENTS; + } else { + this.textNode.data = text; + this.parent.insertBefore(_parchment2.default.create(this.textNode), this); + this.textNode = document.createTextNode(Cursor.CONTENTS); + this.domNode.appendChild(this.textNode); + } + } + this.remove(); + if (start != null) { + var _map = [start, end].map(function (offset) { + return Math.max(0, Math.min(restoreText.data.length, offset - 1)); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + + return { + startNode: restoreText, + startOffset: start, + endNode: restoreText, + endOffset: end + }; + } + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this2.textNode; + })) { + var range = this.restore(); + if (range) context.range = range; + } + } + }, { + key: 'value', + value: function value() { + return ''; + } + }]); + + return Cursor; +}(_parchment2.default.Embed); + +Cursor.blotName = 'cursor'; +Cursor.className = 'ql-cursor'; +Cursor.tagName = 'span'; +Cursor.CONTENTS = '\uFEFF'; // Zero width no break space + + +exports.default = Cursor; + +/***/ }), /* 25 */ -/***/ function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - var hasOwn = Object.prototype.hasOwnProperty; - var toStr = Object.prototype.toString; - var isArray = function isArray(arr) { - if (typeof Array.isArray === 'function') { - return Array.isArray(arr); - } +Object.defineProperty(exports, "__esModule", { + value: true +}); - return toStr.call(arr) === '[object Array]'; - }; +var _parchment = __webpack_require__(0); - var isPlainObject = function isPlainObject(obj) { - if (!obj || toStr.call(obj) !== '[object Object]') { - return false; - } +var _parchment2 = _interopRequireDefault(_parchment); - var hasOwnConstructor = hasOwn.call(obj, 'constructor'); - var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); - // Not own constructor property must be Object - if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { - return false; - } +var _block = __webpack_require__(4); - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - var key; - for (key in obj) {/**/} - - return typeof key === 'undefined' || hasOwn.call(obj, key); - }; - - module.exports = function extend() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0], - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if (typeof target === 'boolean') { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) { - target = {}; - } +var _block2 = _interopRequireDefault(_block); - for (; i < length; ++i) { - options = arguments[i]; - // Only deal with non-null/undefined values - if (options != null) { - // Extend the base object - for (name in options) { - src = target[name]; - copy = options[name]; - - // Prevent never-ending loop - if (target !== copy) { - // Recurse if we're merging plain objects or arrays - if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { - if (copyIsArray) { - copyIsArray = false; - clone = src && isArray(src) ? src : []; - } else { - clone = src && isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[name] = extend(deep, clone, copy); - - // Don't bring in undefined values - } else if (typeof copy !== 'undefined') { - target[name] = copy; - } - } - } - } - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - // Return the modified object - return target; - }; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var Container = function (_Parchment$Container) { + _inherits(Container, _Parchment$Container); -/***/ }, + function Container() { + _classCallCheck(this, Container); + + return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); + } + + return Container; +}(_parchment2.default.Container); + +Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; + +exports.default = Container; + +/***/ }), /* 26 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - var equal = __webpack_require__(22); - var extend = __webpack_require__(25); +"use strict"; - var lib = { - attributes: { - compose: function (a, b, keepNull) { - if (typeof a !== 'object') a = {}; - if (typeof b !== 'object') b = {}; - var attributes = extend(true, {}, b); - if (!keepNull) { - attributes = Object.keys(attributes).reduce(function (copy, key) { - if (attributes[key] != null) { - copy[key] = attributes[key]; - } - return copy; - }, {}); - } - for (var key in a) { - if (a[key] !== undefined && b[key] === undefined) { - attributes[key] = a[key]; - } - } - return Object.keys(attributes).length > 0 ? attributes : undefined; - }, - - diff: function(a, b) { - if (typeof a !== 'object') a = {}; - if (typeof b !== 'object') b = {}; - var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { - if (!equal(a[key], b[key])) { - attributes[key] = b[key] === undefined ? null : b[key]; - } - return attributes; - }, {}); - return Object.keys(attributes).length > 0 ? attributes : undefined; - }, - - transform: function (a, b, priority) { - if (typeof a !== 'object') return b; - if (typeof b !== 'object') return undefined; - if (!priority) return b; // b simply overwrites us without priority - var attributes = Object.keys(b).reduce(function (attributes, key) { - if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value - return attributes; - }, {}); - return Object.keys(attributes).length > 0 ? attributes : undefined; - } - }, - - iterator: function (ops) { - return new Iterator(ops); - }, - - length: function (op) { - if (typeof op['delete'] === 'number') { - return op['delete']; - } else if (typeof op.retain === 'number') { - return op.retain; - } else { - return typeof op.insert === 'string' ? op.insert.length : 1; - } - } - }; - - - function Iterator(ops) { - this.ops = ops; - this.index = 0; - this.offset = 0; - }; - - Iterator.prototype.hasNext = function () { - return this.peekLength() < Infinity; - }; - - Iterator.prototype.next = function (length) { - if (!length) length = Infinity; - var nextOp = this.ops[this.index]; - if (nextOp) { - var offset = this.offset; - var opLength = lib.length(nextOp) - if (length >= opLength - offset) { - length = opLength - offset; - this.index += 1; - this.offset = 0; - } else { - this.offset += length; - } - if (typeof nextOp['delete'] === 'number') { - return { 'delete': length }; - } else { - var retOp = {}; - if (nextOp.attributes) { - retOp.attributes = nextOp.attributes; - } - if (typeof nextOp.retain === 'number') { - retOp.retain = length; - } else if (typeof nextOp.insert === 'string') { - retOp.insert = nextOp.insert.substr(offset, length); - } else { - // offset should === 0, length should === 1 - retOp.insert = nextOp.insert; - } - return retOp; - } - } else { - return { retain: Infinity }; - } - }; - - Iterator.prototype.peek = function () { - return this.ops[this.index]; - }; - - Iterator.prototype.peekLength = function () { - if (this.ops[this.index]) { - // Should never return 0 if our index is being managed correctly - return lib.length(this.ops[this.index]) - this.offset; - } else { - return Infinity; - } - }; - - Iterator.prototype.peekType = function () { - if (this.ops[this.index]) { - if (typeof this.ops[this.index]['delete'] === 'number') { - return 'delete'; - } else if (typeof this.ops[this.index].retain === 'number') { - return 'retain'; - } else { - return 'insert'; - } - } - return 'retain'; - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - module.exports = lib; +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +var _parchment = __webpack_require__(0); -/***/ }, -/* 27 */ -/***/ function(module, exports, __webpack_require__) { +var _parchment2 = _interopRequireDefault(_parchment); - 'use strict'; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _quillDelta = __webpack_require__(20); - - var _quillDelta2 = _interopRequireDefault(_quillDelta); - - var _op = __webpack_require__(26); - - var _op2 = _interopRequireDefault(_op); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _code = __webpack_require__(28); - - var _code2 = _interopRequireDefault(_code); - - var _cursor = __webpack_require__(35); - - var _cursor2 = _interopRequireDefault(_cursor); - - var _block = __webpack_require__(29); - - var _block2 = _interopRequireDefault(_block); - - var _clone = __webpack_require__(39); - - var _clone2 = _interopRequireDefault(_clone); - - var _deepEqual = __webpack_require__(40); - - var _deepEqual2 = _interopRequireDefault(_deepEqual); - - var _extend = __webpack_require__(30); - - var _extend2 = _interopRequireDefault(_extend); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var Editor = function () { - function Editor(scroll) { - _classCallCheck(this, Editor); - - this.scroll = scroll; - this.delta = this.getDelta(); - } - - _createClass(Editor, [{ - key: 'applyDelta', - value: function applyDelta(delta) { - var _this = this; - - var consumeNextNewline = false; - this.scroll.update(); - var scrollLength = this.scroll.length(); - this.scroll.batch = true; - delta = normalizeDelta(delta); - delta.reduce(function (index, op) { - var length = op.retain || op.delete || op.insert.length || 1; - var attributes = op.attributes || {}; - if (op.insert != null) { - if (typeof op.insert === 'string') { - var text = op.insert; - if (text.endsWith('\n') && consumeNextNewline) { - consumeNextNewline = false; - text = text.slice(0, -1); - } - if (index >= scrollLength && !text.endsWith('\n')) { - consumeNextNewline = true; - } - _this.scroll.insertAt(index, text); - - var _scroll$line = _this.scroll.line(index), - _scroll$line2 = _slicedToArray(_scroll$line, 2), - line = _scroll$line2[0], - offset = _scroll$line2[1]; - - var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); - if (line instanceof _block2.default) { - var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), - _line$descendant2 = _slicedToArray(_line$descendant, 1), - leaf = _line$descendant2[0]; - - formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); - } - attributes = _op2.default.attributes.diff(formats, attributes) || {}; - } else if (_typeof(op.insert) === 'object') { - var key = Object.keys(op.insert)[0]; // There should only be one key - if (key == null) return index; - _this.scroll.insertAt(index, key, op.insert[key]); - } - scrollLength += length; - } - Object.keys(attributes).forEach(function (name) { - _this.scroll.formatAt(index, length, name, attributes[name]); - }); - return index + length; - }, 0); - delta.reduce(function (index, op) { - if (typeof op.delete === 'number') { - _this.scroll.deleteAt(index, op.delete); - return index; - } - return index + (op.retain || op.insert.length || 1); - }, 0); - this.scroll.batch = false; - this.scroll.optimize(); - return this.update(delta); - } - }, { - key: 'deleteText', - value: function deleteText(index, length) { - this.scroll.deleteAt(index, length); - return this.update(new _quillDelta2.default().retain(index).delete(length)); - } - }, { - key: 'formatLine', - value: function formatLine(index, length) { - var _this2 = this; - - var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - this.scroll.update(); - Object.keys(formats).forEach(function (format) { - var lines = _this2.scroll.lines(index, Math.max(length, 1)); - var lengthRemaining = length; - lines.forEach(function (line) { - var lineLength = line.length(); - if (!(line instanceof _code2.default)) { - line.format(format, formats[format]); - } else { - var codeIndex = index - line.offset(_this2.scroll); - var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; - line.formatAt(codeIndex, codeLength, format, formats[format]); - } - lengthRemaining -= lineLength; - }); - }); - this.scroll.optimize(); - return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); - } - }, { - key: 'formatText', - value: function formatText(index, length) { - var _this3 = this; - - var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - Object.keys(formats).forEach(function (format) { - _this3.scroll.formatAt(index, length, format, formats[format]); - }); - return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); - } - }, { - key: 'getContents', - value: function getContents(index, length) { - return this.delta.slice(index, index + length); - } - }, { - key: 'getDelta', - value: function getDelta() { - return this.scroll.lines().reduce(function (delta, line) { - return delta.concat(line.delta()); - }, new _quillDelta2.default()); - } - }, { - key: 'getFormat', - value: function getFormat(index) { - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var lines = [], - leaves = []; - if (length === 0) { - this.scroll.path(index).forEach(function (path) { - var _path = _slicedToArray(path, 1), - blot = _path[0]; - - if (blot instanceof _block2.default) { - lines.push(blot); - } else if (blot instanceof _parchment2.default.Leaf) { - leaves.push(blot); - } - }); - } else { - lines = this.scroll.lines(index, length); - leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); - } - var formatsArr = [lines, leaves].map(function (blots) { - if (blots.length === 0) return {}; - var formats = (0, _block.bubbleFormats)(blots.shift()); - while (Object.keys(formats).length > 0) { - var blot = blots.shift(); - if (blot == null) return formats; - formats = combineFormats((0, _block.bubbleFormats)(blot), formats); - } - return formats; - }); - return _extend2.default.apply(_extend2.default, formatsArr); - } - }, { - key: 'getText', - value: function getText(index, length) { - return this.getContents(index, length).filter(function (op) { - return typeof op.insert === 'string'; - }).map(function (op) { - return op.insert; - }).join(''); - } - }, { - key: 'insertEmbed', - value: function insertEmbed(index, embed, value) { - this.scroll.insertAt(index, embed, value); - return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); - } - }, { - key: 'insertText', - value: function insertText(index, text) { - var _this4 = this; - - var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); - this.scroll.insertAt(index, text); - Object.keys(formats).forEach(function (format) { - _this4.scroll.formatAt(index, text.length, format, formats[format]); - }); - return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); - } - }, { - key: 'isBlank', - value: function isBlank() { - if (this.scroll.children.length == 0) return true; - if (this.scroll.children.length > 1) return false; - var child = this.scroll.children.head; - return child.length() <= 1 && Object.keys(child.formats()).length == 0; - } - }, { - key: 'removeFormat', - value: function removeFormat(index, length) { - var text = this.getText(index, length); - - var _scroll$line3 = this.scroll.line(index + length), - _scroll$line4 = _slicedToArray(_scroll$line3, 2), - line = _scroll$line4[0], - offset = _scroll$line4[1]; - - var suffixLength = 0, - suffix = new _quillDelta2.default(); - if (line != null) { - if (!(line instanceof _code2.default)) { - suffixLength = line.length() - offset; - } else { - suffixLength = line.newlineIndex(offset) - offset + 1; - } - suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); - } - var contents = this.getContents(index, length + suffixLength); - var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); - var delta = new _quillDelta2.default().retain(index).concat(diff); - return this.applyDelta(delta); - } - }, { - key: 'update', - value: function update(change) { - var _this5 = this; - - var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; - - var oldDelta = this.delta; - if (mutations.length === 1 && mutations[0].type === 'characterData' && _parchment2.default.find(mutations[0].target)) { - (function () { - // Optimization for character changes - var textBlot = _parchment2.default.find(mutations[0].target); - var formats = (0, _block.bubbleFormats)(textBlot); - var index = textBlot.offset(_this5.scroll); - var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); - var oldText = new _quillDelta2.default().insert(oldValue); - var newText = new _quillDelta2.default().insert(textBlot.value()); - var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); - change = diffDelta.reduce(function (delta, op) { - if (op.insert) { - return delta.insert(op.insert, formats); - } else { - return delta.push(op); - } - }, new _quillDelta2.default()); - _this5.delta = oldDelta.compose(change); - })(); - } else { - this.delta = this.getDelta(); - if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { - change = oldDelta.diff(this.delta, cursorIndex); - } - } - return change; - } - }]); - - return Editor; - }(); - - function combineFormats(formats, combined) { - return Object.keys(combined).reduce(function (merged, name) { - if (formats[name] == null) return merged; - if (combined[name] === formats[name]) { - merged[name] = combined[name]; - } else if (Array.isArray(combined[name])) { - if (combined[name].indexOf(formats[name]) < 0) { - merged[name] = combined[name].concat([formats[name]]); - } - } else { - merged[name] = [combined[name], formats[name]]; - } - return merged; - }, {}); - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function normalizeDelta(delta) { - return delta.reduce(function (delta, op) { - if (op.insert === 1) { - var attributes = (0, _clone2.default)(op.attributes); - delete attributes['image']; - return delta.insert({ image: op.attributes.image }, attributes); - } - if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { - op = (0, _clone2.default)(op); - if (op.attributes.list) { - op.attributes.list = 'ordered'; - } else { - op.attributes.list = 'bullet'; - delete op.attributes.bullet; - } - } - if (typeof op.insert === 'string') { - var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); - return delta.insert(text, op.attributes); - } - return delta.push(op); - }, new _quillDelta2.default()); - } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - exports.default = Editor; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -/***/ }, -/* 28 */ -/***/ function(module, exports, __webpack_require__) { +var ColorAttributor = function (_Parchment$Attributor) { + _inherits(ColorAttributor, _Parchment$Attributor); - 'use strict'; + function ColorAttributor() { + _classCallCheck(this, ColorAttributor); - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.Code = undefined; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _quillDelta = __webpack_require__(20); - - var _quillDelta2 = _interopRequireDefault(_quillDelta); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _block = __webpack_require__(29); - - var _block2 = _interopRequireDefault(_block); - - var _inline = __webpack_require__(33); - - var _inline2 = _interopRequireDefault(_inline); - - var _text = __webpack_require__(34); - - var _text2 = _interopRequireDefault(_text); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var Code = function (_Inline) { - _inherits(Code, _Inline); - - function Code() { - _classCallCheck(this, Code); - - return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); - } - - return Code; - }(_inline2.default); - - Code.blotName = 'code'; - Code.tagName = 'CODE'; - - var CodeBlock = function (_Block) { - _inherits(CodeBlock, _Block); - - function CodeBlock() { - _classCallCheck(this, CodeBlock); - - return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); - } - - _createClass(CodeBlock, [{ - key: 'delta', - value: function delta() { - var _this3 = this; - - var text = this.domNode.textContent; - if (text.endsWith('\n')) { - // Should always be true - text = text.slice(0, -1); - } - return text.split('\n').reduce(function (delta, frag) { - return delta.insert(frag).insert('\n', _this3.formats()); - }, new _quillDelta2.default()); - } - }, { - key: 'format', - value: function format(name, value) { - if (name === this.statics.blotName && value) return; - - var _descendant = this.descendant(_text2.default, this.length() - 1), - _descendant2 = _slicedToArray(_descendant, 1), - text = _descendant2[0]; - - if (text != null) { - text.deleteAt(text.length() - 1, 1); - } - _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); - } - }, { - key: 'formatAt', - value: function formatAt(index, length, name, value) { - if (length === 0) return; - if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { - return; - } - var nextNewline = this.newlineIndex(index); - if (nextNewline < 0 || nextNewline >= index + length) return; - var prevNewline = this.newlineIndex(index, true) + 1; - var isolateLength = nextNewline - prevNewline + 1; - var blot = this.isolate(prevNewline, isolateLength); - var next = blot.next; - blot.format(name, value); - if (next instanceof CodeBlock) { - next.formatAt(0, index - prevNewline + length - isolateLength, name, value); - } - } - }, { - key: 'insertAt', - value: function insertAt(index, value, def) { - if (def != null) return; - - var _descendant3 = this.descendant(_text2.default, index), - _descendant4 = _slicedToArray(_descendant3, 2), - text = _descendant4[0], - offset = _descendant4[1]; - - text.insertAt(offset, value); - } - }, { - key: 'length', - value: function length() { - var length = this.domNode.textContent.length; - if (!this.domNode.textContent.endsWith('\n')) { - return length + 1; - } - return length; - } - }, { - key: 'newlineIndex', - value: function newlineIndex(searchIndex) { - var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (!reverse) { - var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); - return offset > -1 ? searchIndex + offset : -1; - } else { - return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); - } - } - }, { - key: 'optimize', - value: function optimize() { - if (!this.domNode.textContent.endsWith('\n')) { - this.appendChild(_parchment2.default.create('text', '\n')); - } - _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this); - var next = this.next; - if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { - next.optimize(); - next.moveChildren(this); - next.remove(); - } - } - }, { - key: 'replace', - value: function replace(target) { - _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); - [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { - var blot = _parchment2.default.find(node); - if (blot == null) { - node.parentNode.removeChild(node); - } else if (blot instanceof _parchment2.default.Embed) { - blot.remove(); - } else { - blot.unwrap(); - } - }); - } - }], [{ - key: 'create', - value: function create(value) { - var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); - domNode.setAttribute('spellcheck', false); - return domNode; - } - }, { - key: 'formats', - value: function formats() { - return true; - } - }]); - - return CodeBlock; - }(_block2.default); - - CodeBlock.blotName = 'code-block'; - CodeBlock.tagName = 'PRE'; - CodeBlock.TAB = ' '; + return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); + } - exports.Code = Code; - exports.default = CodeBlock; + _createClass(ColorAttributor, [{ + key: 'value', + value: function value(domNode) { + var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); + if (!value.startsWith('rgb(')) return value; + value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); + return '#' + value.split(',').map(function (component) { + return ('00' + parseInt(component).toString(16)).slice(-2); + }).join(''); + } + }]); -/***/ }, -/* 29 */ -/***/ function(module, exports, __webpack_require__) { + return ColorAttributor; +}(_parchment2.default.Attributor.Style); - 'use strict'; +var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { + scope: _parchment2.default.Scope.INLINE +}); +var ColorStyle = new ColorAttributor('color', 'color', { + scope: _parchment2.default.Scope.INLINE +}); - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _extend = __webpack_require__(30); - - var _extend2 = _interopRequireDefault(_extend); - - var _quillDelta = __webpack_require__(20); - - var _quillDelta2 = _interopRequireDefault(_quillDelta); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _break = __webpack_require__(31); - - var _break2 = _interopRequireDefault(_break); - - var _embed = __webpack_require__(32); - - var _embed2 = _interopRequireDefault(_embed); - - var _inline = __webpack_require__(33); - - var _inline2 = _interopRequireDefault(_inline); - - var _text = __webpack_require__(34); - - var _text2 = _interopRequireDefault(_text); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var NEWLINE_LENGTH = 1; - - var BlockEmbed = function (_Embed) { - _inherits(BlockEmbed, _Embed); - - function BlockEmbed() { - _classCallCheck(this, BlockEmbed); - - return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); - } - - _createClass(BlockEmbed, [{ - key: 'attach', - value: function attach() { - _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); - this.attributes = new _parchment2.default.Attributor.Store(this.domNode); - } - }, { - key: 'delta', - value: function delta() { - return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); - } - }, { - key: 'format', - value: function format(name, value) { - var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); - if (attribute != null) { - this.attributes.attribute(attribute, value); - } - } - }, { - key: 'formatAt', - value: function formatAt(index, length, name, value) { - this.format(name, value); - } - }, { - key: 'insertAt', - value: function insertAt(index, value, def) { - if (typeof value === 'string' && value.endsWith('\n')) { - var block = _parchment2.default.create(Block.blotName); - this.parent.insertBefore(block, index === 0 ? this : this.next); - block.insertAt(0, value.slice(0, -1)); - } else { - _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); - } - } - }]); - - return BlockEmbed; - }(_embed2.default); - - BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; - // It is important for cursor behavior BlockEmbeds use tags that are block level elements - - - var Block = function (_Parchment$Block) { - _inherits(Block, _Parchment$Block); - - function Block(domNode) { - _classCallCheck(this, Block); - - var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); - - _this2.cache = {}; - return _this2; - } - - _createClass(Block, [{ - key: 'delta', - value: function delta() { - if (this.cache.delta == null) { - this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { - if (leaf.length() === 0) { - return delta; - } else { - return delta.insert(leaf.value(), bubbleFormats(leaf)); - } - }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); - } - return this.cache.delta; - } - }, { - key: 'deleteAt', - value: function deleteAt(index, length) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); - this.cache = {}; - } - }, { - key: 'formatAt', - value: function formatAt(index, length, name, value) { - if (length <= 0) return; - if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { - if (index + length === this.length()) { - this.format(name, value); - } - } else { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); - } - this.cache = {}; - } - }, { - key: 'insertAt', - value: function insertAt(index, value, def) { - if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); - if (value.length === 0) return; - var lines = value.split('\n'); - var text = lines.shift(); - if (text.length > 0) { - if (index < this.length() - 1 || this.children.tail == null) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); - } else { - this.children.tail.insertAt(this.children.tail.length(), text); - } - this.cache = {}; - } - var block = this; - lines.reduce(function (index, line) { - block = block.split(index, true); - block.insertAt(0, line); - return line.length; - }, index + text.length); - } - }, { - key: 'insertBefore', - value: function insertBefore(blot, ref) { - var head = this.children.head; - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); - if (head instanceof _break2.default) { - head.remove(); - } - this.cache = {}; - } - }, { - key: 'length', - value: function length() { - if (this.cache.length == null) { - this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; - } - return this.cache.length; - } - }, { - key: 'moveChildren', - value: function moveChildren(target, ref) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); - this.cache = {}; - } - }, { - key: 'optimize', - value: function optimize() { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this); - this.cache = {}; - } - }, { - key: 'path', - value: function path(index) { - return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); - } - }, { - key: 'removeChild', - value: function removeChild(child) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); - this.cache = {}; - } - }, { - key: 'split', - value: function split(index) { - var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { - var clone = this.clone(); - if (index === 0) { - this.parent.insertBefore(clone, this); - return this; - } else { - this.parent.insertBefore(clone, this.next); - return clone; - } - } else { - var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); - this.cache = {}; - return next; - } - } - }]); - - return Block; - }(_parchment2.default.Block); - - Block.blotName = 'block'; - Block.tagName = 'P'; - Block.defaultChild = 'break'; - Block.allowedChildren = [_inline2.default, _embed2.default, _text2.default]; - - function bubbleFormats(blot) { - var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (blot == null) return formats; - if (typeof blot.formats === 'function') { - formats = (0, _extend2.default)(formats, blot.formats()); - } - if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { - return formats; - } - return bubbleFormats(blot.parent, formats); - } +exports.ColorAttributor = ColorAttributor; +exports.ColorClass = ColorClass; +exports.ColorStyle = ColorStyle; - exports.bubbleFormats = bubbleFormats; - exports.BlockEmbed = BlockEmbed; - exports.default = Block; +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 30 */ -/***/ function(module, exports) { +"use strict"; - 'use strict'; - var hasOwn = Object.prototype.hasOwnProperty; - var toStr = Object.prototype.toString; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sanitize = exports.default = undefined; - var isArray = function isArray(arr) { - if (typeof Array.isArray === 'function') { - return Array.isArray(arr); - } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - return toStr.call(arr) === '[object Array]'; - }; +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - var isPlainObject = function isPlainObject(obj) { - if (!obj || toStr.call(obj) !== '[object Object]') { - return false; - } +var _inline = __webpack_require__(6); - var hasOwnConstructor = hasOwn.call(obj, 'constructor'); - var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); - // Not own constructor property must be Object - if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { - return false; - } +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Link = function (_Inline) { + _inherits(Link, _Inline); + + function Link() { + _classCallCheck(this, Link); + + return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments)); + } + + _createClass(Link, [{ + key: 'format', + value: function format(name, value) { + if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value); + value = this.constructor.sanitize(value); + this.domNode.setAttribute('href', value); + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value); + value = this.sanitize(value); + node.setAttribute('href', value); + node.setAttribute('target', '_blank'); + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return domNode.getAttribute('href'); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL; + } + }]); + + return Link; +}(_inline2.default); + +Link.blotName = 'link'; +Link.tagName = 'A'; +Link.SANITIZED_URL = 'about:blank'; +Link.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel']; + +function _sanitize(url, protocols) { + var anchor = document.createElement('a'); + anchor.href = url; + var protocol = anchor.href.slice(0, anchor.href.indexOf(':')); + return protocols.indexOf(protocol) > -1; +} - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - var key; - for (key in obj) {/**/} - - return typeof key === 'undefined' || hasOwn.call(obj, key); - }; - - module.exports = function extend() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0], - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if (typeof target === 'boolean') { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) { - target = {}; - } +exports.default = Link; +exports.sanitize = _sanitize; - for (; i < length; ++i) { - options = arguments[i]; - // Only deal with non-null/undefined values - if (options != null) { - // Extend the base object - for (name in options) { - src = target[name]; - copy = options[name]; - - // Prevent never-ending loop - if (target !== copy) { - // Recurse if we're merging plain objects or arrays - if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { - if (copyIsArray) { - copyIsArray = false; - clone = src && isArray(src) ? src : []; - } else { - clone = src && isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[name] = extend(deep, clone, copy); - - // Don't bring in undefined values - } else if (typeof copy !== 'undefined') { - target[name] = copy; - } - } - } - } - } +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; - // Return the modified object - return target; - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -/***/ }, -/* 31 */ -/***/ function(module, exports, __webpack_require__) { +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - 'use strict'; +var _keyboard = __webpack_require__(23); - Object.defineProperty(exports, "__esModule", { - value: true - }); +var _keyboard2 = _interopRequireDefault(_keyboard); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _dropdown = __webpack_require__(107); + +var _dropdown2 = _interopRequireDefault(_dropdown); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var optionsCounter = 0; + +function toggleAriaAttribute(element, attribute) { + element.setAttribute(attribute, !(element.getAttribute(attribute) === 'true')); +} + +var Picker = function () { + function Picker(select) { + var _this = this; + + _classCallCheck(this, Picker); + + 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', function () { + _this.togglePicker(); + }); + this.label.addEventListener('keydown', function (event) { + switch (event.keyCode) { + // Allows the "Enter" key to open the picker + case _keyboard2.default.keys.ENTER: + _this.togglePicker(); + break; + + // Allows the "Escape" key to close the picker + case _keyboard2.default.keys.ESCAPE: + _this.escape(); + event.preventDefault(); + break; + default: + } + }); + this.select.addEventListener('change', this.update.bind(this)); + } + + _createClass(Picker, [{ + key: 'togglePicker', + value: function togglePicker() { + this.container.classList.toggle('ql-expanded'); + // Toggle aria-expanded and aria-hidden to make the picker accessible + toggleAriaAttribute(this.label, 'aria-expanded'); + toggleAriaAttribute(this.options, 'aria-hidden'); + } + }, { + key: 'buildItem', + value: function buildItem(option) { + var _this2 = this; + + var item = document.createElement('span'); + item.tabIndex = '0'; + item.setAttribute('role', 'button'); + + item.classList.add('ql-picker-item'); + if (option.hasAttribute('value')) { + item.setAttribute('data-value', option.getAttribute('value')); + } + if (option.textContent) { + item.setAttribute('data-label', option.textContent); + } + item.addEventListener('click', function () { + _this2.selectItem(item, true); + }); + item.addEventListener('keydown', function (event) { + switch (event.keyCode) { + // Allows the "Enter" key to select an item + case _keyboard2.default.keys.ENTER: + _this2.selectItem(item, true); + event.preventDefault(); + break; + + // Allows the "Escape" key to close the picker + case _keyboard2.default.keys.ESCAPE: + _this2.escape(); + event.preventDefault(); + break; + default: + } + }); + + return item; + } + }, { + key: 'buildLabel', + value: function buildLabel() { + var label = document.createElement('span'); + label.classList.add('ql-picker-label'); + label.innerHTML = _dropdown2.default; + label.tabIndex = '0'; + label.setAttribute('role', 'button'); + label.setAttribute('aria-expanded', 'false'); + this.container.appendChild(label); + return label; + } + }, { + key: 'buildOptions', + value: function buildOptions() { + var _this3 = this; + + var options = document.createElement('span'); + options.classList.add('ql-picker-options'); + + // Don't want screen readers to read this until options are visible + options.setAttribute('aria-hidden', 'true'); + options.tabIndex = '-1'; + + // Need a unique id for aria-controls + options.id = 'ql-picker-options-' + optionsCounter; + optionsCounter += 1; + this.label.setAttribute('aria-controls', options.id); + + this.options = options; + + [].slice.call(this.select.options).forEach(function (option) { + var item = _this3.buildItem(option); + options.appendChild(item); + if (option.selected === true) { + _this3.selectItem(item); + } + }); + this.container.appendChild(options); + } + }, { + key: 'buildPicker', + value: function buildPicker() { + var _this4 = this; + + [].slice.call(this.select.attributes).forEach(function (item) { + _this4.container.setAttribute(item.name, item.value); + }); + this.container.classList.add('ql-picker'); + this.label = this.buildLabel(); + this.buildOptions(); + } + }, { + key: 'escape', + value: function escape() { + var _this5 = this; + + // Close menu and return focus to trigger label + this.close(); + // Need setTimeout for accessibility to ensure that the browser executes + // focus on the next process thread and after any DOM content changes + setTimeout(function () { + return _this5.label.focus(); + }, 1); + } + }, { + key: 'close', + value: function close() { + this.container.classList.remove('ql-expanded'); + this.label.setAttribute('aria-expanded', 'false'); + this.options.setAttribute('aria-hidden', 'true'); + } + }, { + key: 'selectItem', + value: function selectItem(item) { + var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var selected = this.container.querySelector('.ql-selected'); + if (item === selected) return; + if (selected != null) { + selected.classList.remove('ql-selected'); + } + if (item == null) return; + item.classList.add('ql-selected'); + this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item); + if (item.hasAttribute('data-value')) { + this.label.setAttribute('data-value', item.getAttribute('data-value')); + } else { + this.label.removeAttribute('data-value'); + } + if (item.hasAttribute('data-label')) { + this.label.setAttribute('data-label', item.getAttribute('data-label')); + } else { + this.label.removeAttribute('data-label'); + } + if (trigger) { + if (typeof Event === 'function') { + this.select.dispatchEvent(new Event('change')); + } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') { + // IE11 + var event = document.createEvent('Event'); + event.initEvent('change', true, true); + this.select.dispatchEvent(event); + } + this.close(); + } + } + }, { + key: 'update', + value: function update() { + var option = void 0; + if (this.select.selectedIndex > -1) { + var 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); + } + var isActive = option != null && option !== this.select.querySelector('option[selected]'); + this.label.classList.toggle('ql-active', isActive); + } + }]); - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + return Picker; +}(); - var _embed = __webpack_require__(32); +exports.default = Picker; - var _embed2 = _interopRequireDefault(_embed); +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +"use strict"; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +Object.defineProperty(exports, "__esModule", { + value: true +}); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _parchment = __webpack_require__(0); - var Break = function (_Embed) { - _inherits(Break, _Embed); +var _parchment2 = _interopRequireDefault(_parchment); - function Break() { - _classCallCheck(this, Break); +var _quill = __webpack_require__(5); - return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); - } +var _quill2 = _interopRequireDefault(_quill); - _createClass(Break, [{ - key: 'insertInto', - value: function insertInto(parent, ref) { - if (parent.children.length === 0) { - _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); - } else { - this.remove(); - } - } - }, { - key: 'length', - value: function length() { - return 0; - } - }, { - key: 'value', - value: function value() { - return ''; - } - }], [{ - key: 'value', - value: function value() { - return undefined; - } - }]); +var _block = __webpack_require__(4); - return Break; - }(_embed2.default); +var _block2 = _interopRequireDefault(_block); - Break.blotName = 'break'; - Break.tagName = 'BR'; +var _break = __webpack_require__(16); - exports.default = Break; +var _break2 = _interopRequireDefault(_break); -/***/ }, -/* 32 */ -/***/ function(module, exports, __webpack_require__) { +var _container = __webpack_require__(25); - 'use strict'; +var _container2 = _interopRequireDefault(_container); - Object.defineProperty(exports, "__esModule", { - value: true - }); +var _cursor = __webpack_require__(24); - var _parchment = __webpack_require__(2); +var _cursor2 = _interopRequireDefault(_cursor); - var _parchment2 = _interopRequireDefault(_parchment); +var _embed = __webpack_require__(35); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _embed2 = _interopRequireDefault(_embed); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _inline = __webpack_require__(6); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var _inline2 = _interopRequireDefault(_inline); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _scroll = __webpack_require__(22); - var Embed = function (_Parchment$Embed) { - _inherits(Embed, _Parchment$Embed); +var _scroll2 = _interopRequireDefault(_scroll); - function Embed() { - _classCallCheck(this, Embed); +var _text = __webpack_require__(7); - return _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).apply(this, arguments)); - } +var _text2 = _interopRequireDefault(_text); - return Embed; - }(_parchment2.default.Embed); +var _clipboard = __webpack_require__(55); - exports.default = Embed; +var _clipboard2 = _interopRequireDefault(_clipboard); -/***/ }, -/* 33 */ -/***/ function(module, exports, __webpack_require__) { +var _history = __webpack_require__(42); - 'use strict'; +var _history2 = _interopRequireDefault(_history); - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _embed = __webpack_require__(32); - - var _embed2 = _interopRequireDefault(_embed); - - var _text = __webpack_require__(34); - - var _text2 = _interopRequireDefault(_text); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var Inline = function (_Parchment$Inline) { - _inherits(Inline, _Parchment$Inline); - - function Inline() { - _classCallCheck(this, Inline); - - return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); - } - - _createClass(Inline, [{ - key: 'formatAt', - value: function formatAt(index, length, name, value) { - if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { - var blot = this.isolate(index, length); - if (value) { - blot.wrap(name, value); - } - } else { - _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); - } - } - }, { - key: 'optimize', - value: function optimize() { - _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this); - if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { - var parent = this.parent.isolate(this.offset(), this.length()); - this.moveChildren(parent); - parent.wrap(this); - } - } - }], [{ - key: 'compare', - value: function compare(self, other) { - var selfIndex = Inline.order.indexOf(self); - var otherIndex = Inline.order.indexOf(other); - if (selfIndex >= 0 || otherIndex >= 0) { - return selfIndex - otherIndex; - } else if (self === other) { - return 0; - } else if (self < other) { - return -1; - } else { - return 1; - } - } - }]); - - return Inline; - }(_parchment2.default.Inline); - - Inline.allowedChildren = [Inline, _embed2.default, _text2.default]; - // Lower index means deeper in the DOM tree, since not found (-1) is for embeds - Inline.order = ['cursor', 'inline', // Must be lower - 'code', 'underline', 'strike', 'italic', 'bold', 'script', 'link' // Must be higher - ]; +var _keyboard = __webpack_require__(23); - exports.default = Inline; +var _keyboard2 = _interopRequireDefault(_keyboard); -/***/ }, -/* 34 */ -/***/ function(module, exports, __webpack_require__) { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - 'use strict'; +_quill2.default.register({ + 'blots/block': _block2.default, + 'blots/block/embed': _block.BlockEmbed, + 'blots/break': _break2.default, + 'blots/container': _container2.default, + 'blots/cursor': _cursor2.default, + 'blots/embed': _embed2.default, + 'blots/inline': _inline2.default, + 'blots/scroll': _scroll2.default, + 'blots/text': _text2.default, - Object.defineProperty(exports, "__esModule", { - value: true - }); + 'modules/clipboard': _clipboard2.default, + 'modules/history': _history2.default, + 'modules/keyboard': _keyboard2.default +}); - var _parchment = __webpack_require__(2); +_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); - var _parchment2 = _interopRequireDefault(_parchment); +exports.default = _quill2.default; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +"use strict"; - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var ShadowBlot = /** @class */ (function () { + function ShadowBlot(domNode) { + this.domNode = domNode; + // @ts-ignore + this.domNode[Registry.DATA_KEY] = { blot: this }; + } + Object.defineProperty(ShadowBlot.prototype, "statics", { + // Hack for accessing inherited static methods + get: function () { + return this.constructor; + }, + enumerable: true, + configurable: true + }); + ShadowBlot.create = function (value) { + if (this.tagName == null) { + throw new Registry.ParchmentError('Blot definition missing tagName'); + } + var node; + if (Array.isArray(this.tagName)) { + if (typeof value === 'string') { + value = value.toUpperCase(); + if (parseInt(value).toString() === value) { + value = parseInt(value); + } + } + if (typeof value === 'number') { + node = document.createElement(this.tagName[value - 1]); + } + else if (this.tagName.indexOf(value) > -1) { + node = document.createElement(value); + } + else { + node = document.createElement(this.tagName[0]); + } + } + else { + node = document.createElement(this.tagName); + } + if (this.className) { + node.classList.add(this.className); + } + return node; + }; + ShadowBlot.prototype.attach = function () { + if (this.parent != null) { + this.scroll = this.parent.scroll; + } + }; + ShadowBlot.prototype.clone = function () { + var domNode = this.domNode.cloneNode(false); + return Registry.create(domNode); + }; + ShadowBlot.prototype.detach = function () { + if (this.parent != null) + this.parent.removeChild(this); + // @ts-ignore + delete this.domNode[Registry.DATA_KEY]; + }; + ShadowBlot.prototype.deleteAt = function (index, length) { + var blot = this.isolate(index, length); + blot.remove(); + }; + ShadowBlot.prototype.formatAt = function (index, length, name, value) { + var blot = this.isolate(index, length); + if (Registry.query(name, Registry.Scope.BLOT) != null && value) { + blot.wrap(name, value); + } + else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { + var parent = Registry.create(this.statics.scope); + blot.wrap(parent); + parent.format(name, value); + } + }; + ShadowBlot.prototype.insertAt = function (index, value, def) { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + var ref = this.split(index); + this.parent.insertBefore(blot, ref); + }; + ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { + if (refBlot === void 0) { refBlot = null; } + if (this.parent != null) { + this.parent.children.remove(this); + } + var refDomNode = null; + parentBlot.children.insertBefore(this, refBlot); + if (refBlot != null) { + refDomNode = refBlot.domNode; + } + if (this.domNode.parentNode != parentBlot.domNode || + this.domNode.nextSibling != refDomNode) { + parentBlot.domNode.insertBefore(this.domNode, refDomNode); + } + this.parent = parentBlot; + this.attach(); + }; + ShadowBlot.prototype.isolate = function (index, length) { + var target = this.split(index); + target.split(length); + return target; + }; + ShadowBlot.prototype.length = function () { + return 1; + }; + ShadowBlot.prototype.offset = function (root) { + if (root === void 0) { root = this.parent; } + if (this.parent == null || this == root) + return 0; + return this.parent.children.offset(this) + this.parent.offset(root); + }; + ShadowBlot.prototype.optimize = function (context) { + // TODO clean up once we use WeakMap + // @ts-ignore + if (this.domNode[Registry.DATA_KEY] != null) { + // @ts-ignore + delete this.domNode[Registry.DATA_KEY].mutations; + } + }; + ShadowBlot.prototype.remove = function () { + if (this.domNode.parentNode != null) { + this.domNode.parentNode.removeChild(this.domNode); + } + this.detach(); + }; + ShadowBlot.prototype.replace = function (target) { + if (target.parent == null) + return; + target.parent.insertBefore(this, target.next); + target.remove(); + }; + ShadowBlot.prototype.replaceWith = function (name, value) { + var replacement = typeof name === 'string' ? Registry.create(name, value) : name; + replacement.replace(this); + return replacement; + }; + ShadowBlot.prototype.split = function (index, force) { + return index === 0 ? this : this.next; + }; + ShadowBlot.prototype.update = function (mutations, context) { + // Nothing to do by default + }; + ShadowBlot.prototype.wrap = function (name, value) { + var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; + if (this.parent != null) { + this.parent.insertBefore(wrapper, this.next); + } + wrapper.appendChild(this); + return wrapper; + }; + ShadowBlot.blotName = 'abstract'; + return ShadowBlot; +}()); +exports.default = ShadowBlot; - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var TextBlot = function (_Parchment$Text) { - _inherits(TextBlot, _Parchment$Text); +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { - function TextBlot() { - _classCallCheck(this, TextBlot); +"use strict"; - return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); - } +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(32); +var style_1 = __webpack_require__(33); +var Registry = __webpack_require__(1); +var AttributorStore = /** @class */ (function () { + function AttributorStore(domNode) { + this.attributes = {}; + this.domNode = domNode; + this.build(); + } + AttributorStore.prototype.attribute = function (attribute, value) { + // verb + if (value) { + if (attribute.add(this.domNode, value)) { + if (attribute.value(this.domNode) != null) { + this.attributes[attribute.attrName] = attribute; + } + else { + delete this.attributes[attribute.attrName]; + } + } + } + else { + attribute.remove(this.domNode); + delete this.attributes[attribute.attrName]; + } + }; + AttributorStore.prototype.build = function () { + var _this = this; + this.attributes = {}; + var attributes = attributor_1.default.keys(this.domNode); + var classes = class_1.default.keys(this.domNode); + var styles = style_1.default.keys(this.domNode); + attributes + .concat(classes) + .concat(styles) + .forEach(function (name) { + var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); + if (attr instanceof attributor_1.default) { + _this.attributes[attr.attrName] = attr; + } + }); + }; + AttributorStore.prototype.copy = function (target) { + var _this = this; + Object.keys(this.attributes).forEach(function (key) { + var value = _this.attributes[key].value(_this.domNode); + target.format(key, value); + }); + }; + AttributorStore.prototype.move = function (target) { + var _this = this; + this.copy(target); + Object.keys(this.attributes).forEach(function (key) { + _this.attributes[key].remove(_this.domNode); + }); + this.attributes = {}; + }; + AttributorStore.prototype.values = function () { + var _this = this; + return Object.keys(this.attributes).reduce(function (attributes, name) { + attributes[name] = _this.attributes[name].value(_this.domNode); + return attributes; + }, {}); + }; + return AttributorStore; +}()); +exports.default = AttributorStore; - return TextBlot; - }(_parchment2.default.Text); - exports.default = TextBlot; +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 35 */ -/***/ function(module, exports, __webpack_require__) { +"use strict"; - 'use strict'; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function match(node, prefix) { + var className = node.getAttribute('class') || ''; + return className.split(/\s+/).filter(function (name) { + return name.indexOf(prefix + "-") === 0; + }); +} +var ClassAttributor = /** @class */ (function (_super) { + __extends(ClassAttributor, _super); + function ClassAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + ClassAttributor.keys = function (node) { + return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { + return name + .split('-') + .slice(0, -1) + .join('-'); + }); + }; + ClassAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + this.remove(node); + node.classList.add(this.keyName + "-" + value); + return true; + }; + ClassAttributor.prototype.remove = function (node) { + var matches = match(node, this.keyName); + matches.forEach(function (name) { + node.classList.remove(name); + }); + if (node.classList.length === 0) { + node.removeAttribute('class'); + } + }; + ClassAttributor.prototype.value = function (node) { + var result = match(node, this.keyName)[0] || ''; + var value = result.slice(this.keyName.length + 1); // +1 for hyphen + return this.canAdd(node, value) ? value : ''; + }; + return ClassAttributor; +}(attributor_1.default)); +exports.default = ClassAttributor; - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _embed = __webpack_require__(32); - - var _embed2 = _interopRequireDefault(_embed); - - var _text = __webpack_require__(34); - - var _text2 = _interopRequireDefault(_text); - - var _emitter = __webpack_require__(36); - - var _emitter2 = _interopRequireDefault(_emitter); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var Cursor = function (_Embed) { - _inherits(Cursor, _Embed); - - _createClass(Cursor, null, [{ - key: 'value', - value: function value() { - return undefined; - } - }]); - - function Cursor(domNode, selection) { - _classCallCheck(this, Cursor); - - var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); - - _this.selection = selection; - _this.textNode = document.createTextNode(Cursor.CONTENTS); - _this.domNode.appendChild(_this.textNode); - _this._length = 0; - return _this; - } - - _createClass(Cursor, [{ - key: 'detach', - value: function detach() { - // super.detach() will also clear domNode.__blot - if (this.parent != null) this.parent.removeChild(this); - } - }, { - key: 'format', - value: function format(name, value) { - if (this._length !== 0) { - return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); - } - var target = this, - index = 0; - while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { - index += target.offset(target.parent); - target = target.parent; - } - if (target != null) { - this._length = Cursor.CONTENTS.length; - target.optimize(); - target.formatAt(index, Cursor.CONTENTS.length, name, value); - this._length = 0; - } - } - }, { - key: 'index', - value: function index(node, offset) { - if (node === this.textNode) return 0; - return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); - } - }, { - key: 'length', - value: function length() { - return this._length; - } - }, { - key: 'position', - value: function position() { - return [this.textNode, this.textNode.data.length]; - } - }, { - key: 'remove', - value: function remove() { - _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); - this.parent = null; - } - }, { - key: 'restore', - value: function restore() { - var _this2 = this; - - if (this.selection.composing) return; - if (this.parent == null) return; - var textNode = this.textNode; - var range = this.selection.getNativeRange(); - var restoreText = void 0, - start = void 0, - end = void 0; - if (range != null && range.start.node === textNode && range.end.node === textNode) { - var _ref = [textNode, range.start.offset, range.end.offset]; - restoreText = _ref[0]; - start = _ref[1]; - end = _ref[2]; - } - // Link format will insert text outside of anchor tag - while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { - this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); - } - if (this.textNode.data !== Cursor.CONTENTS) { - var text = this.textNode.data.split(Cursor.CONTENTS).join(''); - if (this.next instanceof _text2.default) { - restoreText = this.next.domNode; - this.next.insertAt(0, text); - this.textNode.data = Cursor.CONTENTS; - } else { - this.textNode.data = text; - this.parent.insertBefore(_parchment2.default.create(this.textNode), this); - this.textNode = document.createTextNode(Cursor.CONTENTS); - this.domNode.appendChild(this.textNode); - } - } - this.remove(); - if (start == null) return; - this.selection.emitter.once(_emitter2.default.events.SCROLL_OPTIMIZE, function () { - var _map = [start, end].map(function (offset) { - return Math.max(0, Math.min(restoreText.data.length, offset - 1)); - }); - - var _map2 = _slicedToArray(_map, 2); - - start = _map2[0]; - end = _map2[1]; - - _this2.selection.setNativeRange(restoreText, start, restoreText, end); - }); - } - }, { - key: 'update', - value: function update(mutations) { - var _this3 = this; - - mutations.forEach(function (mutation) { - if (mutation.type === 'characterData' && mutation.target === _this3.textNode) { - _this3.restore(); - } - }); - } - }, { - key: 'value', - value: function value() { - return ''; - } - }]); - - return Cursor; - }(_embed2.default); - - Cursor.blotName = 'cursor'; - Cursor.className = 'ql-cursor'; - Cursor.tagName = 'span'; - Cursor.CONTENTS = '\uFEFF'; // Zero width no break space +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { - exports.default = Cursor; +"use strict"; -/***/ }, -/* 36 */ -/***/ function(module, exports, __webpack_require__) { +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function camelize(name) { + var parts = name.split('-'); + var rest = parts + .slice(1) + .map(function (part) { + return part[0].toUpperCase() + part.slice(1); + }) + .join(''); + return parts[0] + rest; +} +var StyleAttributor = /** @class */ (function (_super) { + __extends(StyleAttributor, _super); + function StyleAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + StyleAttributor.keys = function (node) { + return (node.getAttribute('style') || '').split(';').map(function (value) { + var arr = value.split(':'); + return arr[0].trim(); + }); + }; + StyleAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + // @ts-ignore + node.style[camelize(this.keyName)] = value; + return true; + }; + StyleAttributor.prototype.remove = function (node) { + // @ts-ignore + node.style[camelize(this.keyName)] = ''; + if (!node.getAttribute('style')) { + node.removeAttribute('style'); + } + }; + StyleAttributor.prototype.value = function (node) { + // @ts-ignore + var value = node.style[camelize(this.keyName)]; + return this.canAdd(node, value) ? value : ''; + }; + return StyleAttributor; +}(attributor_1.default)); +exports.default = StyleAttributor; - 'use strict'; - Object.defineProperty(exports, "__esModule", { - value: true - }); +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var Theme = function () { + function Theme(quill, options) { + _classCallCheck(this, Theme); + + this.quill = quill; + this.options = options; + this.modules = {}; + } + + _createClass(Theme, [{ + key: 'init', + value: function init() { + var _this = this; + + Object.keys(this.options.modules).forEach(function (name) { + if (_this.modules[name] == null) { + _this.addModule(name); + } + }); + } + }, { + key: 'addModule', + value: function addModule(name) { + var moduleClass = this.quill.constructor.import('modules/' + name); + this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); + return this.modules[name]; + } + }]); + + return Theme; +}(); + +Theme.DEFAULTS = { + modules: {} +}; +Theme.themes = { + 'default': Theme +}; - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +exports.default = Theme; - var _eventemitter = __webpack_require__(37); +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; - var _eventemitter2 = _interopRequireDefault(_eventemitter); - var _logger = __webpack_require__(38); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _logger2 = _interopRequireDefault(_logger); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _parchment = __webpack_require__(0); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var _parchment2 = _interopRequireDefault(_parchment); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var GUARD_TEXT = '\uFEFF'; + +var Embed = function (_Parchment$Embed) { + _inherits(Embed, _Parchment$Embed); + + function Embed(node) { + _classCallCheck(this, Embed); + + var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node)); + + _this.contentNode = document.createElement('span'); + _this.contentNode.setAttribute('contenteditable', false); + [].slice.call(_this.domNode.childNodes).forEach(function (childNode) { + _this.contentNode.appendChild(childNode); + }); + _this.leftGuard = document.createTextNode(GUARD_TEXT); + _this.rightGuard = document.createTextNode(GUARD_TEXT); + _this.domNode.appendChild(_this.leftGuard); + _this.domNode.appendChild(_this.contentNode); + _this.domNode.appendChild(_this.rightGuard); + return _this; + } + + _createClass(Embed, [{ + key: 'index', + value: function index(node, offset) { + if (node === this.leftGuard) return 0; + if (node === this.rightGuard) return 1; + return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'restore', + value: function restore(node) { + var range = void 0, + textNode = void 0; + var text = node.data.split(GUARD_TEXT).join(''); + if (node === this.leftGuard) { + if (this.prev instanceof _text2.default) { + var prevLength = this.prev.length(); + this.prev.insertAt(prevLength, text); + range = { + startNode: this.prev.domNode, + startOffset: prevLength + text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } else if (node === this.rightGuard) { + if (this.next instanceof _text2.default) { + this.next.insertAt(0, text); + range = { + startNode: this.next.domNode, + startOffset: text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this.next); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } + node.data = GUARD_TEXT; + return range; + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + mutations.forEach(function (mutation) { + if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) { + var range = _this2.restore(mutation.target); + if (range) context.range = range; + } + }); + } + }]); - var debug = (0, _logger2.default)('quill:events'); + return Embed; +}(_parchment2.default.Embed); - var Emitter = function (_EventEmitter) { - _inherits(Emitter, _EventEmitter); +exports.default = Embed; - function Emitter() { - _classCallCheck(this, Emitter); +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { - var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; - _this.on('error', debug.error); - return _this; - } +var _parchment = __webpack_require__(0); - _createClass(Emitter, [{ - key: 'emit', - value: function emit() { - debug.log.apply(debug, arguments); - _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); - } - }]); +var _parchment2 = _interopRequireDefault(_parchment); - return Emitter; - }(_eventemitter2.default); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - Emitter.events = { - EDITOR_CHANGE: 'editor-change', - SCROLL_BEFORE_UPDATE: 'scroll-before-update', - SCROLL_OPTIMIZE: 'scroll-optimize', - SCROLL_UPDATE: 'scroll-update', - SELECTION_CHANGE: 'selection-change', - TEXT_CHANGE: 'text-change' - }; - Emitter.sources = { - API: 'api', - SILENT: 'silent', - USER: 'user' - }; +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['right', 'center', 'justify'] +}; - exports.default = Emitter; +var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); +var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); +var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); -/***/ }, +exports.AlignAttribute = AlignAttribute; +exports.AlignClass = AlignClass; +exports.AlignStyle = AlignStyle; + +/***/ }), /* 37 */ -/***/ function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - var has = Object.prototype.hasOwnProperty - , prefix = '~'; - /** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @api private - */ - function Events() {} - - // - // We try to not inherit from `Object.prototype`. In some engines creating an - // instance in this way is faster than calling `Object.create(null)` directly. - // If `Object.create(null)` is not supported we prefix the event names with a - // character to make sure that the built-in object properties are not - // overridden or used as an attack vector. - // - if (Object.create) { - Events.prototype = Object.create(null); - - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BackgroundStyle = exports.BackgroundClass = undefined; - /** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {Mixed} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @api private - */ - function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; - } +var _parchment = __webpack_require__(0); - /** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @api public - */ - function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; - } +var _parchment2 = _interopRequireDefault(_parchment); - /** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @api public - */ - EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - - if (this._eventsCount === 0) return names; - - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } - - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - - return names; - }; - - /** - * Return the listeners registered for a given event. - * - * @param {String|Symbol} event The event name. - * @param {Boolean} exists Only check if there are listeners. - * @returns {Array|Boolean} - * @api public - */ - EventEmitter.prototype.listeners = function listeners(event, exists) { - var evt = prefix ? prefix + event : event - , available = this._events[evt]; - - if (exists) return !!available; - if (!available) return []; - if (available.fn) return [available.fn]; - - for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { - ee[i] = available[i].fn; - } - - return ee; - }; - - /** - * Calls each of the listeners registered for a given event. - * - * @param {String|Symbol} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @api public - */ - EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return false; - - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - - 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++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - - switch (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 true; - }; - - /** - * Add a listener for a given event. - * - * @param {String|Symbol} event The event name. - * @param {Function} fn The listener function. - * @param {Mixed} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @api public - */ - EventEmitter.prototype.on = function on(event, fn, context) { - var listener = new EE(fn, context || this) - , evt = prefix ? prefix + event : event; - - if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; - else if (!this._events[evt].fn) this._events[evt].push(listener); - else this._events[evt] = [this._events[evt], listener]; - - return this; - }; - - /** - * Add a one-time listener for a given event. - * - * @param {String|Symbol} event The event name. - * @param {Function} fn The listener function. - * @param {Mixed} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @api public - */ - EventEmitter.prototype.once = function once(event, fn, context) { - var listener = new EE(fn, context || this, true) - , evt = prefix ? prefix + event : event; - - if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; - else if (!this._events[evt].fn) this._events[evt].push(listener); - else this._events[evt] = [this._events[evt], listener]; - - return this; - }; - - /** - * Remove the listeners of a given event. - * - * @param {String|Symbol} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {Mixed} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @api public - */ - EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return this; - if (!fn) { - if (--this._eventsCount === 0) this._events = new Events(); - else delete this._events[evt]; - return this; - } - - var listeners = this._events[evt]; - - if (listeners.fn) { - if ( - listeners.fn === fn - && (!once || listeners.once) - && (!context || listeners.context === context) - ) { - if (--this._eventsCount === 0) this._events = new Events(); - else delete this._events[evt]; - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn - || (once && !listeners[i].once) - || (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else if (--this._eventsCount === 0) this._events = new Events(); - else delete this._events[evt]; - } - - return this; - }; - - /** - * Remove all listeners, or those of the specified event. - * - * @param {String|Symbol} [event] The event name. - * @returns {EventEmitter} `this`. - * @api public - */ - EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) { - if (--this._eventsCount === 0) this._events = new Events(); - else delete this._events[evt]; - } - } else { - this._events = new Events(); - this._eventsCount = 0; - } - - return this; - }; - - // - // Alias methods names because people roll like that. - // - EventEmitter.prototype.off = EventEmitter.prototype.removeListener; - EventEmitter.prototype.addListener = EventEmitter.prototype.on; - - // - // This function doesn't apply anymore. - // - EventEmitter.prototype.setMaxListeners = function setMaxListeners() { - return this; - }; - - // - // Expose the prefix. - // - EventEmitter.prefixed = prefix; - - // - // Allow `EventEmitter` to be imported as module namespace. - // - EventEmitter.EventEmitter = EventEmitter; - - // - // Expose the module. - // - if ('undefined' !== typeof module) { - module.exports = EventEmitter; - } +var _color = __webpack_require__(26); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { + scope: _parchment2.default.Scope.INLINE +}); +var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { + scope: _parchment2.default.Scope.INLINE +}); -/***/ }, +exports.BackgroundClass = BackgroundClass; +exports.BackgroundStyle = BackgroundStyle; + +/***/ }), /* 38 */ -/***/ function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - var levels = ['error', 'warn', 'log', 'info']; - var level = 'warn'; - - function debug(method) { - if (levels.indexOf(method) <= levels.indexOf(level)) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - console[method].apply(console, args); // eslint-disable-line no-console - } - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; - function namespace(ns) { - return levels.reduce(function (logger, method) { - logger[method] = debug.bind(console, method, ns); - return logger; - }, {}); - } +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); - debug.level = namespace.level = function (newLevel) { - level = newLevel; - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - exports.default = namespace; +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['rtl'] +}; -/***/ }, +var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); +var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); +var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); + +exports.DirectionAttribute = DirectionAttribute; +exports.DirectionClass = DirectionClass; +exports.DirectionStyle = DirectionStyle; + +/***/ }), /* 39 */ -/***/ function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { - var clone = (function() { - 'use strict'; +"use strict"; - var nativeMap; - try { - nativeMap = Map; - } catch(_) { - // maybe a reference error because no `Map`. Give it a dummy value that no - // value will ever be an instanceof. - nativeMap = function() {}; - } - var nativeSet; - try { - nativeSet = Set; - } catch(_) { - nativeSet = function() {}; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FontClass = exports.FontStyle = undefined; - var nativePromise; - try { - nativePromise = Promise; - } catch(_) { - nativePromise = function() {}; - } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - /** - * Clones (copies) an Object using deep copying. - * - * This function supports circular references by default, but if you are certain - * there are no circular references in your object, you can save some CPU time - * by calling clone(obj, false). - * - * Caution: if `circular` is false and `parent` contains circular references, - * your program may enter an infinite loop and crash. - * - * @param `parent` - the object to be cloned - * @param `circular` - set to true if the object to be cloned may contain - * circular references. (optional - true by default) - * @param `depth` - set to a number if the object is only to be cloned to - * a particular depth. (optional - defaults to Infinity) - * @param `prototype` - sets the prototype to be used when cloning an object. - * (optional - defaults to parent prototype). - */ - function clone(parent, circular, depth, prototype) { - var filter; - if (typeof circular === 'object') { - depth = circular.depth; - prototype = circular.prototype; - filter = circular.filter; - circular = circular.circular; - } - // maintain two arrays for circular references, where corresponding parents - // and children have the same index - var allParents = []; - var allChildren = []; - - var useBuffer = typeof Buffer != 'undefined'; - - if (typeof circular == 'undefined') - circular = true; - - if (typeof depth == 'undefined') - depth = Infinity; - - // recurse this function so we don't reset allParents and allChildren - function _clone(parent, depth) { - // cloning null always returns null - if (parent === null) - return null; - - if (depth === 0) - return parent; - - var child; - var proto; - if (typeof parent != 'object') { - return parent; - } - - if (parent instanceof nativeMap) { - child = new nativeMap(); - } else if (parent instanceof nativeSet) { - child = new nativeSet(); - } else if (parent instanceof nativePromise) { - child = new nativePromise(function (resolve, reject) { - parent.then(function(value) { - resolve(_clone(value, depth - 1)); - }, function(err) { - reject(_clone(err, depth - 1)); - }); - }); - } else if (clone.__isArray(parent)) { - child = []; - } else if (clone.__isRegExp(parent)) { - child = new RegExp(parent.source, __getRegExpFlags(parent)); - if (parent.lastIndex) child.lastIndex = parent.lastIndex; - } else if (clone.__isDate(parent)) { - child = new Date(parent.getTime()); - } else if (useBuffer && Buffer.isBuffer(parent)) { - child = new Buffer(parent.length); - parent.copy(child); - return child; - } else { - if (typeof prototype == 'undefined') { - proto = Object.getPrototypeOf(parent); - child = Object.create(proto); - } - else { - child = Object.create(prototype); - proto = prototype; - } - } - - if (circular) { - var index = allParents.indexOf(parent); - - if (index != -1) { - return allChildren[index]; - } - allParents.push(parent); - allChildren.push(child); - } - - if (parent instanceof nativeMap) { - var keyIterator = parent.keys(); - while(true) { - var next = keyIterator.next(); - if (next.done) { - break; - } - var keyChild = _clone(next.value, depth - 1); - var valueChild = _clone(parent.get(next.value), depth - 1); - child.set(keyChild, valueChild); - } - } - if (parent instanceof nativeSet) { - var iterator = parent.keys(); - while(true) { - var next = iterator.next(); - if (next.done) { - break; - } - var entryChild = _clone(next.value, depth - 1); - child.add(entryChild); - } - } - - for (var i in parent) { - var attrs; - if (proto) { - attrs = Object.getOwnPropertyDescriptor(proto, i); - } - - if (attrs && attrs.set == null) { - continue; - } - child[i] = _clone(parent[i], depth - 1); - } - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(parent); - for (var i = 0; i < symbols.length; i++) { - // Don't need to worry about cloning a symbol because it is a primitive, - // like a number or string. - var symbol = symbols[i]; - child[symbol] = _clone(parent[symbol], depth - 1); - } - } +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - return child; - } +var _parchment = __webpack_require__(0); - return _clone(parent, depth); - } +var _parchment2 = _interopRequireDefault(_parchment); - /** - * Simple flat clone using prototype, accepts only objects, usefull for property - * override on FLAT configuration object (no nested props). - * - * USE WITH CAUTION! This may not behave as you wish if you do not know how this - * works. - */ - clone.clonePrototype = function clonePrototype(parent) { - if (parent === null) - return null; - - var c = function () {}; - c.prototype = parent; - return new c(); - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - // private utility functions +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function __objToStr(o) { - return Object.prototype.toString.call(o); - } - clone.__objToStr = __objToStr; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - function __isDate(o) { - return typeof o === 'object' && __objToStr(o) === '[object Date]'; - } - clone.__isDate = __isDate; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - function __isArray(o) { - return typeof o === 'object' && __objToStr(o) === '[object Array]'; - } - clone.__isArray = __isArray; +var config = { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['serif', 'monospace'] +}; - function __isRegExp(o) { - return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; - } - clone.__isRegExp = __isRegExp; +var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); - function __getRegExpFlags(re) { - var flags = ''; - if (re.global) flags += 'g'; - if (re.ignoreCase) flags += 'i'; - if (re.multiline) flags += 'm'; - return flags; - } - clone.__getRegExpFlags = __getRegExpFlags; +var FontStyleAttributor = function (_Parchment$Attributor) { + _inherits(FontStyleAttributor, _Parchment$Attributor); - return clone; - })(); + function FontStyleAttributor() { + _classCallCheck(this, FontStyleAttributor); - if (typeof module === 'object' && module.exports) { - module.exports = clone; - } + return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); + } + + _createClass(FontStyleAttributor, [{ + key: 'value', + value: function value(node) { + return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); + } + }]); + return FontStyleAttributor; +}(_parchment2.default.Attributor.Style); -/***/ }, +var FontStyle = new FontStyleAttributor('font', 'font-family', config); + +exports.FontStyle = FontStyle; +exports.FontClass = FontClass; + +/***/ }), /* 40 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - var pSlice = Array.prototype.slice; - var objectKeys = __webpack_require__(41); - var isArguments = __webpack_require__(42); - - var deepEqual = module.exports = function (actual, expected, opts) { - if (!opts) opts = {}; - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { - return opts.strict ? actual === expected : actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected, opts); - } - } +"use strict"; - function isUndefinedOrNull(value) { - return value === null || value === undefined; - } - function isBuffer (x) { - if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; - if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { - return false; - } - if (x.length > 0 && typeof x[0] !== 'number') return false; - return true; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SizeStyle = exports.SizeClass = undefined; - function objEquiv(a, b, opts) { - var i, key; - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return deepEqual(a, b, opts); - } - if (isBuffer(a)) { - if (!isBuffer(b)) { - return false; - } - if (a.length !== b.length) return false; - for (i = 0; i < a.length; i++) { - if (a[i] !== b[i]) return false; - } - return true; - } - try { - var ka = objectKeys(a), - kb = objectKeys(b); - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!deepEqual(a[key], b[key], opts)) return false; - } - return typeof a === typeof b; - } +var _parchment = __webpack_require__(0); +var _parchment2 = _interopRequireDefault(_parchment); -/***/ }, +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['small', 'large', 'huge'] +}); +var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['10px', '18px', '32px'] +}); + +exports.SizeClass = SizeClass; +exports.SizeStyle = SizeStyle; + +/***/ }), /* 41 */ -/***/ function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { - exports = module.exports = typeof Object.keys === 'function' - ? Object.keys : shim; +"use strict"; - exports.shim = shim; - function shim (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; - } +module.exports = { + 'align': { + '': __webpack_require__(76), + 'center': __webpack_require__(77), + 'right': __webpack_require__(78), + 'justify': __webpack_require__(79) + }, + 'background': __webpack_require__(80), + 'blockquote': __webpack_require__(81), + 'bold': __webpack_require__(82), + 'clean': __webpack_require__(83), + 'code': __webpack_require__(58), + 'code-block': __webpack_require__(58), + 'color': __webpack_require__(84), + 'direction': { + '': __webpack_require__(85), + 'rtl': __webpack_require__(86) + }, + 'float': { + 'center': __webpack_require__(87), + 'full': __webpack_require__(88), + 'left': __webpack_require__(89), + 'right': __webpack_require__(90) + }, + 'formula': __webpack_require__(91), + 'header': { + '1': __webpack_require__(92), + '2': __webpack_require__(93) + }, + 'italic': __webpack_require__(94), + 'image': __webpack_require__(95), + 'indent': { + '+1': __webpack_require__(96), + '-1': __webpack_require__(97) + }, + 'link': __webpack_require__(98), + 'list': { + 'ordered': __webpack_require__(99), + 'bullet': __webpack_require__(100), + 'check': __webpack_require__(101) + }, + 'script': { + 'sub': __webpack_require__(102), + 'super': __webpack_require__(103) + }, + 'strike': __webpack_require__(104), + 'underline': __webpack_require__(105), + 'video': __webpack_require__(106) +}; -/***/ }, +/***/ }), /* 42 */ -/***/ function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; - var supportsArgumentsClass = (function(){ - return Object.prototype.toString.call(arguments) - })() == '[object Arguments]'; - - exports = module.exports = supportsArgumentsClass ? supported : unsupported; - - exports.supported = supported; - function supported(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; - }; - - exports.unsupported = unsupported; - function unsupported(object){ - return object && - typeof object == 'object' && - typeof object.length == 'number' && - Object.prototype.hasOwnProperty.call(object, 'callee') && - !Object.prototype.propertyIsEnumerable.call(object, 'callee') || - false; - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getLastChangeIndex = exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); -/***/ }, +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var History = function (_Module) { + _inherits(History, _Module); + + function History(quill, options) { + _classCallCheck(this, History); + + var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); + + _this.lastRecorded = 0; + _this.ignoreChange = false; + _this.clear(); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { + if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; + if (!_this.options.userOnly || source === _quill2.default.sources.USER) { + _this.record(delta, oldDelta); + } else { + _this.transform(delta); + } + }); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); + if (/Win/i.test(navigator.platform)) { + _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); + } + return _this; + } + + _createClass(History, [{ + key: 'change', + value: function change(source, dest) { + if (this.stack[source].length === 0) return; + var delta = this.stack[source].pop(); + this.stack[dest].push(delta); + this.lastRecorded = 0; + this.ignoreChange = true; + this.quill.updateContents(delta[source], _quill2.default.sources.USER); + this.ignoreChange = false; + var index = getLastChangeIndex(delta[source]); + this.quill.setSelection(index); + } + }, { + key: 'clear', + value: function clear() { + this.stack = { undo: [], redo: [] }; + } + }, { + key: 'cutoff', + value: function cutoff() { + this.lastRecorded = 0; + } + }, { + key: 'record', + value: function record(changeDelta, oldDelta) { + if (changeDelta.ops.length === 0) return; + this.stack.redo = []; + var undoDelta = this.quill.getContents().diff(oldDelta); + var timestamp = Date.now(); + if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { + var delta = this.stack.undo.pop(); + undoDelta = undoDelta.compose(delta.undo); + changeDelta = delta.redo.compose(changeDelta); + } else { + this.lastRecorded = timestamp; + } + this.stack.undo.push({ + redo: changeDelta, + undo: undoDelta + }); + if (this.stack.undo.length > this.options.maxStack) { + this.stack.undo.shift(); + } + } + }, { + key: 'redo', + value: function redo() { + this.change('redo', 'undo'); + } + }, { + key: 'transform', + value: function transform(delta) { + this.stack.undo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + this.stack.redo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + } + }, { + key: 'undo', + value: function undo() { + this.change('undo', 'redo'); + } + }]); + + return History; +}(_module2.default); + +History.DEFAULTS = { + delay: 1000, + maxStack: 100, + userOnly: false +}; + +function endsWithNewlineChange(delta) { + var lastOp = delta.ops[delta.ops.length - 1]; + if (lastOp == null) return false; + if (lastOp.insert != null) { + return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); + } + if (lastOp.attributes != null) { + return Object.keys(lastOp.attributes).some(function (attr) { + return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; + }); + } + return false; +} + +function getLastChangeIndex(delta) { + var deleteLength = delta.reduce(function (length, op) { + length += op.delete || 0; + return length; + }, 0); + var changeIndex = delta.length() - deleteLength; + if (endsWithNewlineChange(delta)) { + changeIndex -= 1; + } + return changeIndex; +} + +exports.default = History; +exports.getLastChangeIndex = getLastChangeIndex; + +/***/ }), /* 43 */ -/***/ function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BaseTooltip = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - var Module = function Module(quill) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _keyboard = __webpack_require__(23); + +var _keyboard2 = _interopRequireDefault(_keyboard); + +var _theme = __webpack_require__(34); + +var _theme2 = _interopRequireDefault(_theme); + +var _colorPicker = __webpack_require__(59); + +var _colorPicker2 = _interopRequireDefault(_colorPicker); + +var _iconPicker = __webpack_require__(60); + +var _iconPicker2 = _interopRequireDefault(_iconPicker); + +var _picker = __webpack_require__(28); + +var _picker2 = _interopRequireDefault(_picker); + +var _tooltip = __webpack_require__(61); + +var _tooltip2 = _interopRequireDefault(_tooltip); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ALIGNS = [false, 'center', 'right', 'justify']; + +var 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"]; + +var FONTS = [false, 'serif', 'monospace']; + +var HEADERS = ['1', '2', '3', false]; + +var SIZES = ['small', false, 'large', 'huge']; + +var BaseTheme = function (_Theme) { + _inherits(BaseTheme, _Theme); + + function BaseTheme(quill, options) { + _classCallCheck(this, BaseTheme); + + var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options)); + + var listener = function listener(e) { + if (!document.body.contains(quill.root)) { + return document.body.removeEventListener('click', listener); + } + if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) { + _this.tooltip.hide(); + } + if (_this.pickers != null) { + _this.pickers.forEach(function (picker) { + if (!picker.container.contains(e.target)) { + picker.close(); + } + }); + } + }; + quill.emitter.listenDOM('click', document.body, listener); + return _this; + } + + _createClass(BaseTheme, [{ + key: 'addModule', + value: function addModule(name) { + var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name); + if (name === 'toolbar') { + this.extendToolbar(module); + } + return module; + } + }, { + key: 'buildButtons', + value: function buildButtons(buttons, icons) { + buttons.forEach(function (button) { + var className = button.getAttribute('class') || ''; + className.split(/\s+/).forEach(function (name) { + if (!name.startsWith('ql-')) return; + name = name.slice('ql-'.length); + if (icons[name] == null) return; + if (name === 'direction') { + button.innerHTML = icons[name][''] + icons[name]['rtl']; + } else if (typeof icons[name] === 'string') { + button.innerHTML = icons[name]; + } else { + var value = button.value || ''; + if (value != null && icons[name][value]) { + button.innerHTML = icons[name][value]; + } + } + }); + }); + } + }, { + key: 'buildPickers', + value: function buildPickers(selects, icons) { + var _this2 = this; + + this.pickers = selects.map(function (select) { + if (select.classList.contains('ql-align')) { + if (select.querySelector('option') == null) { + fillSelect(select, ALIGNS); + } + return new _iconPicker2.default(select, icons.align); + } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) { + var format = select.classList.contains('ql-background') ? 'background' : 'color'; + if (select.querySelector('option') == null) { + fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000'); + } + return new _colorPicker2.default(select, icons[format]); + } else { + if (select.querySelector('option') == null) { + if (select.classList.contains('ql-font')) { + fillSelect(select, FONTS); + } else if (select.classList.contains('ql-header')) { + fillSelect(select, HEADERS); + } else if (select.classList.contains('ql-size')) { + fillSelect(select, SIZES); + } + } + return new _picker2.default(select); + } + }); + var update = function update() { + _this2.pickers.forEach(function (picker) { + picker.update(); + }); + }; + this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update); + } + }]); + + return BaseTheme; +}(_theme2.default); + +BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + formula: function formula() { + this.quill.theme.tooltip.edit('formula'); + }, + image: function image() { + var _this3 = this; + + var fileInput = this.container.querySelector('input.ql-image[type=file]'); + if (fileInput == null) { + fileInput = document.createElement('input'); + fileInput.setAttribute('type', 'file'); + fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'); + fileInput.classList.add('ql-image'); + fileInput.addEventListener('change', function () { + if (fileInput.files != null && fileInput.files[0] != null) { + var reader = new FileReader(); + reader.onload = function (e) { + var range = _this3.quill.getSelection(true); + _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER); + _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT); + fileInput.value = ""; + }; + reader.readAsDataURL(fileInput.files[0]); + } + }); + this.container.appendChild(fileInput); + } + fileInput.click(); + }, + video: function video() { + this.quill.theme.tooltip.edit('video'); + } + } + } + } +}); - _classCallCheck(this, Module); +var BaseTooltip = function (_Tooltip) { + _inherits(BaseTooltip, _Tooltip); - this.quill = quill; - this.options = options; - }; + function BaseTooltip(quill, boundsContainer) { + _classCallCheck(this, BaseTooltip); - Module.DEFAULTS = {}; + var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer)); - exports.default = Module; + _this4.textbox = _this4.root.querySelector('input[type="text"]'); + _this4.listen(); + return _this4; + } + + _createClass(BaseTooltip, [{ + key: 'listen', + value: function listen() { + var _this5 = this; + + this.textbox.addEventListener('keydown', function (event) { + if (_keyboard2.default.match(event, 'enter')) { + _this5.save(); + event.preventDefault(); + } else if (_keyboard2.default.match(event, 'escape')) { + _this5.cancel(); + event.preventDefault(); + } + }); + } + }, { + key: 'cancel', + value: function cancel() { + this.hide(); + } + }, { + key: 'edit', + value: function edit() { + var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link'; + var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + this.root.classList.remove('ql-hidden'); + this.root.classList.add('ql-editing'); + if (preview != null) { + this.textbox.value = preview; + } else if (mode !== this.root.getAttribute('data-mode')) { + this.textbox.value = ''; + } + this.position(this.quill.getBounds(this.quill.selection.savedRange)); + this.textbox.select(); + this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || ''); + this.root.setAttribute('data-mode', mode); + } + }, { + key: 'restoreFocus', + value: function restoreFocus() { + var scrollTop = this.quill.scrollingContainer.scrollTop; + this.quill.focus(); + this.quill.scrollingContainer.scrollTop = scrollTop; + } + }, { + key: 'save', + value: function save() { + var value = this.textbox.value; + switch (this.root.getAttribute('data-mode')) { + case 'link': + { + var scrollTop = this.quill.root.scrollTop; + if (this.linkRange) { + this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER); + delete this.linkRange; + } else { + this.restoreFocus(); + this.quill.format('link', value, _emitter2.default.sources.USER); + } + this.quill.root.scrollTop = scrollTop; + break; + } + case 'video': + { + value = extractVideoUrl(value); + } // eslint-disable-next-line no-fallthrough + case 'formula': + { + if (!value) break; + var range = this.quill.getSelection(true); + if (range != null) { + var index = range.index + range.length; + this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER); + if (this.root.getAttribute('data-mode') === 'formula') { + this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER); + } + this.quill.setSelection(index + 2, _emitter2.default.sources.USER); + } + break; + } + default: + } + this.textbox.value = ''; + this.hide(); + } + }]); + + return BaseTooltip; +}(_tooltip2.default); + +function extractVideoUrl(url) { + var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/); + if (match) { + return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0'; + } + if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) { + // eslint-disable-line no-cond-assign + return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/'; + } + return url; +} + +function fillSelect(select, values) { + var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + values.forEach(function (value) { + var option = document.createElement('option'); + if (value === defaultValue) { + option.setAttribute('selected', 'selected'); + } else { + option.setAttribute('value', value); + } + select.appendChild(option); + }); +} -/***/ }, +exports.BaseTooltip = BaseTooltip; +exports.default = BaseTheme; + +/***/ }), /* 44 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.Range = undefined; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _clone = __webpack_require__(39); - - var _clone2 = _interopRequireDefault(_clone); - - var _deepEqual = __webpack_require__(40); - - var _deepEqual2 = _interopRequireDefault(_deepEqual); - - var _emitter3 = __webpack_require__(36); - - var _emitter4 = _interopRequireDefault(_emitter3); - - var _logger = __webpack_require__(38); - - var _logger2 = _interopRequireDefault(_logger); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var debug = (0, _logger2.default)('quill:selection'); - - var Range = function Range(index) { - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - _classCallCheck(this, Range); - - this.index = index; - this.length = length; - }; - - var Selection = function () { - function Selection(scroll, emitter) { - var _this = this; - - _classCallCheck(this, Selection); - - this.emitter = emitter; - this.scroll = scroll; - this.composing = false; - this.root = this.scroll.domNode; - this.root.addEventListener('compositionstart', function () { - _this.composing = true; - }); - this.root.addEventListener('compositionend', function () { - _this.composing = false; - }); - this.cursor = _parchment2.default.create('cursor', this); - // savedRange is last non-null range - this.lastRange = this.savedRange = new Range(0, 0); - ['keyup', 'mouseup', 'mouseleave', 'touchend', 'touchleave', 'focus', 'blur'].forEach(function (eventName) { - _this.root.addEventListener(eventName, function () { - // When range used to be a selection and user click within the selection, - // the range now being a cursor has not updated yet without setTimeout - setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 100); - }); - }); - this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { - if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { - _this.update(_emitter4.default.sources.SILENT); - } - }); - this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { - var native = _this.getNativeRange(); - if (native == null) return; - if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle - // TODO unclear if this has negative side effects - _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { - try { - _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); - } catch (ignored) {} - }); - }); - this.update(_emitter4.default.sources.SILENT); - } - - _createClass(Selection, [{ - key: 'focus', - value: function focus() { - if (this.hasFocus()) return; - var bodyTop = document.body.scrollTop; - this.root.focus(); - document.body.scrollTop = bodyTop; - this.setRange(this.savedRange); - } - }, { - key: 'format', - value: function format(_format, value) { - this.scroll.update(); - var nativeRange = this.getNativeRange(); - if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; - if (nativeRange.start.node !== this.cursor.textNode) { - var blot = _parchment2.default.find(nativeRange.start.node, false); - if (blot == null) return; - // TODO Give blot ability to not split - if (blot instanceof _parchment2.default.Leaf) { - var after = blot.split(nativeRange.start.offset); - blot.parent.insertBefore(this.cursor, after); - } else { - blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen - } - this.cursor.attach(); - } - this.cursor.format(_format, value); - this.scroll.optimize(); - this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); - this.update(); - } - }, { - key: 'getBounds', - value: function getBounds(index) { - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var scrollLength = this.scroll.length(); - index = Math.min(index, scrollLength - 1); - length = Math.min(index + length, scrollLength - 1) - index; - var bounds = void 0, - node = void 0, - _scroll$leaf = this.scroll.leaf(index), - _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), - leaf = _scroll$leaf2[0], - offset = _scroll$leaf2[1]; - if (leaf == null) return null; - - var _leaf$position = leaf.position(offset, true); - - var _leaf$position2 = _slicedToArray(_leaf$position, 2); - - node = _leaf$position2[0]; - offset = _leaf$position2[1]; - - var range = document.createRange(); - if (length > 0) { - range.setStart(node, offset); - - var _scroll$leaf3 = this.scroll.leaf(index + length); - - var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); - - leaf = _scroll$leaf4[0]; - offset = _scroll$leaf4[1]; - - if (leaf == null) return null; - - var _leaf$position3 = leaf.position(offset, true); - - var _leaf$position4 = _slicedToArray(_leaf$position3, 2); - - node = _leaf$position4[0]; - offset = _leaf$position4[1]; - - range.setEnd(node, offset); - bounds = range.getBoundingClientRect(); - } else { - var side = 'left'; - var rect = void 0; - if (node instanceof Text) { - if (offset < node.data.length) { - range.setStart(node, offset); - range.setEnd(node, offset + 1); - } else { - range.setStart(node, offset - 1); - range.setEnd(node, offset); - side = 'right'; - } - rect = range.getBoundingClientRect(); - } else { - rect = leaf.domNode.getBoundingClientRect(); - if (offset > 0) side = 'right'; - } - bounds = { - height: rect.height, - left: rect[side], - width: 0, - top: rect.top - }; - } - var containerBounds = this.root.parentNode.getBoundingClientRect(); - return { - left: bounds.left - containerBounds.left, - right: bounds.left + bounds.width - containerBounds.left, - top: bounds.top - containerBounds.top, - bottom: bounds.top + bounds.height - containerBounds.top, - height: bounds.height, - width: bounds.width - }; - } - }, { - key: 'getNativeRange', - value: function getNativeRange() { - var selection = document.getSelection(); - if (selection == null || selection.rangeCount <= 0) return null; - var nativeRange = selection.getRangeAt(0); - if (nativeRange == null) return null; - if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { - return null; - } - var range = { - start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, - end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, - native: nativeRange - }; - [range.start, range.end].forEach(function (position) { - var node = position.node, - offset = position.offset; - while (!(node instanceof Text) && node.childNodes.length > 0) { - if (node.childNodes.length > offset) { - node = node.childNodes[offset]; - offset = 0; - } else if (node.childNodes.length === offset) { - node = node.lastChild; - offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; - } else { - break; - } - } - position.node = node, position.offset = offset; - }); - debug.info('getNativeRange', range); - return range; - } - }, { - key: 'getRange', - value: function getRange() { - var _this2 = this; - - var range = this.getNativeRange(); - if (range == null) return [null, null]; - var positions = [[range.start.node, range.start.offset]]; - if (!range.native.collapsed) { - positions.push([range.end.node, range.end.offset]); - } - var indexes = positions.map(function (position) { - var _position = _slicedToArray(position, 2), - node = _position[0], - offset = _position[1]; - - var blot = _parchment2.default.find(node, true); - var index = blot.offset(_this2.scroll); - if (offset === 0) { - return index; - } else if (blot instanceof _parchment2.default.Container) { - return index + blot.length(); - } else { - return index + blot.index(node, offset); - } - }); - var start = Math.min.apply(Math, _toConsumableArray(indexes)), - end = Math.max.apply(Math, _toConsumableArray(indexes)); - return [new Range(start, end - start), range]; - } - }, { - key: 'hasFocus', - value: function hasFocus() { - return document.activeElement === this.root; - } - }, { - key: 'scrollIntoView', - value: function scrollIntoView() { - var range = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.lastRange; - - if (range == null) return; - var bounds = this.getBounds(range.index, range.length); - if (bounds == null) return; - if (this.root.offsetHeight < bounds.bottom) { - var _scroll$line = this.scroll.line(Math.min(range.index + range.length, this.scroll.length() - 1)), - _scroll$line2 = _slicedToArray(_scroll$line, 1), - line = _scroll$line2[0]; - - this.root.scrollTop = line.domNode.offsetTop + line.domNode.offsetHeight - this.root.offsetHeight; - } else if (bounds.top < 0) { - var _scroll$line3 = this.scroll.line(Math.min(range.index, this.scroll.length() - 1)), - _scroll$line4 = _slicedToArray(_scroll$line3, 1), - _line = _scroll$line4[0]; - - this.root.scrollTop = _line.domNode.offsetTop; - } - } - }, { - key: 'setNativeRange', - value: function setNativeRange(startNode, startOffset) { - var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; - var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; - var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; - - debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); - if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { - return; - } - var selection = document.getSelection(); - if (selection == null) return; - if (startNode != null) { - if (!this.hasFocus()) this.root.focus(); - var nativeRange = this.getNativeRange(); - if (nativeRange == null || force || startNode !== nativeRange.start.node || startOffset !== nativeRange.start.offset || endNode !== nativeRange.end.node || endOffset !== nativeRange.end.offset) { - var range = document.createRange(); - range.setStart(startNode, startOffset); - range.setEnd(endNode, endOffset); - selection.removeAllRanges(); - selection.addRange(range); - } - } else { - selection.removeAllRanges(); - this.root.blur(); - document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) - } - } - }, { - key: 'setRange', - value: function setRange(range) { - var _this3 = this; - - var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; - - if (typeof force === 'string') { - source = force; - force = false; - } - debug.info('setRange', range); - if (range != null) { - (function () { - var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; - var args = []; - var scrollLength = _this3.scroll.length(); - indexes.forEach(function (index, i) { - index = Math.min(scrollLength - 1, index); - var node = void 0, - _scroll$leaf5 = _this3.scroll.leaf(index), - _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), - leaf = _scroll$leaf6[0], - offset = _scroll$leaf6[1]; - var _leaf$position5 = leaf.position(offset, i !== 0); - - var _leaf$position6 = _slicedToArray(_leaf$position5, 2); - - node = _leaf$position6[0]; - offset = _leaf$position6[1]; - - args.push(node, offset); - }); - if (args.length < 2) { - args = args.concat(args); - } - _this3.setNativeRange.apply(_this3, _toConsumableArray(args).concat([force])); - })(); - } else { - this.setNativeRange(null); - } - this.update(source); - } - }, { - key: 'update', - value: function update() { - var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; - - var nativeRange = void 0, - oldRange = this.lastRange; - - var _getRange = this.getRange(); - - var _getRange2 = _slicedToArray(_getRange, 2); - - this.lastRange = _getRange2[0]; - nativeRange = _getRange2[1]; - - if (this.lastRange != null) { - this.savedRange = this.lastRange; - } - if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { - var _emitter; - - if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { - this.cursor.restore(); - } - var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; - (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); - if (source !== _emitter4.default.sources.SILENT) { - var _emitter2; - - (_emitter2 = this.emitter).emit.apply(_emitter2, args); - } - } - } - }]); - - return Selection; - }(); - - function contains(parent, descendant) { - try { - // Firefox inserts inaccessible nodes around video elements - descendant.parentNode; - } catch (e) { - return false; - } - // IE11 has bug with Text nodes - // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect - if (descendant instanceof Text) { - descendant = descendant.parentNode; - } - return parent.contains(descendant); - } +Object.defineProperty(exports, "__esModule", { value: true }); +var LinkedList = /** @class */ (function () { + function LinkedList() { + this.head = this.tail = null; + this.length = 0; + } + LinkedList.prototype.append = function () { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i] = arguments[_i]; + } + this.insertBefore(nodes[0], null); + if (nodes.length > 1) { + this.append.apply(this, nodes.slice(1)); + } + }; + LinkedList.prototype.contains = function (node) { + var cur, next = this.iterator(); + while ((cur = next())) { + if (cur === node) + return true; + } + return false; + }; + LinkedList.prototype.insertBefore = function (node, refNode) { + if (!node) + return; + node.next = refNode; + if (refNode != null) { + node.prev = refNode.prev; + if (refNode.prev != null) { + refNode.prev.next = node; + } + refNode.prev = node; + if (refNode === this.head) { + this.head = node; + } + } + else if (this.tail != null) { + this.tail.next = node; + node.prev = this.tail; + this.tail = node; + } + else { + node.prev = null; + this.head = this.tail = node; + } + this.length += 1; + }; + LinkedList.prototype.offset = function (target) { + var index = 0, cur = this.head; + while (cur != null) { + if (cur === target) + return index; + index += cur.length(); + cur = cur.next; + } + return -1; + }; + LinkedList.prototype.remove = function (node) { + if (!this.contains(node)) + return; + if (node.prev != null) + node.prev.next = node.next; + if (node.next != null) + node.next.prev = node.prev; + if (node === this.head) + this.head = node.next; + if (node === this.tail) + this.tail = node.prev; + this.length -= 1; + }; + LinkedList.prototype.iterator = function (curNode) { + if (curNode === void 0) { curNode = this.head; } + // TODO use yield when we can + return function () { + var ret = curNode; + if (curNode != null) + curNode = curNode.next; + return ret; + }; + }; + LinkedList.prototype.find = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var cur, next = this.iterator(); + while ((cur = next())) { + var length = cur.length(); + if (index < length || + (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) { + return [cur, index]; + } + index -= length; + } + return [null, 0]; + }; + LinkedList.prototype.forEach = function (callback) { + var cur, next = this.iterator(); + while ((cur = next())) { + callback(cur); + } + }; + LinkedList.prototype.forEachAt = function (index, length, callback) { + if (length <= 0) + return; + var _a = this.find(index), startNode = _a[0], offset = _a[1]; + var cur, curIndex = index - offset, next = this.iterator(startNode); + while ((cur = next()) && curIndex < index + length) { + var curLength = cur.length(); + if (index > curIndex) { + callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); + } + else { + callback(cur, 0, Math.min(curLength, index + length - curIndex)); + } + curIndex += curLength; + } + }; + LinkedList.prototype.map = function (callback) { + return this.reduce(function (memo, cur) { + memo.push(callback(cur)); + return memo; + }, []); + }; + LinkedList.prototype.reduce = function (callback, memo) { + var cur, next = this.iterator(); + while ((cur = next())) { + memo = callback(memo, cur); + } + return memo; + }; + return LinkedList; +}()); +exports.default = LinkedList; - exports.Range = Range; - exports.default = Selection; -/***/ }, +/***/ }), /* 45 */ -/***/ function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var Theme = function () { - function Theme(quill, options) { - _classCallCheck(this, Theme); - - this.quill = quill; - this.options = options; - this.modules = {}; - } - - _createClass(Theme, [{ - key: 'init', - value: function init() { - var _this = this; - - Object.keys(this.options.modules).forEach(function (name) { - if (_this.modules[name] == null) { - _this.addModule(name); - } - }); - } - }, { - key: 'addModule', - value: function addModule(name) { - var moduleClass = this.quill.constructor.import('modules/' + name); - this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); - return this.modules[name]; - } - }]); - - return Theme; - }(); - - Theme.DEFAULTS = { - modules: {} - }; - Theme.themes = { - 'default': Theme - }; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var OBSERVER_CONFIG = { + attributes: true, + characterData: true, + characterDataOldValue: true, + childList: true, + subtree: true, +}; +var MAX_OPTIMIZE_ITERATIONS = 100; +var ScrollBlot = /** @class */ (function (_super) { + __extends(ScrollBlot, _super); + function ScrollBlot(node) { + var _this = _super.call(this, node) || this; + _this.scroll = _this; + _this.observer = new MutationObserver(function (mutations) { + _this.update(mutations); + }); + _this.observer.observe(_this.domNode, OBSERVER_CONFIG); + _this.attach(); + return _this; + } + ScrollBlot.prototype.detach = function () { + _super.prototype.detach.call(this); + this.observer.disconnect(); + }; + ScrollBlot.prototype.deleteAt = function (index, length) { + this.update(); + if (index === 0 && length === this.length()) { + this.children.forEach(function (child) { + child.remove(); + }); + } + else { + _super.prototype.deleteAt.call(this, index, length); + } + }; + ScrollBlot.prototype.formatAt = function (index, length, name, value) { + this.update(); + _super.prototype.formatAt.call(this, index, length, name, value); + }; + ScrollBlot.prototype.insertAt = function (index, value, def) { + this.update(); + _super.prototype.insertAt.call(this, index, value, def); + }; + ScrollBlot.prototype.optimize = function (mutations, context) { + var _this = this; + if (mutations === void 0) { mutations = []; } + if (context === void 0) { context = {}; } + _super.prototype.optimize.call(this, context); + // We must modify mutations directly, cannot make copy and then modify + var records = [].slice.call(this.observer.takeRecords()); + // Array.push currently seems to be implemented by a non-tail recursive function + // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords()); + while (records.length > 0) + mutations.push(records.pop()); + // TODO use WeakMap + var mark = function (blot, markParent) { + if (markParent === void 0) { markParent = true; } + if (blot == null || blot === _this) + return; + if (blot.domNode.parentNode == null) + return; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = []; + } + if (markParent) + mark(blot.parent); + }; + var optimize = function (blot) { + // Post-order traversal + if ( + // @ts-ignore + blot.domNode[Registry.DATA_KEY] == null || + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations == null) { + return; + } + if (blot instanceof container_1.default) { + blot.children.forEach(optimize); + } + blot.optimize(context); + }; + var remaining = mutations; + for (var i = 0; remaining.length > 0; i += 1) { + if (i >= MAX_OPTIMIZE_ITERATIONS) { + throw new Error('[Parchment] Maximum optimize iterations reached'); + } + remaining.forEach(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return; + if (blot.domNode === mutation.target) { + if (mutation.type === 'childList') { + mark(Registry.find(mutation.previousSibling, false)); + [].forEach.call(mutation.addedNodes, function (node) { + var child = Registry.find(node, false); + mark(child, false); + if (child instanceof container_1.default) { + child.children.forEach(function (grandChild) { + mark(grandChild, false); + }); + } + }); + } + else if (mutation.type === 'attributes') { + mark(blot.prev); + } + } + mark(blot); + }); + this.children.forEach(optimize); + remaining = [].slice.call(this.observer.takeRecords()); + records = remaining.slice(); + while (records.length > 0) + mutations.push(records.pop()); + } + }; + ScrollBlot.prototype.update = function (mutations, context) { + var _this = this; + if (context === void 0) { context = {}; } + mutations = mutations || this.observer.takeRecords(); + // TODO use WeakMap + mutations + .map(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return null; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = [mutation]; + return blot; + } + else { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations.push(mutation); + return null; + } + }) + .forEach(function (blot) { + if (blot == null || + blot === _this || + //@ts-ignore + blot.domNode[Registry.DATA_KEY] == null) + return; + // @ts-ignore + blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context); + }); + // @ts-ignore + if (this.domNode[Registry.DATA_KEY].mutations != null) { + // @ts-ignore + _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context); + } + this.optimize(mutations, context); + }; + ScrollBlot.blotName = 'scroll'; + ScrollBlot.defaultChild = 'block'; + ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; + ScrollBlot.tagName = 'DIV'; + return ScrollBlot; +}(container_1.default)); +exports.default = ScrollBlot; - exports.default = Theme; -/***/ }, +/***/ }), /* 46 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +// Shallow object comparison +function isEqual(obj1, obj2) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) + return false; + // @ts-ignore + for (var prop in obj1) { + // @ts-ignore + if (obj1[prop] !== obj2[prop]) + return false; + } + return true; +} +var InlineBlot = /** @class */ (function (_super) { + __extends(InlineBlot, _super); + function InlineBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + InlineBlot.formats = function (domNode) { + if (domNode.tagName === InlineBlot.tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + InlineBlot.prototype.format = function (name, value) { + var _this = this; + if (name === this.statics.blotName && !value) { + this.children.forEach(function (child) { + if (!(child instanceof format_1.default)) { + child = child.wrap(InlineBlot.blotName, true); + } + _this.attributes.copy(child); + }); + this.unwrap(); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + InlineBlot.prototype.formatAt = function (index, length, name, value) { + if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { + var blot = this.isolate(index, length); + blot.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + InlineBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + var formats = this.formats(); + if (Object.keys(formats).length === 0) { + return this.unwrap(); // unformatted span + } + var next = this.next; + if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { + next.moveChildren(this); + next.remove(); + } + }; + InlineBlot.blotName = 'inline'; + InlineBlot.scope = Registry.Scope.INLINE_BLOT; + InlineBlot.tagName = 'SPAN'; + return InlineBlot; +}(format_1.default)); +exports.default = InlineBlot; - var _parchment = __webpack_require__(2); - var _parchment2 = _interopRequireDefault(_parchment); +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { - var _block = __webpack_require__(29); +"use strict"; - var _block2 = _interopRequireDefault(_block); +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +var BlockBlot = /** @class */ (function (_super) { + __extends(BlockBlot, _super); + function BlockBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlockBlot.formats = function (domNode) { + var tagName = Registry.query(BlockBlot.blotName).tagName; + if (domNode.tagName === tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + BlockBlot.prototype.format = function (name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) == null) { + return; + } + else if (name === this.statics.blotName && !value) { + this.replaceWith(BlockBlot.blotName); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + BlockBlot.prototype.formatAt = function (index, length, name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) != null) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + BlockBlot.prototype.insertAt = function (index, value, def) { + if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { + // Insert text or inline + _super.prototype.insertAt.call(this, index, value, def); + } + else { + var after = this.split(index); + var blot = Registry.create(value, def); + after.parent.insertBefore(blot, after); + } + }; + BlockBlot.prototype.update = function (mutations, context) { + if (navigator.userAgent.match(/Trident/)) { + this.build(); + } + else { + _super.prototype.update.call(this, mutations, context); + } + }; + BlockBlot.blotName = 'block'; + BlockBlot.scope = Registry.Scope.BLOCK_BLOT; + BlockBlot.tagName = 'P'; + return BlockBlot; +}(format_1.default)); +exports.default = BlockBlot; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +"use strict"; - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var EmbedBlot = /** @class */ (function (_super) { + __extends(EmbedBlot, _super); + function EmbedBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + EmbedBlot.formats = function (domNode) { + return undefined; + }; + EmbedBlot.prototype.format = function (name, value) { + // super.formatAt wraps, which is what we want in general, + // but this allows subclasses to overwrite for formats + // that just apply to particular embeds + _super.prototype.formatAt.call(this, 0, this.length(), name, value); + }; + EmbedBlot.prototype.formatAt = function (index, length, name, value) { + if (index === 0 && length === this.length()) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + EmbedBlot.prototype.formats = function () { + return this.statics.formats(this.domNode); + }; + return EmbedBlot; +}(leaf_1.default)); +exports.default = EmbedBlot; - var Container = function (_Parchment$Container) { - _inherits(Container, _Parchment$Container); - function Container() { - _classCallCheck(this, Container); +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { - return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); - } +"use strict"; - return Container; - }(_parchment2.default.Container); +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var Registry = __webpack_require__(1); +var TextBlot = /** @class */ (function (_super) { + __extends(TextBlot, _super); + function TextBlot(node) { + var _this = _super.call(this, node) || this; + _this.text = _this.statics.value(_this.domNode); + return _this; + } + TextBlot.create = function (value) { + return document.createTextNode(value); + }; + TextBlot.value = function (domNode) { + var text = domNode.data; + // @ts-ignore + if (text['normalize']) + text = text['normalize'](); + return text; + }; + TextBlot.prototype.deleteAt = function (index, length) { + this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); + }; + TextBlot.prototype.index = function (node, offset) { + if (this.domNode === node) { + return offset; + } + return -1; + }; + TextBlot.prototype.insertAt = function (index, value, def) { + if (def == null) { + this.text = this.text.slice(0, index) + value + this.text.slice(index); + this.domNode.data = this.text; + } + else { + _super.prototype.insertAt.call(this, index, value, def); + } + }; + TextBlot.prototype.length = function () { + return this.text.length; + }; + TextBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + this.text = this.statics.value(this.domNode); + if (this.text.length === 0) { + this.remove(); + } + else if (this.next instanceof TextBlot && this.next.prev === this) { + this.insertAt(this.length(), this.next.value()); + this.next.remove(); + } + }; + TextBlot.prototype.position = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + return [this.domNode, index]; + }; + TextBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = Registry.create(this.domNode.splitText(index)); + this.parent.insertBefore(after, this.next); + this.text = this.statics.value(this.domNode); + return after; + }; + TextBlot.prototype.update = function (mutations, context) { + var _this = this; + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this.domNode; + })) { + this.text = this.statics.value(this.domNode); + } + }; + TextBlot.prototype.value = function () { + return this.text; + }; + TextBlot.blotName = 'text'; + TextBlot.scope = Registry.Scope.INLINE_BLOT; + return TextBlot; +}(leaf_1.default)); +exports.default = TextBlot; - Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; - exports.default = Container; +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 47 */ -/***/ function(module, exports, __webpack_require__) { +"use strict"; - 'use strict'; - Object.defineProperty(exports, "__esModule", { - value: true - }); +var elem = document.createElement('div'); +elem.classList.toggle('test-class', false); +if (elem.classList.contains('test-class')) { + var _toggle = DOMTokenList.prototype.toggle; + DOMTokenList.prototype.toggle = function (token, force) { + if (arguments.length > 1 && !this.contains(token) === !force) { + return force; + } else { + return _toggle.call(this, token); + } + }; +} + +if (!String.prototype.startsWith) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; +} + +if (!String.prototype.endsWith) { + String.prototype.endsWith = function (searchString, position) { + var subjectString = this.toString(); + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length; + } + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; +} + +if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, "find", { + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } + } + return undefined; + } + }); +} + +document.addEventListener("DOMContentLoaded", function () { + // Disable resizing in Firefox + document.execCommand("enableObjectResizing", false, false); + // Disable automatic linkifying in IE11 + document.execCommand("autoUrlDetect", false, false); +}); - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); +/***/ }), +/* 51 */ +/***/ (function(module, exports) { - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +/** + * This library modifies the diff-patch-match library by Neil Fraser + * by removing the patch and match functionality and certain advanced + * options in the diff function. The original license is as follows: + * + * === + * + * Diff Match and Patch + * + * Copyright 2006 Google Inc. + * http://code.google.com/p/google-diff-match-patch/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - var _parchment = __webpack_require__(2); +/** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ +var DIFF_DELETE = -1; +var DIFF_INSERT = 1; +var DIFF_EQUAL = 0; - var _parchment2 = _interopRequireDefault(_parchment); - var _emitter = __webpack_require__(36); +/** + * Find the differences between two texts. Simplifies the problem by stripping + * any common prefix or suffix off the texts before diffing. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {Int} cursor_pos Expected edit position in text1 (optional) + * @return {Array} Array of diff tuples. + */ +function diff_main(text1, text2, cursor_pos) { + // Check for equality (speedup). + if (text1 == text2) { + if (text1) { + return [[DIFF_EQUAL, text1]]; + } + return []; + } + + // Check cursor_pos within bounds + if (cursor_pos < 0 || text1.length < cursor_pos) { + cursor_pos = null; + } + + // Trim off common prefix (speedup). + var commonlength = diff_commonPrefix(text1, text2); + var commonprefix = text1.substring(0, commonlength); + text1 = text1.substring(commonlength); + text2 = text2.substring(commonlength); + + // Trim off common suffix (speedup). + 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); + + // Compute the diff on the middle block. + var diffs = diff_compute_(text1, text2); + + // Restore the prefix and suffix. + if (commonprefix) { + diffs.unshift([DIFF_EQUAL, commonprefix]); + } + if (commonsuffix) { + diffs.push([DIFF_EQUAL, commonsuffix]); + } + diff_cleanupMerge(diffs); + if (cursor_pos != null) { + diffs = fix_cursor(diffs, cursor_pos); + } + diffs = fix_emoji(diffs); + return diffs; +}; + + +/** + * Find the differences between two texts. Assumes that the texts do not + * have any common prefix or suffix. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + */ +function diff_compute_(text1, text2) { + var diffs; - var _emitter2 = _interopRequireDefault(_emitter); + if (!text1) { + // Just add some text (speedup). + return [[DIFF_INSERT, text2]]; + } + + if (!text2) { + // Just delete some text (speedup). + return [[DIFF_DELETE, text1]]; + } + + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + var i = longtext.indexOf(shorttext); + if (i != -1) { + // Shorter text is inside the longer text (speedup). + diffs = [[DIFF_INSERT, longtext.substring(0, i)], + [DIFF_EQUAL, shorttext], + [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; + // Swap insertions for deletions if diff is reversed. + if (text1.length > text2.length) { + diffs[0][0] = diffs[2][0] = DIFF_DELETE; + } + return diffs; + } + + if (shorttext.length == 1) { + // Single character string. + // After the previous speedup, the character can't be an equality. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + } + + // Check to see if the problem can be split in two. + var hm = diff_halfMatch_(text1, text2); + if (hm) { + // A half-match was found, sort out the return data. + var text1_a = hm[0]; + var text1_b = hm[1]; + var text2_a = hm[2]; + var text2_b = hm[3]; + var mid_common = hm[4]; + // Send both pairs off for separate processing. + var diffs_a = diff_main(text1_a, text2_a); + var diffs_b = diff_main(text1_b, text2_b); + // Merge the results. + return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); + } + + return diff_bisect_(text1, text2); +}; + + +/** + * Find the 'middle snake' of a diff, split the problem in two + * and return the recursively constructed diff. + * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + * @private + */ +function diff_bisect_(text1, text2) { + // Cache the text lengths to prevent multiple calls. + var text1_length = text1.length; + var text2_length = text2.length; + var max_d = Math.ceil((text1_length + text2_length) / 2); + var v_offset = max_d; + var v_length = 2 * max_d; + var v1 = new Array(v_length); + var v2 = new Array(v_length); + // Setting all elements to -1 is faster in Chrome & Firefox than mixing + // integers and undefined. + for (var x = 0; x < v_length; x++) { + v1[x] = -1; + v2[x] = -1; + } + v1[v_offset + 1] = 0; + v2[v_offset + 1] = 0; + var delta = text1_length - text2_length; + // If the total number of characters is odd, then the front path will collide + // with the reverse path. + var front = (delta % 2 != 0); + // Offsets for start and end of k loop. + // Prevents mapping of space beyond the grid. + var k1start = 0; + var k1end = 0; + var k2start = 0; + var k2end = 0; + for (var d = 0; d < max_d; d++) { + // Walk the front path one step. + for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { + var k1_offset = v_offset + k1; + var x1; + if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { + x1 = v1[k1_offset + 1]; + } else { + x1 = v1[k1_offset - 1] + 1; + } + var y1 = x1 - k1; + while (x1 < text1_length && y1 < text2_length && + text1.charAt(x1) == text2.charAt(y1)) { + x1++; + y1++; + } + v1[k1_offset] = x1; + if (x1 > text1_length) { + // Ran off the right of the graph. + k1end += 2; + } else if (y1 > text2_length) { + // Ran off the bottom of the graph. + k1start += 2; + } else if (front) { + var k2_offset = v_offset + delta - k1; + if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { + // Mirror x2 onto top-left coordinate system. + var x2 = text1_length - v2[k2_offset]; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + + // Walk the reverse path one step. + for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { + var k2_offset = v_offset + k2; + var x2; + if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { + x2 = v2[k2_offset + 1]; + } else { + x2 = v2[k2_offset - 1] + 1; + } + var y2 = x2 - k2; + while (x2 < text1_length && y2 < text2_length && + text1.charAt(text1_length - x2 - 1) == + text2.charAt(text2_length - y2 - 1)) { + x2++; + y2++; + } + v2[k2_offset] = x2; + if (x2 > text1_length) { + // Ran off the left of the graph. + k2end += 2; + } else if (y2 > text2_length) { + // Ran off the top of the graph. + 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]; + var y1 = v_offset + x1 - k1_offset; + // Mirror x2 onto top-left coordinate system. + x2 = text1_length - x2; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + } + // Diff took too long and hit the deadline or + // number of diffs equals number of characters, no commonality at all. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; +}; + + +/** + * Given the location of the 'middle snake', split the diff in two parts + * and recurse. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} x Index of split point in text1. + * @param {number} y Index of split point in text2. + * @return {Array} Array of diff tuples. + */ +function diff_bisectSplit_(text1, text2, x, y) { + var text1a = text1.substring(0, x); + var text2a = text2.substring(0, y); + var text1b = text1.substring(x); + var text2b = text2.substring(y); + + // Compute both diffs serially. + var diffs = diff_main(text1a, text2a); + var diffsb = diff_main(text1b, text2b); + + return diffs.concat(diffsb); +}; + + +/** + * Determine the common prefix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the start of each + * string. + */ +function diff_commonPrefix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerstart = 0; + while (pointermin < pointermid) { + if (text1.substring(pointerstart, pointermid) == + text2.substring(pointerstart, pointermid)) { + pointermin = pointermid; + pointerstart = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Determine the common suffix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of each string. + */ +function diff_commonSuffix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || + text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerend = 0; + while (pointermin < pointermid) { + if (text1.substring(text1.length - pointermid, text1.length - pointerend) == + text2.substring(text2.length - pointermid, text2.length - pointerend)) { + pointermin = pointermid; + pointerend = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Do the two texts share a substring which is at least half the length of the + * longer text? + * This speedup can produce non-minimal diffs. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {Array.} Five element Array, containing the prefix of + * text1, the suffix of text1, the prefix of text2, the suffix of + * text2 and the common middle. Or null if there was no match. + */ +function diff_halfMatch_(text1, text2) { + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { + return null; // Pointless. + } + + /** + * Does a substring of shorttext exist within longtext such that the substring + * is at least half the length of longtext? + * Closure, but does not reference any external variables. + * @param {string} longtext Longer string. + * @param {string} shorttext Shorter string. + * @param {number} i Start index of quarter length substring within longtext. + * @return {Array.} Five element Array, containing the prefix of + * longtext, the suffix of longtext, the prefix of shorttext, the suffix + * of shorttext and the common middle. Or null if there was no match. + * @private + */ + function diff_halfMatchI_(longtext, shorttext, i) { + // Start with a 1/4 length substring at position i as a seed. + var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); + var j = -1; + var best_common = ''; + var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; + while ((j = shorttext.indexOf(seed, j + 1)) != -1) { + var prefixLength = diff_commonPrefix(longtext.substring(i), + shorttext.substring(j)); + var suffixLength = diff_commonSuffix(longtext.substring(0, i), + shorttext.substring(0, j)); + if (best_common.length < suffixLength + prefixLength) { + best_common = shorttext.substring(j - suffixLength, j) + + shorttext.substring(j, j + prefixLength); + best_longtext_a = longtext.substring(0, i - suffixLength); + best_longtext_b = longtext.substring(i + prefixLength); + best_shorttext_a = shorttext.substring(0, j - suffixLength); + best_shorttext_b = shorttext.substring(j + prefixLength); + } + } + if (best_common.length * 2 >= longtext.length) { + return [best_longtext_a, best_longtext_b, + best_shorttext_a, best_shorttext_b, best_common]; + } else { + return null; + } + } + + // First check if the second quarter is the seed for a half-match. + var hm1 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 4)); + // Check again based on the third quarter. + var hm2 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 2)); + var hm; + if (!hm1 && !hm2) { + return null; + } else if (!hm2) { + hm = hm1; + } else if (!hm1) { + hm = hm2; + } else { + // Both matched. Select the longest. + hm = hm1[4].length > hm2[4].length ? hm1 : hm2; + } + + // A half-match was found, sort out the return data. + var text1_a, text1_b, text2_a, text2_b; + if (text1.length > text2.length) { + text1_a = hm[0]; + text1_b = hm[1]; + text2_a = hm[2]; + text2_b = hm[3]; + } else { + 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]; +}; + + +/** + * Reorder and merge like edit sections. Merge equalities. + * Any edit section can move as long as it doesn't cross an equality. + * @param {Array} diffs Array of diff tuples. + */ +function diff_cleanupMerge(diffs) { + diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. + var pointer = 0; + var count_delete = 0; + var count_insert = 0; + var text_delete = ''; + var text_insert = ''; + var commonlength; + while (pointer < diffs.length) { + 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: + // Upon reaching an equality, check for prior redundancies. + if (count_delete + count_insert > 1) { + if (count_delete !== 0 && count_insert !== 0) { + // Factor out any common prefixies. + commonlength = diff_commonPrefix(text_insert, text_delete); + if (commonlength !== 0) { + if ((pointer - count_delete - count_insert) > 0 && + diffs[pointer - count_delete - count_insert - 1][0] == + DIFF_EQUAL) { + diffs[pointer - count_delete - count_insert - 1][1] += + text_insert.substring(0, commonlength); + } else { + diffs.splice(0, 0, [DIFF_EQUAL, + text_insert.substring(0, commonlength)]); + pointer++; + } + text_insert = text_insert.substring(commonlength); + text_delete = text_delete.substring(commonlength); + } + // Factor out any common suffixies. + commonlength = diff_commonSuffix(text_insert, text_delete); + if (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); + } + } + // Delete the offending records and add the merged ones. + if (count_delete === 0) { + diffs.splice(pointer - count_insert, + count_delete + count_insert, [DIFF_INSERT, text_insert]); + } else if (count_insert === 0) { + diffs.splice(pointer - count_delete, + count_delete + count_insert, [DIFF_DELETE, text_delete]); + } else { + diffs.splice(pointer - count_delete - count_insert, + count_delete + count_insert, [DIFF_DELETE, text_delete], + [DIFF_INSERT, text_insert]); + } + pointer = pointer - count_delete - count_insert + + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; + } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { + // Merge this equality with the previous one. + diffs[pointer - 1][1] += diffs[pointer][1]; + diffs.splice(pointer, 1); + } else { + pointer++; + } + count_insert = 0; + count_delete = 0; + text_delete = ''; + text_insert = ''; + break; + } + } + if (diffs[diffs.length - 1][1] === '') { + diffs.pop(); // Remove the dummy entry at the end. + } + + // Second pass: look for single edits surrounded on both sides by equalities + // which can be shifted sideways to eliminate an equality. + // e.g: ABAC -> ABAC + var changes = false; + pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if (diffs[pointer - 1][0] == DIFF_EQUAL && + diffs[pointer + 1][0] == DIFF_EQUAL) { + // This is a single edit surrounded by equalities. + if (diffs[pointer][1].substring(diffs[pointer][1].length - + diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { + // Shift the edit over the previous equality. + 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 = true; + } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == + diffs[pointer + 1][1]) { + // Shift the edit over the next equality. + 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 = true; + } + } + pointer++; + } + // If shifts were made, the diff needs reordering and another shift sweep. + if (changes) { + diff_cleanupMerge(diffs); + } +}; + + +var diff = diff_main; +diff.INSERT = DIFF_INSERT; +diff.DELETE = DIFF_DELETE; +diff.EQUAL = DIFF_EQUAL; + +module.exports = diff; + +/* + * Modify a diff such that the cursor position points to the start of a change: + * E.g. + * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) + * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] + * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) + * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} A tuple [cursor location in the modified diff, modified diff] + */ +function cursor_normalize_diff (diffs, cursor_pos) { + if (cursor_pos === 0) { + return [DIFF_EQUAL, diffs]; + } + for (var current_pos = 0, i = 0; i < diffs.length; i++) { + var d = diffs[i]; + if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { + var next_pos = current_pos + d[1].length; + if (cursor_pos === next_pos) { + return [i + 1, diffs]; + } else if (cursor_pos < next_pos) { + // copy to prevent side effects + diffs = diffs.slice(); + // split d into two diff changes + var split_pos = cursor_pos - current_pos; + var d_left = [d[0], d[1].slice(0, split_pos)]; + var d_right = [d[0], d[1].slice(split_pos)]; + diffs.splice(i, 1, d_left, d_right); + return [i + 1, diffs]; + } else { + current_pos = next_pos; + } + } + } + throw new Error('cursor_pos is out of bounds!') +} + +/* + * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). + * + * Case 1) + * Check if a naive shift is possible: + * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) + * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result + * Case 2) + * Check if the following shifts are possible: + * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] + * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] + * ^ ^ + * d d_next + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} Array of diff tuples + */ +function fix_cursor (diffs, cursor_pos) { + var norm = cursor_normalize_diff(diffs, cursor_pos); + var ndiffs = norm[1]; + var cursor_pointer = norm[0]; + var d = ndiffs[cursor_pointer]; + var d_next = ndiffs[cursor_pointer + 1]; + + if (d == null) { + // Text was deleted from end of original string, + // cursor is now out of bounds in new string + return diffs; + } else if (d[0] !== DIFF_EQUAL) { + // A modification happened at the cursor location. + // This is the expected outcome, so we can return the original diff. + return diffs; + } else { + if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { + // Case 1) + // It is possible to perform a naive shift + ndiffs.splice(cursor_pointer, 2, d_next, d) + return merge_tuples(ndiffs, cursor_pointer, 2) + } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { + // Case 2) + // d[1] is a prefix of d_next[1] + // We can assume that d_next[0] !== 0, since d[0] === 0 + // Shift edit locations.. + ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); + var suffix = d_next[1].slice(d[1].length); + if (suffix.length > 0) { + ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); + } + return merge_tuples(ndiffs, cursor_pointer, 3) + } else { + // Not possible to perform any modification + return diffs; + } + } +} + +/* + * Check diff did not split surrogate pairs. + * Ex. [0, '\uD83D'], [-1, '\uDC36'], [1, '\uDC2F'] -> [-1, '\uD83D\uDC36'], [1, '\uD83D\uDC2F'] + * '\uD83D\uDC36' === '🐶', '\uD83D\uDC2F' === '🐯' + * + * @param {Array} diffs Array of diff tuples + * @return {Array} Array of diff tuples + */ +function fix_emoji (diffs) { + var compact = false; + var starts_with_pair_end = function(str) { + return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF; + } + var ends_with_pair_start = function(str) { + return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF; + } + for (var i = 2; i < diffs.length; i += 1) { + if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) && + diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) && + diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) { + compact = true; + + diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1]; + diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1]; + + diffs[i-2][1] = diffs[i-2][1].slice(0, -1); + } + } + if (!compact) { + return diffs; + } + var fixed_diffs = []; + for (var i = 0; i < diffs.length; i += 1) { + if (diffs[i][1].length > 0) { + fixed_diffs.push(diffs[i]); + } + } + return fixed_diffs; +} + +/* + * Try to merge tuples with their neigbors in a given range. + * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] + * + * @param {Array} diffs Array of diff tuples. + * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). + * @param {Int} length Number of consecutive elements to check. + * @return {Array} Array of merged diff tuples. + */ +function merge_tuples (diffs, start, length) { + // Check from (start-1) to (start+length). + for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { + if (i + 1 < diffs.length) { + var left_d = diffs[i]; + var right_d = diffs[i+1]; + if (left_d[0] === right_d[1]) { + diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); + } + } + } + return diffs; +} - var _block = __webpack_require__(29); - var _block2 = _interopRequireDefault(_block); +/***/ }), +/* 52 */ +/***/ (function(module, exports) { - var _break = __webpack_require__(31); +exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; - var _break2 = _interopRequireDefault(_break); +exports.shim = shim; +function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} - var _container = __webpack_require__(46); - var _container2 = _interopRequireDefault(_container); +/***/ }), +/* 53 */ +/***/ (function(module, exports) { - var _code = __webpack_require__(28); +var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) +})() == '[object Arguments]'; + +exports = module.exports = supportsArgumentsClass ? supported : unsupported; + +exports.supported = supported; +function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +}; + +exports.unsupported = unsupported; +function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; +}; - var _code2 = _interopRequireDefault(_code); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ }), +/* 54 */ +/***/ (function(module, exports) { - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +'use strict'; - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var has = Object.prototype.hasOwnProperty + , prefix = '~'; - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @api private + */ +function Events() {} - function isLine(blot) { - return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; - } +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {Mixed} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @api private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @api public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Boolean} exists Only check if there are listeners. + * @returns {Array|Boolean} + * @api public + */ +EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @api public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; - var Scroll = function (_Parchment$Scroll) { - _inherits(Scroll, _Parchment$Scroll); + if (!this._events[evt]) return false; - function Scroll(domNode, config) { - _classCallCheck(this, Scroll); + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + 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++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (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 true; +}; + +/** + * Add a listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Add a one-time listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Remove the listeners of a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {Mixed} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; - var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); + if (!this._events[evt]) return this; + if (!fn) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn + && (!once || listeners.once) + && (!context || listeners.context === context) + ) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {String|Symbol} [event] The event name. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; - _this.emitter = config.emitter; - if (Array.isArray(config.whitelist)) { - _this.whitelist = config.whitelist.reduce(function (whitelist, format) { - whitelist[format] = true; - return whitelist; - }, {}); - } - _this.optimize(); - _this.enable(); - return _this; - } - - _createClass(Scroll, [{ - key: 'deleteAt', - value: function deleteAt(index, length) { - var _line = this.line(index), - _line2 = _slicedToArray(_line, 2), - first = _line2[0], - offset = _line2[1]; - - var _line3 = this.line(index + length), - _line4 = _slicedToArray(_line3, 1), - last = _line4[0]; - - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); - if (last != null && first !== last && offset > 0 && !(first instanceof _block.BlockEmbed) && !(last instanceof _block.BlockEmbed)) { - if (last instanceof _code2.default) { - last.deleteAt(last.length() - 1, 1); - } - var ref = last.children.head instanceof _break2.default ? null : last.children.head; - first.moveChildren(last, ref); - first.remove(); - } - this.optimize(); - } - }, { - key: 'enable', - value: function enable() { - var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - - this.domNode.setAttribute('contenteditable', enabled); - } - }, { - key: 'formatAt', - value: function formatAt(index, length, format, value) { - if (this.whitelist != null && !this.whitelist[format]) return; - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); - this.optimize(); - } - }, { - key: 'insertAt', - value: function insertAt(index, value, def) { - if (def != null && this.whitelist != null && !this.whitelist[value]) return; - if (index >= this.length()) { - if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { - var blot = _parchment2.default.create(this.statics.defaultChild); - this.appendChild(blot); - if (def == null && value.endsWith('\n')) { - value = value.slice(0, -1); - } - blot.insertAt(0, value, def); - } else { - var embed = _parchment2.default.create(value, def); - this.appendChild(embed); - } - } else { - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); - } - this.optimize(); - } - }, { - key: 'insertBefore', - value: function insertBefore(blot, ref) { - if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { - var wrapper = _parchment2.default.create(this.statics.defaultChild); - wrapper.appendChild(blot); - blot = wrapper; - } - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); - } - }, { - key: 'leaf', - value: function leaf(index) { - return this.path(index).pop() || [null, -1]; - } - }, { - key: 'line', - value: function line(index) { - if (index === this.length()) { - return this.line(index - 1); - } - return this.descendant(isLine, index); - } - }, { - key: 'lines', - value: function lines() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; - - var getLines = function getLines(blot, index, length) { - var lines = [], - lengthLeft = length; - blot.children.forEachAt(index, length, function (child, index, length) { - if (isLine(child)) { - lines.push(child); - } else if (child instanceof _parchment2.default.Container) { - lines = lines.concat(getLines(child, index, lengthLeft)); - } - lengthLeft -= length; - }); - return lines; - }; - return getLines(this, index, length); - } - }, { - key: 'optimize', - value: function optimize() { - var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - if (this.batch === true) return; - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations); - if (mutations.length > 0) { - this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations); - } - } - }, { - key: 'path', - value: function path(index) { - return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self - } - }, { - key: 'update', - value: function update(mutations) { - if (this.batch === true) return; - var source = _emitter2.default.sources.USER; - if (typeof mutations === 'string') { - source = mutations; - } - if (!Array.isArray(mutations)) { - mutations = this.observer.takeRecords(); - } - if (mutations.length > 0) { - this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); - } - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy - if (mutations.length > 0) { - this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); - } - } - }]); - - return Scroll; - }(_parchment2.default.Scroll); - - Scroll.blotName = 'scroll'; - Scroll.className = 'ql-editor'; - Scroll.tagName = 'DIV'; - Scroll.defaultChild = 'block'; - Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// This function doesn't apply anymore. +// +EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; +}; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} - exports.default = Scroll; -/***/ }, -/* 48 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _quillDelta = __webpack_require__(20); - - var _quillDelta2 = _interopRequireDefault(_quillDelta); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _quill = __webpack_require__(18); - - var _quill2 = _interopRequireDefault(_quill); - - var _logger = __webpack_require__(38); - - var _logger2 = _interopRequireDefault(_logger); - - var _module = __webpack_require__(43); - - var _module2 = _interopRequireDefault(_module); - - var _align = __webpack_require__(49); - - var _background = __webpack_require__(50); - - var _color = __webpack_require__(51); - - var _direction = __webpack_require__(52); - - var _font = __webpack_require__(53); - - var _size = __webpack_require__(54); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var debug = (0, _logger2.default)('quill:clipboard'); - - var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; - - var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { - memo[attr.keyName] = attr; - return memo; - }, {}); - - var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { - memo[attr.keyName] = attr; - return memo; - }, {}); - - var Clipboard = function (_Module) { - _inherits(Clipboard, _Module); - - function Clipboard(quill, options) { - _classCallCheck(this, Clipboard); - - var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); - - _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); - _this.container = _this.quill.addContainer('ql-clipboard'); - _this.container.setAttribute('contenteditable', true); - _this.container.setAttribute('tabindex', -1); - _this.matchers = []; - CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (pair) { - _this.addMatcher.apply(_this, _toConsumableArray(pair)); - }); - return _this; - } - - _createClass(Clipboard, [{ - key: 'addMatcher', - value: function addMatcher(selector, matcher) { - this.matchers.push([selector, matcher]); - } - }, { - key: 'convert', - value: function convert(html) { - var _this2 = this; - - var DOM_KEY = '__ql-matcher'; - if (typeof html === 'string') { - this.container.innerHTML = html; - } - var textMatchers = [], - elementMatchers = []; - this.matchers.forEach(function (pair) { - var _pair = _slicedToArray(pair, 2), - selector = _pair[0], - matcher = _pair[1]; - - switch (selector) { - case Node.TEXT_NODE: - textMatchers.push(matcher); - break; - case Node.ELEMENT_NODE: - elementMatchers.push(matcher); - break; - default: - [].forEach.call(_this2.container.querySelectorAll(selector), function (node) { - // TODO use weakmap - node[DOM_KEY] = node[DOM_KEY] || []; - node[DOM_KEY].push(matcher); - }); - break; - } - }); - var traverse = function traverse(node) { - // Post-order - if (node.nodeType === node.TEXT_NODE) { - return textMatchers.reduce(function (delta, matcher) { - return matcher(node, delta); - }, new _quillDelta2.default()); - } else if (node.nodeType === node.ELEMENT_NODE) { - return [].reduce.call(node.childNodes || [], function (delta, childNode) { - var childrenDelta = traverse(childNode); - if (childNode.nodeType === node.ELEMENT_NODE) { - childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { - return matcher(childNode, childrenDelta); - }, childrenDelta); - childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { - return matcher(childNode, childrenDelta); - }, childrenDelta); - } - return delta.concat(childrenDelta); - }, new _quillDelta2.default()); - } else { - return new _quillDelta2.default(); - } - }; - var delta = traverse(this.container); - // Remove trailing newline - if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { - delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); - } - debug.log('convert', this.container.innerHTML, delta); - this.container.innerHTML = ''; - return delta; - } - }, { - key: 'dangerouslyPasteHTML', - value: function dangerouslyPasteHTML(index, html) { - var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; - - if (typeof index === 'string') { - return this.quill.setContents(this.convert(index), html); - } else { - var paste = this.convert(html); - return this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); - } - } - }, { - key: 'onPaste', - value: function onPaste(e) { - var _this3 = this; - - if (e.defaultPrevented || !this.quill.isEnabled()) return; - var range = this.quill.getSelection(); - var delta = new _quillDelta2.default().retain(range.index).delete(range.length); - var bodyTop = document.body.scrollTop; - this.container.focus(); - setTimeout(function () { - _this3.quill.selection.update(_quill2.default.sources.SILENT); - delta = delta.concat(_this3.convert()); - _this3.quill.updateContents(delta, _quill2.default.sources.USER); - // range.length contributes to delta.length() - _this3.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); - document.body.scrollTop = bodyTop; - _this3.quill.selection.scrollIntoView(); - }, 1); - } - }]); - - return Clipboard; - }(_module2.default); - - Clipboard.DEFAULTS = { - matchers: [] - }; - - function computeStyle(node) { - if (node.nodeType !== Node.ELEMENT_NODE) return {}; - var DOM_KEY = '__ql-computed-style'; - return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); - } - function deltaEndsWith(delta, text) { - var endText = ""; - for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { - var op = delta.ops[i]; - if (typeof op.insert !== 'string') break; - endText = op.insert + endText; - } - return endText.slice(-1 * text.length) === text; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; - function isLine(node) { - if (node.childNodes.length === 0) return false; // Exclude embed blocks - var style = computeStyle(node); - return ['block', 'list-item'].indexOf(style.display) > -1; - } +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - function matchAlias(format, node, delta) { - return delta.compose(new _quillDelta2.default().retain(delta.length(), _defineProperty({}, format, true))); - } +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - function matchAttributor(node, delta) { - var attributes = _parchment2.default.Attributor.Attribute.keys(node); - var classes = _parchment2.default.Attributor.Class.keys(node); - var styles = _parchment2.default.Attributor.Style.keys(node); - var formats = {}; - attributes.concat(classes).concat(styles).forEach(function (name) { - var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); - if (attr != null) { - formats[attr.attrName] = attr.value(node); - if (formats[attr.attrName]) return; - } - if (ATTRIBUTE_ATTRIBUTORS[name] != null) { - attr = ATTRIBUTE_ATTRIBUTORS[name]; - formats[attr.attrName] = attr.value(node); - } - if (STYLE_ATTRIBUTORS[name] != null) { - attr = STYLE_ATTRIBUTORS[name]; - formats[attr.attrName] = attr.value(node); - } - }); - if (Object.keys(formats).length > 0) { - delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats)); - } - return delta; - } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function matchBlot(node, delta) { - var match = _parchment2.default.query(node); - if (match == null) return delta; - if (match.prototype instanceof _parchment2.default.Embed) { - var embed = {}; - var value = match.value(node); - if (value != null) { - embed[match.blotName] = value; - delta = new _quillDelta2.default().insert(embed, match.formats(node)); - } - } else if (typeof match.formats === 'function') { - var formats = _defineProperty({}, match.blotName, match.formats(node)); - delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats)); - } - return delta; - } +var _extend2 = __webpack_require__(3); + +var _extend3 = _interopRequireDefault(_extend2); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _align = __webpack_require__(36); + +var _background = __webpack_require__(37); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _color = __webpack_require__(26); + +var _direction = __webpack_require__(38); + +var _font = __webpack_require__(39); + +var _size = __webpack_require__(40); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:clipboard'); + +var DOM_KEY = '__ql-matcher'; + +var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; + +var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var Clipboard = function (_Module) { + _inherits(Clipboard, _Module); + + function Clipboard(quill, options) { + _classCallCheck(this, Clipboard); + + var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); + + _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); + _this.container = _this.quill.addContainer('ql-clipboard'); + _this.container.setAttribute('contenteditable', true); + _this.container.setAttribute('tabindex', -1); + _this.matchers = []; + CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + selector = _ref2[0], + matcher = _ref2[1]; + + if (!options.matchVisual && matcher === matchSpacing) return; + _this.addMatcher(selector, matcher); + }); + return _this; + } + + _createClass(Clipboard, [{ + key: 'addMatcher', + value: function addMatcher(selector, matcher) { + this.matchers.push([selector, matcher]); + } + }, { + key: 'convert', + value: function convert(html) { + if (typeof html === 'string') { + this.container.innerHTML = html.replace(/\>\r?\n +\<'); // Remove spaces between tags + return this.convert(); + } + var formats = this.quill.getFormat(this.quill.selection.savedRange.index); + if (formats[_code2.default.blotName]) { + var text = this.container.innerText; + this.container.innerHTML = ''; + return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName])); + } + + var _prepareMatching = this.prepareMatching(), + _prepareMatching2 = _slicedToArray(_prepareMatching, 2), + elementMatchers = _prepareMatching2[0], + textMatchers = _prepareMatching2[1]; + + var delta = traverse(this.container, elementMatchers, textMatchers); + // Remove trailing newline + if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); + } + debug.log('convert', this.container.innerHTML, delta); + this.container.innerHTML = ''; + return delta; + } + }, { + key: 'dangerouslyPasteHTML', + value: function dangerouslyPasteHTML(index, html) { + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; + + if (typeof index === 'string') { + this.quill.setContents(this.convert(index), html); + this.quill.setSelection(0, _quill2.default.sources.SILENT); + } else { + var paste = this.convert(html); + this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); + this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT); + } + } + }, { + key: 'onPaste', + value: function onPaste(e) { + var _this2 = this; + + if (e.defaultPrevented || !this.quill.isEnabled()) return; + var range = this.quill.getSelection(); + var delta = new _quillDelta2.default().retain(range.index); + var scrollTop = this.quill.scrollingContainer.scrollTop; + this.container.focus(); + this.quill.selection.update(_quill2.default.sources.SILENT); + setTimeout(function () { + delta = delta.concat(_this2.convert()).delete(range.length); + _this2.quill.updateContents(delta, _quill2.default.sources.USER); + // range.length contributes to delta.length() + _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); + _this2.quill.scrollingContainer.scrollTop = scrollTop; + _this2.quill.focus(); + }, 1); + } + }, { + key: 'prepareMatching', + value: function prepareMatching() { + var _this3 = this; + + var elementMatchers = [], + textMatchers = []; + this.matchers.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + selector = _pair[0], + matcher = _pair[1]; + + switch (selector) { + case Node.TEXT_NODE: + textMatchers.push(matcher); + break; + case Node.ELEMENT_NODE: + elementMatchers.push(matcher); + break; + default: + [].forEach.call(_this3.container.querySelectorAll(selector), function (node) { + // TODO use weakmap + node[DOM_KEY] = node[DOM_KEY] || []; + node[DOM_KEY].push(matcher); + }); + break; + } + }); + return [elementMatchers, textMatchers]; + } + }]); + + return Clipboard; +}(_module2.default); + +Clipboard.DEFAULTS = { + matchers: [], + matchVisual: true +}; + +function applyFormat(delta, format, value) { + if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') { + return Object.keys(format).reduce(function (delta, key) { + return applyFormat(delta, key, format[key]); + }, delta); + } else { + return delta.reduce(function (delta, op) { + if (op.attributes && op.attributes[format]) { + return delta.push(op); + } else { + return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes)); + } + }, new _quillDelta2.default()); + } +} + +function computeStyle(node) { + if (node.nodeType !== Node.ELEMENT_NODE) return {}; + var DOM_KEY = '__ql-computed-style'; + return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); +} + +function deltaEndsWith(delta, text) { + var endText = ""; + for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { + var op = delta.ops[i]; + if (typeof op.insert !== 'string') break; + endText = op.insert + endText; + } + return endText.slice(-1 * text.length) === text; +} + +function isLine(node) { + if (node.childNodes.length === 0) return false; // Exclude embed blocks + var style = computeStyle(node); + return ['block', 'list-item'].indexOf(style.display) > -1; +} + +function traverse(node, elementMatchers, textMatchers) { + // Post-order + if (node.nodeType === node.TEXT_NODE) { + return textMatchers.reduce(function (delta, matcher) { + return matcher(node, delta); + }, new _quillDelta2.default()); + } else if (node.nodeType === node.ELEMENT_NODE) { + return [].reduce.call(node.childNodes || [], function (delta, childNode) { + var childrenDelta = traverse(childNode, elementMatchers, textMatchers); + if (childNode.nodeType === node.ELEMENT_NODE) { + childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + } + return delta.concat(childrenDelta); + }, new _quillDelta2.default()); + } else { + return new _quillDelta2.default(); + } +} + +function matchAlias(format, node, delta) { + return applyFormat(delta, format, true); +} + +function matchAttributor(node, delta) { + var attributes = _parchment2.default.Attributor.Attribute.keys(node); + var classes = _parchment2.default.Attributor.Class.keys(node); + var styles = _parchment2.default.Attributor.Style.keys(node); + var formats = {}; + attributes.concat(classes).concat(styles).forEach(function (name) { + var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); + if (attr != null) { + formats[attr.attrName] = attr.value(node); + if (formats[attr.attrName]) return; + } + attr = ATTRIBUTE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + formats[attr.attrName] = attr.value(node) || undefined; + } + attr = STYLE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + attr = STYLE_ATTRIBUTORS[name]; + formats[attr.attrName] = attr.value(node) || undefined; + } + }); + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + return delta; +} + +function matchBlot(node, delta) { + var match = _parchment2.default.query(node); + if (match == null) return delta; + if (match.prototype instanceof _parchment2.default.Embed) { + var embed = {}; + var value = match.value(node); + if (value != null) { + embed[match.blotName] = value; + delta = new _quillDelta2.default().insert(embed, match.formats(node)); + } + } else if (typeof match.formats === 'function') { + delta = applyFormat(delta, match.blotName, match.formats(node)); + } + return delta; +} + +function matchBreak(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + delta.insert('\n'); + } + return delta; +} + +function matchIgnore() { + return new _quillDelta2.default(); +} + +function matchIndent(node, delta) { + var match = _parchment2.default.query(node); + if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\n')) { + return delta; + } + var indent = -1, + parent = node.parentNode; + while (!parent.classList.contains('ql-clipboard')) { + if ((_parchment2.default.query(parent) || {}).blotName === 'list') { + indent += 1; + } + parent = parent.parentNode; + } + if (indent <= 0) return delta; + return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent })); +} + +function matchNewline(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) { + delta.insert('\n'); + } + } + return delta; +} + +function matchSpacing(node, delta) { + if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { + var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); + if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { + delta.insert('\n'); + } + } + return delta; +} + +function matchStyles(node, delta) { + var formats = {}; + var style = node.style || {}; + if (style.fontStyle && computeStyle(node).fontStyle === 'italic') { + formats.italic = true; + } + if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) { + formats.bold = true; + } + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + if (parseFloat(style.textIndent || 0) > 0) { + // Could be 0.5in + delta = new _quillDelta2.default().insert('\t').concat(delta); + } + return delta; +} + +function matchText(node, delta) { + var text = node.data; + // Word represents empty line with   + if (node.parentNode.tagName === 'O:P') { + return delta.insert(text.trim()); + } + if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) { + return delta; + } + if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { + // eslint-disable-next-line func-style + var replacer = function replacer(collapse, match) { + match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; + return match.length < 1 && collapse ? ' ' : match; + }; + text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); + text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace + if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { + text = text.replace(/^\s+/, replacer.bind(replacer, false)); + } + if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { + text = text.replace(/\s+$/, replacer.bind(replacer, false)); + } + } + return delta.insert(text); +} + +exports.default = Clipboard; +exports.matchAttributor = matchAttributor; +exports.matchBlot = matchBlot; +exports.matchNewline = matchNewline; +exports.matchSpacing = matchSpacing; +exports.matchText = matchText; - function matchBreak(node, delta) { - if (!deltaEndsWith(delta, '\n')) { - delta.insert('\n'); - } - return delta; - } +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { - function matchIgnore() { - return new _quillDelta2.default(); - } +"use strict"; - function matchNewline(node, delta) { - if (isLine(node) && !deltaEndsWith(delta, '\n')) { - delta.insert('\n'); - } - return delta; - } - function matchSpacing(node, delta) { - if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { - var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); - if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { - delta.insert('\n'); - } - } - return delta; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); - function matchStyles(node, delta) { - var formats = {}; - var style = node.style || {}; - if (style.fontWeight && computeStyle(node).fontWeight === 'bold') { - formats.bold = true; - } - if (Object.keys(formats).length > 0) { - delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats)); - } - if (parseFloat(style.textIndent || 0) > 0) { - // Could be 0.5in - delta = new _quillDelta2.default().insert('\t').concat(delta); - } - return delta; - } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function matchText(node, delta) { - var text = node.data; - // Word represents empty line with   - if (node.parentNode.tagName === 'O:P') { - return delta.insert(text.trim()); - } - if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { - // eslint-disable-next-line func-style - var replacer = function replacer(collapse, match) { - match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; - return match.length < 1 && collapse ? ' ' : match; - }; - text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); - text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace - if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { - text = text.replace(/^\s+/, replacer.bind(replacer, false)); - } - if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { - text = text.replace(/\s+$/, replacer.bind(replacer, false)); - } - } - return delta.insert(text); - } +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - exports.default = Clipboard; - exports.matchAttributor = matchAttributor; - exports.matchBlot = matchBlot; - exports.matchNewline = matchNewline; - exports.matchSpacing = matchSpacing; - exports.matchText = matchText; +var _inline = __webpack_require__(6); -/***/ }, -/* 49 */ -/***/ function(module, exports, __webpack_require__) { +var _inline2 = _interopRequireDefault(_inline); - 'use strict'; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var _parchment = __webpack_require__(2); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - var _parchment2 = _interopRequireDefault(_parchment); +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var Bold = function (_Inline) { + _inherits(Bold, _Inline); - var config = { - scope: _parchment2.default.Scope.BLOCK, - whitelist: ['right', 'center', 'justify'] - }; + function Bold() { + _classCallCheck(this, Bold); - var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); - var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); - var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); + return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments)); + } - exports.AlignAttribute = AlignAttribute; - exports.AlignClass = AlignClass; - exports.AlignStyle = AlignStyle; + _createClass(Bold, [{ + key: 'optimize', + value: function optimize(context) { + _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context); + if (this.domNode.tagName !== this.statics.tagName[0]) { + this.replaceWith(this.statics.blotName); + } + } + }], [{ + key: 'create', + value: function create() { + return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this); + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); -/***/ }, -/* 50 */ -/***/ function(module, exports, __webpack_require__) { + return Bold; +}(_inline2.default); - 'use strict'; +Bold.blotName = 'bold'; +Bold.tagName = ['STRONG', 'B']; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.BackgroundStyle = exports.BackgroundClass = undefined; +exports.default = Bold; - var _parchment = __webpack_require__(2); +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { - var _parchment2 = _interopRequireDefault(_parchment); +"use strict"; - var _color = __webpack_require__(51); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addControls = exports.default = undefined; - var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { - scope: _parchment2.default.Scope.INLINE - }); - var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { - scope: _parchment2.default.Scope.INLINE - }); +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - exports.BackgroundClass = BackgroundClass; - exports.BackgroundStyle = BackgroundStyle; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -/***/ }, -/* 51 */ -/***/ function(module, exports, __webpack_require__) { +var _quillDelta = __webpack_require__(2); - 'use strict'; +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:toolbar'); + +var Toolbar = function (_Module) { + _inherits(Toolbar, _Module); + + function Toolbar(quill, options) { + _classCallCheck(this, Toolbar); + + var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options)); + + if (Array.isArray(_this.options.container)) { + var container = document.createElement('div'); + addControls(container, _this.options.container); + quill.container.parentNode.insertBefore(container, quill.container); + _this.container = container; + } else if (typeof _this.options.container === 'string') { + _this.container = document.querySelector(_this.options.container); + } else { + _this.container = _this.options.container; + } + if (!(_this.container instanceof HTMLElement)) { + var _ret; + + return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret); + } + _this.container.classList.add('ql-toolbar'); + _this.controls = []; + _this.handlers = {}; + Object.keys(_this.options.handlers).forEach(function (format) { + _this.addHandler(format, _this.options.handlers[format]); + }); + [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) { + _this.attach(input); + }); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) { + if (type === _quill2.default.events.SELECTION_CHANGE) { + _this.update(range); + } + }); + _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { + var _this$quill$selection = _this.quill.selection.getRange(), + _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), + range = _this$quill$selection2[0]; // quill.getSelection triggers update + + + _this.update(range); + }); + return _this; + } + + _createClass(Toolbar, [{ + key: 'addHandler', + value: function addHandler(format, handler) { + this.handlers[format] = handler; + } + }, { + key: 'attach', + value: function attach(input) { + var _this2 = this; + + var format = [].find.call(input.classList, function (className) { + return className.indexOf('ql-') === 0; + }); + if (!format) return; + format = format.slice('ql-'.length); + if (input.tagName === 'BUTTON') { + input.setAttribute('type', 'button'); + } + if (this.handlers[format] == null) { + if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) { + debug.warn('ignoring attaching to disabled format', format, input); + return; + } + if (_parchment2.default.query(format) == null) { + debug.warn('ignoring attaching to nonexistent format', format, input); + return; + } + } + var eventName = input.tagName === 'SELECT' ? 'change' : 'click'; + input.addEventListener(eventName, function (e) { + var value = void 0; + if (input.tagName === 'SELECT') { + if (input.selectedIndex < 0) return; + var selected = input.options[input.selectedIndex]; + if (selected.hasAttribute('selected')) { + value = false; + } else { + value = selected.value || false; + } + } else { + if (input.classList.contains('ql-active')) { + value = false; + } else { + value = input.value || !input.hasAttribute('value'); + } + e.preventDefault(); + } + _this2.quill.focus(); + + var _quill$selection$getR = _this2.quill.selection.getRange(), + _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), + range = _quill$selection$getR2[0]; + + if (_this2.handlers[format] != null) { + _this2.handlers[format].call(_this2, value); + } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) { + value = prompt('Enter ' + format); + if (!value) return; + _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER); + } else { + _this2.quill.format(format, value, _quill2.default.sources.USER); + } + _this2.update(range); + }); + // TODO use weakmap + this.controls.push([format, input]); + } + }, { + key: 'update', + value: function update(range) { + var formats = range == null ? {} : this.quill.getFormat(range); + this.controls.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + format = _pair[0], + input = _pair[1]; + + if (input.tagName === 'SELECT') { + var option = void 0; + if (range == null) { + option = null; + } else if (formats[format] == null) { + option = input.querySelector('option[selected]'); + } else if (!Array.isArray(formats[format])) { + var value = formats[format]; + if (typeof value === 'string') { + value = value.replace(/\"/g, '\\"'); + } + option = input.querySelector('option[value="' + value + '"]'); + } + if (option == null) { + input.value = ''; // TODO make configurable? + input.selectedIndex = -1; + } else { + option.selected = true; + } + } else { + if (range == null) { + input.classList.remove('ql-active'); + } else if (input.hasAttribute('value')) { + // both being null should match (default values) + // '1' should match with 1 (headers) + var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value'); + input.classList.toggle('ql-active', isActive); + } else { + input.classList.toggle('ql-active', formats[format] != null); + } + } + }); + } + }]); + + return Toolbar; +}(_module2.default); + +Toolbar.DEFAULTS = {}; + +function addButton(container, format, value) { + var input = document.createElement('button'); + input.setAttribute('type', 'button'); + input.classList.add('ql-' + format); + if (value != null) { + input.value = value; + } + container.appendChild(input); +} + +function addControls(container, groups) { + if (!Array.isArray(groups[0])) { + groups = [groups]; + } + groups.forEach(function (controls) { + var group = document.createElement('span'); + group.classList.add('ql-formats'); + controls.forEach(function (control) { + if (typeof control === 'string') { + addButton(group, control); + } else { + var format = Object.keys(control)[0]; + var value = control[format]; + if (Array.isArray(value)) { + addSelect(group, format, value); + } else { + addButton(group, format, value); + } + } + }); + container.appendChild(group); + }); +} + +function addSelect(container, format, values) { + var input = document.createElement('select'); + input.classList.add('ql-' + format); + values.forEach(function (value) { + var option = document.createElement('option'); + if (value !== false) { + option.setAttribute('value', value); + } else { + option.setAttribute('selected', 'selected'); + } + input.appendChild(option); + }); + container.appendChild(input); +} + +Toolbar.DEFAULTS = { + container: null, + handlers: { + clean: function clean() { + var _this3 = this; + + var range = this.quill.getSelection(); + if (range == null) return; + if (range.length == 0) { + var formats = this.quill.getFormat(); + Object.keys(formats).forEach(function (name) { + // Clean functionality in existing apps only clean inline formats + if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) { + _this3.quill.format(name, false); + } + }); + } else { + this.quill.removeFormat(range, _quill2.default.sources.USER); + } + }, + direction: function direction(value) { + var align = this.quill.getFormat()['align']; + if (value === 'rtl' && align == null) { + this.quill.format('align', 'right', _quill2.default.sources.USER); + } else if (!value && align === 'right') { + this.quill.format('align', false, _quill2.default.sources.USER); + } + this.quill.format('direction', value, _quill2.default.sources.USER); + }, + indent: function indent(value) { + var range = this.quill.getSelection(); + var formats = this.quill.getFormat(range); + var indent = parseInt(formats.indent || 0); + if (value === '+1' || value === '-1') { + var modifier = value === '+1' ? 1 : -1; + if (formats.direction === 'rtl') modifier *= -1; + this.quill.format('indent', indent + modifier, _quill2.default.sources.USER); + } + }, + link: function link(value) { + if (value === true) { + value = prompt('Enter link URL:'); + } + this.quill.format('link', value, _quill2.default.sources.USER); + }, + list: function list(value) { + var range = this.quill.getSelection(); + var formats = this.quill.getFormat(range); + if (value === 'check') { + if (formats['list'] === 'checked' || formats['list'] === 'unchecked') { + this.quill.format('list', false, _quill2.default.sources.USER); + } else { + this.quill.format('list', 'unchecked', _quill2.default.sources.USER); + } + } else { + this.quill.format('list', value, _quill2.default.sources.USER); + } + } + } +}; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; +exports.default = Toolbar; +exports.addControls = addControls; - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +/***/ }), +/* 58 */ +/***/ (function(module, exports) { - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +module.exports = " "; - var _parchment = __webpack_require__(2); +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { - var _parchment2 = _interopRequireDefault(_parchment); +"use strict"; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +Object.defineProperty(exports, "__esModule", { + value: true +}); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - var ColorAttributor = function (_Parchment$Attributor) { - _inherits(ColorAttributor, _Parchment$Attributor); +var _picker = __webpack_require__(28); - function ColorAttributor() { - _classCallCheck(this, ColorAttributor); +var _picker2 = _interopRequireDefault(_picker); - return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ColorPicker = function (_Picker) { + _inherits(ColorPicker, _Picker); + + function ColorPicker(select, label) { + _classCallCheck(this, ColorPicker); + + var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select)); + + _this.label.innerHTML = label; + _this.container.classList.add('ql-color-picker'); + [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) { + item.classList.add('ql-primary'); + }); + return _this; + } + + _createClass(ColorPicker, [{ + key: 'buildItem', + value: function buildItem(option) { + var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option); + item.style.backgroundColor = option.getAttribute('value') || ''; + return item; + } + }, { + key: 'selectItem', + value: function selectItem(item, trigger) { + _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger); + var colorLabel = this.label.querySelector('.ql-color-label'); + var value = item ? item.getAttribute('data-value') || '' : ''; + if (colorLabel) { + if (colorLabel.tagName === 'line') { + colorLabel.style.stroke = value; + } else { + colorLabel.style.fill = value; + } + } + } + }]); - _createClass(ColorAttributor, [{ - key: 'value', - value: function value(domNode) { - var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); - if (!value.startsWith('rgb(')) return value; - value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); - return '#' + value.split(',').map(function (component) { - return ('00' + parseInt(component).toString(16)).slice(-2); - }).join(''); - } - }]); + return ColorPicker; +}(_picker2.default); - return ColorAttributor; - }(_parchment2.default.Attributor.Style); +exports.default = ColorPicker; - var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { - scope: _parchment2.default.Scope.INLINE - }); - var ColorStyle = new ColorAttributor('color', 'color', { - scope: _parchment2.default.Scope.INLINE - }); +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { - exports.ColorAttributor = ColorAttributor; - exports.ColorClass = ColorClass; - exports.ColorStyle = ColorStyle; +"use strict"; -/***/ }, -/* 52 */ -/***/ function(module, exports, __webpack_require__) { - 'use strict'; +Object.defineProperty(exports, "__esModule", { + value: true +}); - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var _parchment = __webpack_require__(2); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - var _parchment2 = _interopRequireDefault(_parchment); +var _picker = __webpack_require__(28); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _picker2 = _interopRequireDefault(_picker); - var config = { - scope: _parchment2.default.Scope.BLOCK, - whitelist: ['rtl'] - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); - var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); - var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - exports.DirectionAttribute = DirectionAttribute; - exports.DirectionClass = DirectionClass; - exports.DirectionStyle = DirectionStyle; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -/***/ }, -/* 53 */ -/***/ function(module, exports, __webpack_require__) { +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - 'use strict'; +var IconPicker = function (_Picker) { + _inherits(IconPicker, _Picker); - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.FontClass = exports.FontStyle = undefined; + function IconPicker(select, icons) { + _classCallCheck(this, IconPicker); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select)); - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + _this.container.classList.add('ql-icon-picker'); + [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) { + item.innerHTML = icons[item.getAttribute('data-value') || '']; + }); + _this.defaultItem = _this.container.querySelector('.ql-selected'); + _this.selectItem(_this.defaultItem); + return _this; + } - var _parchment = __webpack_require__(2); + _createClass(IconPicker, [{ + key: 'selectItem', + value: function selectItem(item, trigger) { + _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger); + item = item || this.defaultItem; + this.label.innerHTML = item.innerHTML; + } + }]); - var _parchment2 = _interopRequireDefault(_parchment); + return IconPicker; +}(_picker2.default); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +exports.default = IconPicker; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +"use strict"; - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var config = { - scope: _parchment2.default.Scope.INLINE, - whitelist: ['serif', 'monospace'] - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); - var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var FontStyleAttributor = function (_Parchment$Attributor) { - _inherits(FontStyleAttributor, _Parchment$Attributor); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function FontStyleAttributor() { - _classCallCheck(this, FontStyleAttributor); +var Tooltip = function () { + function Tooltip(quill, boundsContainer) { + var _this = this; + + _classCallCheck(this, Tooltip); + + this.quill = quill; + this.boundsContainer = boundsContainer || document.body; + this.root = quill.addContainer('ql-tooltip'); + this.root.innerHTML = this.constructor.TEMPLATE; + if (this.quill.root === this.quill.scrollingContainer) { + this.quill.root.addEventListener('scroll', function () { + _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px'; + }); + } + this.hide(); + } + + _createClass(Tooltip, [{ + key: 'hide', + value: function hide() { + this.root.classList.add('ql-hidden'); + } + }, { + key: 'position', + value: function position(reference) { + var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2; + // root.scrollTop should be 0 if scrollContainer !== root + var 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'); + var containerBounds = this.boundsContainer.getBoundingClientRect(); + var rootBounds = this.root.getBoundingClientRect(); + var shift = 0; + if (rootBounds.right > containerBounds.right) { + shift = containerBounds.right - rootBounds.right; + this.root.style.left = left + shift + 'px'; + } + if (rootBounds.left < containerBounds.left) { + shift = containerBounds.left - rootBounds.left; + this.root.style.left = left + shift + 'px'; + } + if (rootBounds.bottom > containerBounds.bottom) { + var height = rootBounds.bottom - rootBounds.top; + var verticalShift = reference.bottom - reference.top + height; + this.root.style.top = top - verticalShift + 'px'; + this.root.classList.add('ql-flip'); + } + return shift; + } + }, { + key: 'show', + value: function show() { + this.root.classList.remove('ql-editing'); + this.root.classList.remove('ql-hidden'); + } + }]); - return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); - } + return Tooltip; +}(); - _createClass(FontStyleAttributor, [{ - key: 'value', - value: function value(node) { - return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); - } - }]); +exports.default = Tooltip; - return FontStyleAttributor; - }(_parchment2.default.Attributor.Style); +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { - var FontStyle = new FontStyleAttributor('font', 'font-family', config); +"use strict"; - exports.FontStyle = FontStyle; - exports.FontClass = FontClass; -/***/ }, -/* 54 */ -/***/ function(module, exports, __webpack_require__) { +Object.defineProperty(exports, "__esModule", { + value: true +}); - 'use strict'; +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.SizeStyle = exports.SizeClass = undefined; +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - var _parchment = __webpack_require__(2); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var _parchment2 = _interopRequireDefault(_parchment); +var _extend = __webpack_require__(3); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _extend2 = _interopRequireDefault(_extend); - var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { - scope: _parchment2.default.Scope.INLINE, - whitelist: ['small', 'large', 'huge'] - }); - var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { - scope: _parchment2.default.Scope.INLINE, - whitelist: ['10px', '18px', '32px'] - }); +var _emitter = __webpack_require__(8); - exports.SizeClass = SizeClass; - exports.SizeStyle = SizeStyle; +var _emitter2 = _interopRequireDefault(_emitter); -/***/ }, -/* 55 */ -/***/ function(module, exports, __webpack_require__) { +var _base = __webpack_require__(43); - 'use strict'; +var _base2 = _interopRequireDefault(_base); - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.getLastChangeIndex = exports.default = undefined; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _quill = __webpack_require__(18); - - var _quill2 = _interopRequireDefault(_quill); - - var _module = __webpack_require__(43); - - var _module2 = _interopRequireDefault(_module); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var History = function (_Module) { - _inherits(History, _Module); - - function History(quill, options) { - _classCallCheck(this, History); - - var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); - - _this.lastRecorded = 0; - _this.ignoreChange = false; - _this.clear(); - _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { - if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; - if (!_this.options.userOnly || source === _quill2.default.sources.USER) { - _this.record(delta, oldDelta); - } else { - _this.transform(delta); - } - }); - _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); - _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); - if (/Win/i.test(navigator.platform)) { - _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); - } - return _this; - } - - _createClass(History, [{ - key: 'change', - value: function change(source, dest) { - if (this.stack[source].length === 0) return; - var delta = this.stack[source].pop(); - this.lastRecorded = 0; - this.ignoreChange = true; - this.quill.updateContents(delta[source], _quill2.default.sources.USER); - this.ignoreChange = false; - var index = getLastChangeIndex(delta[source]); - this.quill.setSelection(index); - this.quill.selection.scrollIntoView(); - this.stack[dest].push(delta); - } - }, { - key: 'clear', - value: function clear() { - this.stack = { undo: [], redo: [] }; - } - }, { - key: 'record', - value: function record(changeDelta, oldDelta) { - if (changeDelta.ops.length === 0) return; - this.stack.redo = []; - var undoDelta = this.quill.getContents().diff(oldDelta); - var timestamp = Date.now(); - if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { - var delta = this.stack.undo.pop(); - undoDelta = undoDelta.compose(delta.undo); - changeDelta = delta.redo.compose(changeDelta); - } else { - this.lastRecorded = timestamp; - } - this.stack.undo.push({ - redo: changeDelta, - undo: undoDelta - }); - if (this.stack.undo.length > this.options.maxStack) { - this.stack.undo.shift(); - } - } - }, { - key: 'redo', - value: function redo() { - this.change('redo', 'undo'); - } - }, { - key: 'transform', - value: function transform(delta) { - this.stack.undo.forEach(function (change) { - change.undo = delta.transform(change.undo, true); - change.redo = delta.transform(change.redo, true); - }); - this.stack.redo.forEach(function (change) { - change.undo = delta.transform(change.undo, true); - change.redo = delta.transform(change.redo, true); - }); - } - }, { - key: 'undo', - value: function undo() { - this.change('undo', 'redo'); - } - }]); - - return History; - }(_module2.default); - - History.DEFAULTS = { - delay: 1000, - maxStack: 100, - userOnly: false - }; - - function endsWithNewlineChange(delta) { - var lastOp = delta.ops[delta.ops.length - 1]; - if (lastOp == null) return false; - if (lastOp.insert != null) { - return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); - } - if (lastOp.attributes != null) { - return Object.keys(lastOp.attributes).some(function (attr) { - return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; - }); - } - return false; - } +var _link = __webpack_require__(27); - function getLastChangeIndex(delta) { - var deleteLength = delta.reduce(function (length, op) { - length += op.delete || 0; - return length; - }, 0); - var changeIndex = delta.length() - deleteLength; - if (endsWithNewlineChange(delta)) { - changeIndex -= 1; - } - return changeIndex; - } +var _link2 = _interopRequireDefault(_link); - exports.default = History; - exports.getLastChangeIndex = getLastChangeIndex; +var _selection = __webpack_require__(15); -/***/ }, -/* 56 */ -/***/ function(module, exports, __webpack_require__) { +var _icons = __webpack_require__(41); - 'use strict'; +var _icons2 = _interopRequireDefault(_icons); - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _clone = __webpack_require__(39); - - var _clone2 = _interopRequireDefault(_clone); - - var _deepEqual = __webpack_require__(40); - - var _deepEqual2 = _interopRequireDefault(_deepEqual); - - var _extend = __webpack_require__(30); - - var _extend2 = _interopRequireDefault(_extend); - - var _op = __webpack_require__(26); - - var _op2 = _interopRequireDefault(_op); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _quill = __webpack_require__(18); - - var _quill2 = _interopRequireDefault(_quill); - - var _logger = __webpack_require__(38); - - var _logger2 = _interopRequireDefault(_logger); - - var _module = __webpack_require__(43); - - var _module2 = _interopRequireDefault(_module); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var debug = (0, _logger2.default)('quill:keyboard'); - - var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; - - var Keyboard = function (_Module) { - _inherits(Keyboard, _Module); - - _createClass(Keyboard, null, [{ - key: 'match', - value: function match(evt, binding) { - binding = normalize(binding); - if (!!binding.shortKey !== evt[SHORTKEY] && binding.shortKey !== null) return false; - if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { - return key != SHORTKEY && !!binding[key] !== evt[key] && binding[key] !== null; - })) { - return false; - } - return binding.key === (evt.which || evt.keyCode); - } - }]); - - function Keyboard(quill, options) { - _classCallCheck(this, Keyboard); - - var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); - - _this.bindings = {}; - Object.keys(_this.options.bindings).forEach(function (name) { - if (_this.options.bindings[name]) { - _this.addBinding(_this.options.bindings[name]); - } - }); - _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); - _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); - _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); - _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^$/ }, handleDelete); - _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); - _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); - if (/Trident/i.test(navigator.userAgent)) { - _this.addBinding({ key: Keyboard.keys.BACKSPACE, shortKey: true }, handleBackspace); - _this.addBinding({ key: Keyboard.keys.DELETE, shortKey: true }, handleDelete); - } - _this.listen(); - return _this; - } - - _createClass(Keyboard, [{ - key: 'addBinding', - value: function addBinding(key) { - var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - var binding = normalize(key); - if (binding == null || binding.key == null) { - return debug.warn('Attempted to add invalid keyboard binding', binding); - } - if (typeof context === 'function') { - context = { handler: context }; - } - if (typeof handler === 'function') { - handler = { handler: handler }; - } - binding = (0, _extend2.default)(binding, context, handler); - this.bindings[binding.key] = this.bindings[binding.key] || []; - this.bindings[binding.key].push(binding); - } - }, { - key: 'listen', - value: function listen() { - var _this2 = this; - - this.quill.root.addEventListener('keydown', function (evt) { - if (evt.defaultPrevented) return; - var which = evt.which || evt.keyCode; - var bindings = (_this2.bindings[which] || []).filter(function (binding) { - return Keyboard.match(evt, binding); - }); - if (bindings.length === 0) return; - var range = _this2.quill.getSelection(); - if (range == null || !_this2.quill.hasFocus()) return; - - var _quill$scroll$line = _this2.quill.scroll.line(range.index), - _quill$scroll$line2 = _slicedToArray(_quill$scroll$line, 2), - line = _quill$scroll$line2[0], - offset = _quill$scroll$line2[1]; - - var _quill$scroll$leaf = _this2.quill.scroll.leaf(range.index), - _quill$scroll$leaf2 = _slicedToArray(_quill$scroll$leaf, 2), - leafStart = _quill$scroll$leaf2[0], - offsetStart = _quill$scroll$leaf2[1]; - - var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.scroll.leaf(range.index + range.length), - _ref2 = _slicedToArray(_ref, 2), - leafEnd = _ref2[0], - offsetEnd = _ref2[1]; - - var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; - var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; - var curContext = { - collapsed: range.length === 0, - empty: range.length === 0 && line.length() <= 1, - format: _this2.quill.getFormat(range), - offset: offset, - prefix: prefixText, - suffix: suffixText - }; - var prevented = bindings.some(function (binding) { - if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; - if (binding.empty != null && binding.empty !== curContext.empty) return false; - if (binding.offset != null && binding.offset !== curContext.offset) return false; - if (Array.isArray(binding.format)) { - // any format is present - if (binding.format.every(function (name) { - return curContext.format[name] == null; - })) { - return false; - } - } else if (_typeof(binding.format) === 'object') { - // all formats must match - if (!Object.keys(binding.format).every(function (name) { - if (binding.format[name] === true) return curContext.format[name] != null; - if (binding.format[name] === false) return curContext.format[name] == null; - return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); - })) { - return false; - } - } - if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; - if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; - return binding.handler.call(_this2, range, curContext) !== true; - }); - if (prevented) { - evt.preventDefault(); - } - }); - } - }]); - - return Keyboard; - }(_module2.default); - - Keyboard.keys = { - BACKSPACE: 8, - TAB: 9, - ENTER: 13, - ESCAPE: 27, - LEFT: 37, - UP: 38, - RIGHT: 39, - DOWN: 40, - DELETE: 46 - }; - - Keyboard.DEFAULTS = { - bindings: { - 'bold': makeFormatHandler('bold'), - 'italic': makeFormatHandler('italic'), - 'underline': makeFormatHandler('underline'), - 'indent': { - // highlight tab or tab at beginning of list, indent or blockquote - key: Keyboard.keys.TAB, - format: ['blockquote', 'indent', 'list'], - handler: function handler(range, context) { - if (context.collapsed && context.offset !== 0) return true; - this.quill.format('indent', '+1', _quill2.default.sources.USER); - } - }, - 'outdent': { - key: Keyboard.keys.TAB, - shiftKey: true, - format: ['blockquote', 'indent', 'list'], - // highlight tab or tab at beginning of list, indent or blockquote - handler: function handler(range, context) { - if (context.collapsed && context.offset !== 0) return true; - this.quill.format('indent', '-1', _quill2.default.sources.USER); - } - }, - 'outdent backspace': { - key: Keyboard.keys.BACKSPACE, - collapsed: true, - format: ['blockquote', 'indent', 'list'], - offset: 0, - handler: function handler(range, context) { - if (context.format.indent != null) { - this.quill.format('indent', '-1', _quill2.default.sources.USER); - } else if (context.format.blockquote != null) { - this.quill.format('blockquote', false, _quill2.default.sources.USER); - } else if (context.format.list != null) { - this.quill.format('list', false, _quill2.default.sources.USER); - } - } - }, - 'indent code-block': makeCodeBlockHandler(true), - 'outdent code-block': makeCodeBlockHandler(false), - 'remove tab': { - key: Keyboard.keys.TAB, - shiftKey: true, - collapsed: true, - prefix: /\t$/, - handler: function handler(range) { - this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); - } - }, - 'tab': { - key: Keyboard.keys.TAB, - handler: function handler(range, context) { - if (!context.collapsed) { - this.quill.scroll.deleteAt(range.index, range.length); - } - this.quill.insertText(range.index, '\t', _quill2.default.sources.USER); - this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); - } - }, - 'list empty enter': { - key: Keyboard.keys.ENTER, - collapsed: true, - format: ['list'], - empty: true, - handler: function handler(range, context) { - this.quill.format('list', false, _quill2.default.sources.USER); - if (context.format.indent) { - this.quill.format('indent', false, _quill2.default.sources.USER); - } - } - }, - 'header enter': { - key: Keyboard.keys.ENTER, - collapsed: true, - format: ['header'], - suffix: /^$/, - handler: function handler(range) { - this.quill.scroll.insertAt(range.index, '\n'); - this.quill.formatText(range.index + 1, 1, 'header', false, _quill2.default.sources.USER); - this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); - this.quill.selection.scrollIntoView(); - } - }, - 'list autofill': { - key: ' ', - collapsed: true, - format: { list: false }, - prefix: /^(1\.|-)$/, - handler: function handler(range, context) { - var length = context.prefix.length; - this.quill.scroll.deleteAt(range.index - length, length); - this.quill.formatLine(range.index - length, 1, 'list', length === 1 ? 'bullet' : 'ordered', _quill2.default.sources.USER); - this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); - } - } - } - }; - - function handleBackspace(range, context) { - if (range.index === 0) return; - - var _quill$scroll$line3 = this.quill.scroll.line(range.index), - _quill$scroll$line4 = _slicedToArray(_quill$scroll$line3, 1), - line = _quill$scroll$line4[0]; - - var formats = {}; - if (context.offset === 0) { - var curFormats = line.formats(); - var prevFormats = this.quill.getFormat(range.index - 1, 1); - formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; - } - this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); - if (Object.keys(formats).length > 0) { - this.quill.formatLine(range.index - 1, 1, formats, _quill2.default.sources.USER); - } - this.quill.selection.scrollIntoView(); - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function handleDelete(range) { - if (range.index >= this.quill.getLength() - 1) return; - this.quill.deleteText(range.index, 1, _quill2.default.sources.USER); - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function handleDeleteRange(range) { - this.quill.deleteText(range, _quill2.default.sources.USER); - this.quill.setSelection(range.index, _quill2.default.sources.SILENT); - this.quill.selection.scrollIntoView(); - } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - function handleEnter(range, context) { - var _this3 = this; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - if (range.length > 0) { - this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change - } - var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { - if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { - lineFormats[format] = context.format[format]; - } - return lineFormats; - }, {}); - this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); - this.quill.selection.scrollIntoView(); - Object.keys(context.format).forEach(function (name) { - if (lineFormats[name] != null) return; - if (Array.isArray(context.format[name])) return; - if (name === 'link') return; - _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); - }); - } +var TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']]; - function makeCodeBlockHandler(indent) { - return { - key: Keyboard.keys.TAB, - shiftKey: !indent, - format: { 'code-block': true }, - handler: function handler(range) { - var CodeBlock = _parchment2.default.query('code-block'); - var index = range.index, - length = range.length; - - var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), - _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), - block = _quill$scroll$descend2[0], - offset = _quill$scroll$descend2[1]; - - if (block == null) return; - var scrollOffset = this.quill.scroll.offset(block); - var start = block.newlineIndex(offset, true) + 1; - var end = block.newlineIndex(scrollOffset + offset + length); - var lines = block.domNode.textContent.slice(start, end).split('\n'); - offset = 0; - lines.forEach(function (line, i) { - if (indent) { - block.insertAt(start + offset, CodeBlock.TAB); - offset += CodeBlock.TAB.length; - if (i === 0) { - index += CodeBlock.TAB.length; - } else { - length += CodeBlock.TAB.length; - } - } else if (line.startsWith(CodeBlock.TAB)) { - block.deleteAt(start + offset, CodeBlock.TAB.length); - offset -= CodeBlock.TAB.length; - if (i === 0) { - index -= CodeBlock.TAB.length; - } else { - length -= CodeBlock.TAB.length; - } - } - offset += line.length + 1; - }); - this.quill.update(_quill2.default.sources.USER); - this.quill.setSelection(index, length, _quill2.default.sources.SILENT); - } - }; - } +var SnowTheme = function (_BaseTheme) { + _inherits(SnowTheme, _BaseTheme); - function makeFormatHandler(format) { - return { - key: format[0].toUpperCase(), - shortKey: true, - handler: function handler(range, context) { - this.quill.format(format, !context.format[format], _quill2.default.sources.USER); - } - }; - } + function SnowTheme(quill, options) { + _classCallCheck(this, SnowTheme); - function normalize(binding) { - if (typeof binding === 'string' || typeof binding === 'number') { - return normalize({ key: binding }); - } - if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { - binding = (0, _clone2.default)(binding, false); - } - if (typeof binding.key === 'string') { - if (Keyboard.keys[binding.key.toUpperCase()] != null) { - binding.key = Keyboard.keys[binding.key.toUpperCase()]; - } else if (binding.key.length === 1) { - binding.key = binding.key.toUpperCase().charCodeAt(0); - } else { - return null; - } - } - return binding; - } + if (options.modules.toolbar != null && options.modules.toolbar.container == null) { + options.modules.toolbar.container = TOOLBAR_CONFIG; + } - exports.default = Keyboard; + var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options)); -/***/ }, -/* 57 */ -/***/ function(module, exports, __webpack_require__) { + _this.quill.container.classList.add('ql-snow'); + return _this; + } - 'use strict'; + _createClass(SnowTheme, [{ + key: 'extendToolbar', + value: function extendToolbar(toolbar) { + toolbar.container.classList.add('ql-snow'); + this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); + this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); + this.tooltip = new SnowTooltip(this.quill, this.options.bounds); + if (toolbar.container.querySelector('.ql-link')) { + this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) { + toolbar.handlers['link'].call(toolbar, !context.format.link); + }); + } + } + }]); - var _core = __webpack_require__(1); + return SnowTheme; +}(_base2.default); - var _core2 = _interopRequireDefault(_core); +SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + link: function link(value) { + if (value) { + var range = this.quill.getSelection(); + if (range == null || range.length == 0) return; + var preview = this.quill.getText(range); + if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) { + preview = 'mailto:' + preview; + } + var tooltip = this.quill.theme.tooltip; + tooltip.edit('link', preview); + } else { + this.quill.format('link', false); + } + } + } + } + } +}); - var _align = __webpack_require__(49); +var SnowTooltip = function (_BaseTooltip) { + _inherits(SnowTooltip, _BaseTooltip); - var _direction = __webpack_require__(52); + function SnowTooltip(quill, bounds) { + _classCallCheck(this, SnowTooltip); - var _indent = __webpack_require__(58); + var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds)); - var _blockquote = __webpack_require__(59); + _this2.preview = _this2.root.querySelector('a.ql-preview'); + return _this2; + } + + _createClass(SnowTooltip, [{ + key: 'listen', + value: function listen() { + var _this3 = this; + + _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this); + this.root.querySelector('a.ql-action').addEventListener('click', function (event) { + if (_this3.root.classList.contains('ql-editing')) { + _this3.save(); + } else { + _this3.edit('link', _this3.preview.textContent); + } + event.preventDefault(); + }); + this.root.querySelector('a.ql-remove').addEventListener('click', function (event) { + if (_this3.linkRange != null) { + var range = _this3.linkRange; + _this3.restoreFocus(); + _this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER); + delete _this3.linkRange; + } + event.preventDefault(); + _this3.hide(); + }); + this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) { + if (range == null) return; + if (range.length === 0 && source === _emitter2.default.sources.USER) { + var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + link = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (link != null) { + _this3.linkRange = new _selection.Range(range.index - offset, link.length()); + var preview = _link2.default.formats(link.domNode); + _this3.preview.textContent = preview; + _this3.preview.setAttribute('href', preview); + _this3.show(); + _this3.position(_this3.quill.getBounds(_this3.linkRange)); + return; + } + } else { + delete _this3.linkRange; + } + _this3.hide(); + }); + } + }, { + key: 'show', + value: function show() { + _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this); + this.root.removeAttribute('data-mode'); + } + }]); - var _blockquote2 = _interopRequireDefault(_blockquote); + return SnowTooltip; +}(_base.BaseTooltip); - var _header = __webpack_require__(60); +SnowTooltip.TEMPLATE = ['', '', '', ''].join(''); - var _header2 = _interopRequireDefault(_header); +exports.default = SnowTheme; - var _list = __webpack_require__(61); +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { - var _list2 = _interopRequireDefault(_list); +"use strict"; - var _background = __webpack_require__(50); - var _color = __webpack_require__(51); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _font = __webpack_require__(53); +var _core = __webpack_require__(29); - var _size = __webpack_require__(54); +var _core2 = _interopRequireDefault(_core); - var _bold = __webpack_require__(62); +var _align = __webpack_require__(36); - var _bold2 = _interopRequireDefault(_bold); +var _direction = __webpack_require__(38); - var _italic = __webpack_require__(63); +var _indent = __webpack_require__(64); - var _italic2 = _interopRequireDefault(_italic); +var _blockquote = __webpack_require__(65); - var _link = __webpack_require__(64); +var _blockquote2 = _interopRequireDefault(_blockquote); - var _link2 = _interopRequireDefault(_link); +var _header = __webpack_require__(66); - var _script = __webpack_require__(65); +var _header2 = _interopRequireDefault(_header); - var _script2 = _interopRequireDefault(_script); +var _list = __webpack_require__(67); - var _strike = __webpack_require__(66); +var _list2 = _interopRequireDefault(_list); - var _strike2 = _interopRequireDefault(_strike); +var _background = __webpack_require__(37); - var _underline = __webpack_require__(67); +var _color = __webpack_require__(26); - var _underline2 = _interopRequireDefault(_underline); +var _font = __webpack_require__(39); - var _image = __webpack_require__(68); +var _size = __webpack_require__(40); - var _image2 = _interopRequireDefault(_image); +var _bold = __webpack_require__(56); - var _video = __webpack_require__(69); +var _bold2 = _interopRequireDefault(_bold); - var _video2 = _interopRequireDefault(_video); +var _italic = __webpack_require__(68); - var _code = __webpack_require__(28); +var _italic2 = _interopRequireDefault(_italic); - var _code2 = _interopRequireDefault(_code); +var _link = __webpack_require__(27); - var _formula = __webpack_require__(70); +var _link2 = _interopRequireDefault(_link); - var _formula2 = _interopRequireDefault(_formula); +var _script = __webpack_require__(69); - var _syntax = __webpack_require__(71); +var _script2 = _interopRequireDefault(_script); - var _syntax2 = _interopRequireDefault(_syntax); +var _strike = __webpack_require__(70); - var _toolbar = __webpack_require__(72); +var _strike2 = _interopRequireDefault(_strike); - var _toolbar2 = _interopRequireDefault(_toolbar); +var _underline = __webpack_require__(71); - var _icons = __webpack_require__(73); +var _underline2 = _interopRequireDefault(_underline); - var _icons2 = _interopRequireDefault(_icons); +var _image = __webpack_require__(72); - var _picker = __webpack_require__(105); +var _image2 = _interopRequireDefault(_image); - var _picker2 = _interopRequireDefault(_picker); +var _video = __webpack_require__(73); - var _colorPicker = __webpack_require__(107); +var _video2 = _interopRequireDefault(_video); - var _colorPicker2 = _interopRequireDefault(_colorPicker); +var _code = __webpack_require__(13); - var _iconPicker = __webpack_require__(108); +var _code2 = _interopRequireDefault(_code); - var _iconPicker2 = _interopRequireDefault(_iconPicker); +var _formula = __webpack_require__(74); - var _tooltip = __webpack_require__(109); +var _formula2 = _interopRequireDefault(_formula); - var _tooltip2 = _interopRequireDefault(_tooltip); +var _syntax = __webpack_require__(75); - var _bubble = __webpack_require__(110); +var _syntax2 = _interopRequireDefault(_syntax); - var _bubble2 = _interopRequireDefault(_bubble); +var _toolbar = __webpack_require__(57); - var _snow = __webpack_require__(112); +var _toolbar2 = _interopRequireDefault(_toolbar); - var _snow2 = _interopRequireDefault(_snow); +var _icons = __webpack_require__(41); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _icons2 = _interopRequireDefault(_icons); - _core2.default.register({ - 'attributors/attribute/direction': _direction.DirectionAttribute, +var _picker = __webpack_require__(28); - 'attributors/class/align': _align.AlignClass, - 'attributors/class/background': _background.BackgroundClass, - 'attributors/class/color': _color.ColorClass, - 'attributors/class/direction': _direction.DirectionClass, - 'attributors/class/font': _font.FontClass, - 'attributors/class/size': _size.SizeClass, +var _picker2 = _interopRequireDefault(_picker); - 'attributors/style/align': _align.AlignStyle, - 'attributors/style/background': _background.BackgroundStyle, - 'attributors/style/color': _color.ColorStyle, - 'attributors/style/direction': _direction.DirectionStyle, - 'attributors/style/font': _font.FontStyle, - 'attributors/style/size': _size.SizeStyle - }, true); +var _colorPicker = __webpack_require__(59); - _core2.default.register({ - 'formats/align': _align.AlignClass, - 'formats/direction': _direction.DirectionClass, - 'formats/indent': _indent.IndentClass, +var _colorPicker2 = _interopRequireDefault(_colorPicker); - 'formats/background': _background.BackgroundStyle, - 'formats/color': _color.ColorStyle, - 'formats/font': _font.FontClass, - 'formats/size': _size.SizeClass, +var _iconPicker = __webpack_require__(60); - 'formats/blockquote': _blockquote2.default, - 'formats/code-block': _code2.default, - 'formats/header': _header2.default, - 'formats/list': _list2.default, +var _iconPicker2 = _interopRequireDefault(_iconPicker); - 'formats/bold': _bold2.default, - 'formats/code': _code.Code, - 'formats/italic': _italic2.default, - 'formats/link': _link2.default, - 'formats/script': _script2.default, - 'formats/strike': _strike2.default, - 'formats/underline': _underline2.default, +var _tooltip = __webpack_require__(61); - 'formats/image': _image2.default, - 'formats/video': _video2.default, +var _tooltip2 = _interopRequireDefault(_tooltip); - 'formats/list/item': _list.ListItem, +var _bubble = __webpack_require__(108); - 'modules/formula': _formula2.default, - 'modules/syntax': _syntax2.default, - 'modules/toolbar': _toolbar2.default, +var _bubble2 = _interopRequireDefault(_bubble); - 'themes/bubble': _bubble2.default, - 'themes/snow': _snow2.default, +var _snow = __webpack_require__(62); - 'ui/icons': _icons2.default, - 'ui/picker': _picker2.default, - 'ui/icon-picker': _iconPicker2.default, - 'ui/color-picker': _colorPicker2.default, - 'ui/tooltip': _tooltip2.default - }, true); +var _snow2 = _interopRequireDefault(_snow); - module.exports = _core2.default; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/***/ }, -/* 58 */ -/***/ function(module, exports, __webpack_require__) { +_core2.default.register({ + 'attributors/attribute/direction': _direction.DirectionAttribute, - 'use strict'; + 'attributors/class/align': _align.AlignClass, + 'attributors/class/background': _background.BackgroundClass, + 'attributors/class/color': _color.ColorClass, + 'attributors/class/direction': _direction.DirectionClass, + 'attributors/class/font': _font.FontClass, + 'attributors/class/size': _size.SizeClass, - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.IndentClass = undefined; + 'attributors/style/align': _align.AlignStyle, + 'attributors/style/background': _background.BackgroundStyle, + 'attributors/style/color': _color.ColorStyle, + 'attributors/style/direction': _direction.DirectionStyle, + 'attributors/style/font': _font.FontStyle, + 'attributors/style/size': _size.SizeStyle +}, true); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +_core2.default.register({ + 'formats/align': _align.AlignClass, + 'formats/direction': _direction.DirectionClass, + 'formats/indent': _indent.IndentClass, - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + 'formats/background': _background.BackgroundStyle, + 'formats/color': _color.ColorStyle, + 'formats/font': _font.FontClass, + 'formats/size': _size.SizeClass, - var _parchment = __webpack_require__(2); + 'formats/blockquote': _blockquote2.default, + 'formats/code-block': _code2.default, + 'formats/header': _header2.default, + 'formats/list': _list2.default, - var _parchment2 = _interopRequireDefault(_parchment); + 'formats/bold': _bold2.default, + 'formats/code': _code.Code, + 'formats/italic': _italic2.default, + 'formats/link': _link2.default, + 'formats/script': _script2.default, + 'formats/strike': _strike2.default, + 'formats/underline': _underline2.default, - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + 'formats/image': _image2.default, + 'formats/video': _video2.default, - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + 'formats/list/item': _list.ListItem, - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + 'modules/formula': _formula2.default, + 'modules/syntax': _syntax2.default, + 'modules/toolbar': _toolbar2.default, - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + 'themes/bubble': _bubble2.default, + 'themes/snow': _snow2.default, - var IdentAttributor = function (_Parchment$Attributor) { - _inherits(IdentAttributor, _Parchment$Attributor); + 'ui/icons': _icons2.default, + 'ui/picker': _picker2.default, + 'ui/icon-picker': _iconPicker2.default, + 'ui/color-picker': _colorPicker2.default, + 'ui/tooltip': _tooltip2.default +}, true); - function IdentAttributor() { - _classCallCheck(this, IdentAttributor); +exports.default = _core2.default; - return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments)); - } +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { - _createClass(IdentAttributor, [{ - key: 'add', - value: function add(node, value) { - if (value === '+1' || value === '-1') { - var indent = this.value(node) || 0; - value = value === '+1' ? indent + 1 : indent - 1; - } - if (value === 0) { - this.remove(node); - return true; - } else { - return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value); - } - } - }, { - key: 'value', - value: function value(node) { - return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN - } - }]); +"use strict"; - return IdentAttributor; - }(_parchment2.default.Attributor.Class); - var IndentClass = new IdentAttributor('indent', 'ql-indent', { - scope: _parchment2.default.Scope.BLOCK, - whitelist: [1, 2, 3, 4, 5, 6, 7, 8] - }); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.IndentClass = undefined; - exports.IndentClass = IndentClass; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -/***/ }, -/* 59 */ -/***/ function(module, exports, __webpack_require__) { +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - 'use strict'; +var _parchment = __webpack_require__(0); - Object.defineProperty(exports, "__esModule", { - value: true - }); +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var IdentAttributor = function (_Parchment$Attributor) { + _inherits(IdentAttributor, _Parchment$Attributor); + + function IdentAttributor() { + _classCallCheck(this, IdentAttributor); + + return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments)); + } + + _createClass(IdentAttributor, [{ + key: 'add', + value: function add(node, value) { + if (value === '+1' || value === '-1') { + var indent = this.value(node) || 0; + value = value === '+1' ? indent + 1 : indent - 1; + } + if (value === 0) { + this.remove(node); + return true; + } else { + return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value); + } + } + }, { + key: 'canAdd', + value: function canAdd(node, value) { + return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value)); + } + }, { + key: 'value', + value: function value(node) { + return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN + } + }]); + + return IdentAttributor; +}(_parchment2.default.Attributor.Class); + +var IndentClass = new IdentAttributor('indent', 'ql-indent', { + scope: _parchment2.default.Scope.BLOCK, + whitelist: [1, 2, 3, 4, 5, 6, 7, 8] +}); - var _block = __webpack_require__(29); +exports.IndentClass = IndentClass; - var _block2 = _interopRequireDefault(_block); +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +"use strict"; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +Object.defineProperty(exports, "__esModule", { + value: true +}); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _block = __webpack_require__(4); - var Blockquote = function (_Block) { - _inherits(Blockquote, _Block); +var _block2 = _interopRequireDefault(_block); - function Blockquote() { - _classCallCheck(this, Blockquote); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments)); - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - return Blockquote; - }(_block2.default); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - Blockquote.blotName = 'blockquote'; - Blockquote.tagName = 'blockquote'; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - exports.default = Blockquote; +var Blockquote = function (_Block) { + _inherits(Blockquote, _Block); -/***/ }, -/* 60 */ -/***/ function(module, exports, __webpack_require__) { + function Blockquote() { + _classCallCheck(this, Blockquote); - 'use strict'; + return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments)); + } - Object.defineProperty(exports, "__esModule", { - value: true - }); + return Blockquote; +}(_block2.default); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +Blockquote.blotName = 'blockquote'; +Blockquote.tagName = 'blockquote'; - var _block = __webpack_require__(29); +exports.default = Blockquote; - var _block2 = _interopRequireDefault(_block); +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +"use strict"; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +Object.defineProperty(exports, "__esModule", { + value: true +}); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var Header = function (_Block) { - _inherits(Header, _Block); +var _block = __webpack_require__(4); - function Header() { - _classCallCheck(this, Header); +var _block2 = _interopRequireDefault(_block); - return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments)); - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - _createClass(Header, null, [{ - key: 'formats', - value: function formats(domNode) { - return this.tagName.indexOf(domNode.tagName) + 1; - } - }]); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - return Header; - }(_block2.default); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - Header.blotName = 'header'; - Header.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6']; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - exports.default = Header; +var Header = function (_Block) { + _inherits(Header, _Block); -/***/ }, -/* 61 */ -/***/ function(module, exports, __webpack_require__) { + function Header() { + _classCallCheck(this, Header); - 'use strict'; + return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments)); + } - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.ListItem = undefined; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _block = __webpack_require__(29); - - var _block2 = _interopRequireDefault(_block); - - var _container = __webpack_require__(46); - - var _container2 = _interopRequireDefault(_container); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var ListItem = function (_Block) { - _inherits(ListItem, _Block); - - function ListItem() { - _classCallCheck(this, ListItem); - - return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments)); - } - - _createClass(ListItem, [{ - key: 'format', - value: function format(name, value) { - if (name === List.blotName && !value) { - this.replaceWith(_parchment2.default.create(this.statics.scope)); - } else { - _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value); - } - } - }, { - key: 'remove', - value: function remove() { - if (this.prev == null && this.next == null) { - this.parent.remove(); - } else { - _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this); - } - } - }, { - key: 'replaceWith', - value: function replaceWith(name, value) { - this.parent.isolate(this.offset(this.parent), this.length()); - if (name === this.parent.statics.blotName) { - this.parent.replaceWith(name, value); - return this; - } else { - this.parent.unwrap(); - return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value); - } - } - }], [{ - key: 'formats', - value: function formats(domNode) { - return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode); - } - }]); - - return ListItem; - }(_block2.default); - - ListItem.blotName = 'list-item'; - ListItem.tagName = 'LI'; - - var List = function (_Container) { - _inherits(List, _Container); - - function List() { - _classCallCheck(this, List); - - return _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).apply(this, arguments)); - } - - _createClass(List, [{ - key: 'format', - value: function format(name, value) { - if (this.children.length > 0) { - this.children.tail.format(name, value); - } - } - }, { - key: 'formats', - value: function formats() { - // We don't inherit from FormatBlot - return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode)); - } - }, { - key: 'insertBefore', - value: function insertBefore(blot, ref) { - if (blot instanceof ListItem) { - _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref); - } else { - var index = ref == null ? this.length() : ref.offset(this); - var after = this.split(index); - after.parent.insertBefore(blot, after); - } - } - }, { - key: 'optimize', - value: function optimize() { - _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this); - var next = this.next; - if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName) { - next.moveChildren(this); - next.remove(); - } - } - }, { - key: 'replace', - value: function replace(target) { - if (target.statics.blotName !== this.statics.blotName) { - var item = _parchment2.default.create(this.statics.defaultChild); - target.moveChildren(item); - this.appendChild(item); - } - _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target); - } - }], [{ - key: 'create', - value: function create(value) { - if (value === 'ordered') { - value = 'OL'; - } else if (value === 'bullet') { - value = 'UL'; - } - return _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, value); - } - }, { - key: 'formats', - value: function formats(domNode) { - if (domNode.tagName === 'OL') return 'ordered'; - if (domNode.tagName === 'UL') return 'bullet'; - return undefined; - } - }]); - - return List; - }(_container2.default); - - List.blotName = 'list'; - List.scope = _parchment2.default.Scope.BLOCK_BLOT; - List.tagName = ['OL', 'UL']; - List.defaultChild = 'list-item'; - List.allowedChildren = [ListItem]; + _createClass(Header, null, [{ + key: 'formats', + value: function formats(domNode) { + return this.tagName.indexOf(domNode.tagName) + 1; + } + }]); - exports.ListItem = ListItem; - exports.default = List; + return Header; +}(_block2.default); -/***/ }, -/* 62 */ -/***/ function(module, exports, __webpack_require__) { +Header.blotName = 'header'; +Header.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6']; - 'use strict'; +exports.default = Header; - Object.defineProperty(exports, "__esModule", { - value: true - }); +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.ListItem = undefined; - var _inline = __webpack_require__(33); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var _inline2 = _interopRequireDefault(_inline); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _parchment = __webpack_require__(0); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _container = __webpack_require__(25); + +var _container2 = _interopRequireDefault(_container); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ListItem = function (_Block) { + _inherits(ListItem, _Block); + + function ListItem() { + _classCallCheck(this, ListItem); + + return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments)); + } + + _createClass(ListItem, [{ + key: 'format', + value: function format(name, value) { + if (name === List.blotName && !value) { + this.replaceWith(_parchment2.default.create(this.statics.scope)); + } else { + _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value); + } + } + }, { + key: 'remove', + value: function remove() { + if (this.prev == null && this.next == null) { + this.parent.remove(); + } else { + _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this); + } + } + }, { + key: 'replaceWith', + value: function replaceWith(name, value) { + this.parent.isolate(this.offset(this.parent), this.length()); + if (name === this.parent.statics.blotName) { + this.parent.replaceWith(name, value); + return this; + } else { + this.parent.unwrap(); + return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value); + } + } + }], [{ + key: 'formats', + value: function formats(domNode) { + return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode); + } + }]); + + return ListItem; +}(_block2.default); + +ListItem.blotName = 'list-item'; +ListItem.tagName = 'LI'; + +var List = function (_Container) { + _inherits(List, _Container); + + _createClass(List, null, [{ + key: 'create', + value: function create(value) { + var tagName = value === 'ordered' ? 'OL' : 'UL'; + var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName); + if (value === 'checked' || value === 'unchecked') { + node.setAttribute('data-checked', value === 'checked'); + } + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + if (domNode.tagName === 'OL') return 'ordered'; + if (domNode.tagName === 'UL') { + if (domNode.hasAttribute('data-checked')) { + return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked'; + } else { + return 'bullet'; + } + } + return undefined; + } + }]); + + function List(domNode) { + _classCallCheck(this, List); + + var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode)); + + var listEventHandler = function listEventHandler(e) { + if (e.target.parentNode !== domNode) return; + var format = _this2.statics.formats(domNode); + var blot = _parchment2.default.find(e.target); + if (format === 'checked') { + blot.format('list', 'unchecked'); + } else if (format === 'unchecked') { + blot.format('list', 'checked'); + } + }; + + domNode.addEventListener('touchstart', listEventHandler); + domNode.addEventListener('mousedown', listEventHandler); + return _this2; + } + + _createClass(List, [{ + key: 'format', + value: function format(name, value) { + if (this.children.length > 0) { + this.children.tail.format(name, value); + } + } + }, { + key: 'formats', + value: function formats() { + // We don't inherit from FormatBlot + return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode)); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot instanceof ListItem) { + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref); + } else { + var index = ref == null ? this.length() : ref.offset(this); + var after = this.split(index); + after.parent.insertBefore(blot, after); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) { + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + if (target.statics.blotName !== this.statics.blotName) { + var item = _parchment2.default.create(this.statics.defaultChild); + target.moveChildren(item); + this.appendChild(item); + } + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target); + } + }]); + + return List; +}(_container2.default); + +List.blotName = 'list'; +List.scope = _parchment2.default.Scope.BLOCK_BLOT; +List.tagName = ['OL', 'UL']; +List.defaultChild = 'list-item'; +List.allowedChildren = [ListItem]; - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +exports.ListItem = ListItem; +exports.default = List; - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { - var Bold = function (_Inline) { - _inherits(Bold, _Inline); +"use strict"; - function Bold() { - _classCallCheck(this, Bold); - return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments)); - } +Object.defineProperty(exports, "__esModule", { + value: true +}); - _createClass(Bold, [{ - key: 'optimize', - value: function optimize() { - _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this); - if (this.domNode.tagName !== this.statics.tagName[0]) { - this.replaceWith(this.statics.blotName); - } - } - }], [{ - key: 'create', - value: function create() { - return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this); - } - }, { - key: 'formats', - value: function formats() { - return true; - } - }]); +var _bold = __webpack_require__(56); - return Bold; - }(_inline2.default); +var _bold2 = _interopRequireDefault(_bold); - Bold.blotName = 'bold'; - Bold.tagName = ['STRONG', 'B']; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - exports.default = Bold; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -/***/ }, -/* 63 */ -/***/ function(module, exports, __webpack_require__) { +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - 'use strict'; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - Object.defineProperty(exports, "__esModule", { - value: true - }); +var Italic = function (_Bold) { + _inherits(Italic, _Bold); - var _bold = __webpack_require__(62); + function Italic() { + _classCallCheck(this, Italic); - var _bold2 = _interopRequireDefault(_bold); + return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments)); + } - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + return Italic; +}(_bold2.default); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +Italic.blotName = 'italic'; +Italic.tagName = ['EM', 'I']; - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +exports.default = Italic; - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { - var Italic = function (_Bold) { - _inherits(Italic, _Bold); +"use strict"; - function Italic() { - _classCallCheck(this, Italic); - return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments)); - } +Object.defineProperty(exports, "__esModule", { + value: true +}); - return Italic; - }(_bold2.default); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - Italic.blotName = 'italic'; - Italic.tagName = ['EM', 'I']; +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - exports.default = Italic; +var _inline = __webpack_require__(6); -/***/ }, -/* 64 */ -/***/ function(module, exports, __webpack_require__) { +var _inline2 = _interopRequireDefault(_inline); - 'use strict'; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.sanitize = exports.default = undefined; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _inline = __webpack_require__(33); - - var _inline2 = _interopRequireDefault(_inline); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var Link = function (_Inline) { - _inherits(Link, _Inline); - - function Link() { - _classCallCheck(this, Link); - - return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments)); - } - - _createClass(Link, [{ - key: 'format', - value: function format(name, value) { - if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value); - value = this.constructor.sanitize(value); - this.domNode.setAttribute('href', value); - } - }], [{ - key: 'create', - value: function create(value) { - var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value); - value = this.sanitize(value); - node.setAttribute('href', value); - node.setAttribute('target', '_blank'); - return node; - } - }, { - key: 'formats', - value: function formats(domNode) { - return domNode.getAttribute('href'); - } - }, { - key: 'sanitize', - value: function sanitize(url) { - return _sanitize(url, ['http', 'https', 'mailto']) ? url : this.SANITIZED_URL; - } - }]); - - return Link; - }(_inline2.default); - - Link.blotName = 'link'; - Link.tagName = 'A'; - Link.SANITIZED_URL = 'about:blank'; - - function _sanitize(url, protocols) { - var anchor = document.createElement('a'); - anchor.href = url; - var protocol = anchor.href.slice(0, anchor.href.indexOf(':')); - return protocols.indexOf(protocol) > -1; - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - exports.default = Link; - exports.sanitize = _sanitize; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -/***/ }, -/* 65 */ -/***/ function(module, exports, __webpack_require__) { +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - 'use strict'; +var Script = function (_Inline) { + _inherits(Script, _Inline); - Object.defineProperty(exports, "__esModule", { - value: true - }); + function Script() { + _classCallCheck(this, Script); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments)); + } - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + _createClass(Script, null, [{ + key: 'create', + value: function create(value) { + if (value === 'super') { + return document.createElement('sup'); + } else if (value === 'sub') { + return document.createElement('sub'); + } else { + return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value); + } + } + }, { + key: 'formats', + value: function formats(domNode) { + if (domNode.tagName === 'SUB') return 'sub'; + if (domNode.tagName === 'SUP') return 'super'; + return undefined; + } + }]); - var _inline = __webpack_require__(33); + return Script; +}(_inline2.default); - var _inline2 = _interopRequireDefault(_inline); +Script.blotName = 'script'; +Script.tagName = ['SUB', 'SUP']; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +exports.default = Script; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +"use strict"; - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var Script = function (_Inline) { - _inherits(Script, _Inline); +Object.defineProperty(exports, "__esModule", { + value: true +}); - function Script() { - _classCallCheck(this, Script); +var _inline = __webpack_require__(6); - return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments)); - } +var _inline2 = _interopRequireDefault(_inline); - _createClass(Script, null, [{ - key: 'create', - value: function create(value) { - if (value === 'super') { - return document.createElement('sup'); - } else if (value === 'sub') { - return document.createElement('sub'); - } else { - return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value); - } - } - }, { - key: 'formats', - value: function formats(domNode) { - if (domNode.tagName === 'SUB') return 'sub'; - if (domNode.tagName === 'SUP') return 'super'; - return undefined; - } - }]); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - return Script; - }(_inline2.default); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - Script.blotName = 'script'; - Script.tagName = ['SUB', 'SUP']; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - exports.default = Script; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -/***/ }, -/* 66 */ -/***/ function(module, exports, __webpack_require__) { +var Strike = function (_Inline) { + _inherits(Strike, _Inline); - 'use strict'; + function Strike() { + _classCallCheck(this, Strike); - Object.defineProperty(exports, "__esModule", { - value: true - }); + return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments)); + } - var _inline = __webpack_require__(33); + return Strike; +}(_inline2.default); - var _inline2 = _interopRequireDefault(_inline); +Strike.blotName = 'strike'; +Strike.tagName = 'S'; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +exports.default = Strike; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +"use strict"; - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var Strike = function (_Inline) { - _inherits(Strike, _Inline); +Object.defineProperty(exports, "__esModule", { + value: true +}); - function Strike() { - _classCallCheck(this, Strike); +var _inline = __webpack_require__(6); - return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments)); - } +var _inline2 = _interopRequireDefault(_inline); - return Strike; - }(_inline2.default); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - Strike.blotName = 'strike'; - Strike.tagName = 'S'; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - exports.default = Strike; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -/***/ }, -/* 67 */ -/***/ function(module, exports, __webpack_require__) { +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - 'use strict'; +var Underline = function (_Inline) { + _inherits(Underline, _Inline); - Object.defineProperty(exports, "__esModule", { - value: true - }); + function Underline() { + _classCallCheck(this, Underline); - var _inline = __webpack_require__(33); + return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments)); + } - var _inline2 = _interopRequireDefault(_inline); + return Underline; +}(_inline2.default); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +Underline.blotName = 'underline'; +Underline.tagName = 'U'; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +exports.default = Underline; - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +"use strict"; - var Underline = function (_Inline) { - _inherits(Underline, _Inline); - function Underline() { - _classCallCheck(this, Underline); +Object.defineProperty(exports, "__esModule", { + value: true +}); - return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments)); - } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - return Underline; - }(_inline2.default); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - Underline.blotName = 'underline'; - Underline.tagName = 'U'; +var _parchment = __webpack_require__(0); - exports.default = Underline; +var _parchment2 = _interopRequireDefault(_parchment); -/***/ }, -/* 68 */ -/***/ function(module, exports, __webpack_require__) { +var _link = __webpack_require__(27); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ATTRIBUTES = ['alt', 'height', 'width']; + +var Image = function (_Parchment$Embed) { + _inherits(Image, _Parchment$Embed); + + function Image() { + _classCallCheck(this, Image); + + return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments)); + } + + _createClass(Image, [{ + key: 'format', + value: function format(name, value) { + if (ATTRIBUTES.indexOf(name) > -1) { + if (value) { + this.domNode.setAttribute(name, value); + } else { + this.domNode.removeAttribute(name); + } + } else { + _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value); + } + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value); + if (typeof value === 'string') { + node.setAttribute('src', this.sanitize(value)); + } + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return ATTRIBUTES.reduce(function (formats, attribute) { + if (domNode.hasAttribute(attribute)) { + formats[attribute] = domNode.getAttribute(attribute); + } + return formats; + }, {}); + } + }, { + key: 'match', + value: function match(url) { + return (/\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url) + ); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0'; + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('src'); + } + }]); + + return Image; +}(_parchment2.default.Embed); - 'use strict'; +Image.blotName = 'image'; +Image.tagName = 'IMG'; - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _embed = __webpack_require__(32); - - var _embed2 = _interopRequireDefault(_embed); - - var _link = __webpack_require__(64); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var ATTRIBUTES = ['alt', 'height', 'width']; - - var Image = function (_Embed) { - _inherits(Image, _Embed); - - function Image() { - _classCallCheck(this, Image); - - return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments)); - } - - _createClass(Image, [{ - key: 'format', - value: function format(name, value) { - if (ATTRIBUTES.indexOf(name) > -1) { - if (value) { - this.domNode.setAttribute(name, value); - } else { - this.domNode.removeAttribute(name); - } - } else { - _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value); - } - } - }], [{ - key: 'create', - value: function create(value) { - var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value); - if (typeof value === 'string') { - node.setAttribute('src', this.sanitize(value)); - } - return node; - } - }, { - key: 'formats', - value: function formats(domNode) { - return ATTRIBUTES.reduce(function (formats, attribute) { - if (domNode.hasAttribute(attribute)) { - formats[attribute] = domNode.getAttribute(attribute); - } - return formats; - }, {}); - } - }, { - key: 'match', - value: function match(url) { - return (/\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url) - ); - } - }, { - key: 'sanitize', - value: function sanitize(url) { - return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0'; - } - }, { - key: 'value', - value: function value(domNode) { - return domNode.getAttribute('src'); - } - }]); - - return Image; - }(_embed2.default); +exports.default = Image; - Image.blotName = 'image'; - Image.tagName = 'IMG'; +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { - exports.default = Image; +"use strict"; -/***/ }, -/* 69 */ -/***/ function(module, exports, __webpack_require__) { - 'use strict'; +Object.defineProperty(exports, "__esModule", { + value: true +}); - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _block = __webpack_require__(29); - - var _link = __webpack_require__(64); - - var _link2 = _interopRequireDefault(_link); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var ATTRIBUTES = ['height', 'width']; - - var Video = function (_BlockEmbed) { - _inherits(Video, _BlockEmbed); - - function Video() { - _classCallCheck(this, Video); - - return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments)); - } - - _createClass(Video, [{ - key: 'format', - value: function format(name, value) { - if (ATTRIBUTES.indexOf(name) > -1) { - if (value) { - this.domNode.setAttribute(name, value); - } else { - this.domNode.removeAttribute(name); - } - } else { - _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value); - } - } - }], [{ - key: 'create', - value: function create(value) { - var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value); - node.setAttribute('frameborder', '0'); - node.setAttribute('allowfullscreen', true); - node.setAttribute('src', this.sanitize(value)); - return node; - } - }, { - key: 'formats', - value: function formats(domNode) { - return ATTRIBUTES.reduce(function (formats, attribute) { - if (domNode.hasAttribute(attribute)) { - formats[attribute] = domNode.getAttribute(attribute); - } - return formats; - }, {}); - } - }, { - key: 'sanitize', - value: function sanitize(url) { - return _link2.default.sanitize(url); - } - }, { - key: 'value', - value: function value(domNode) { - return domNode.getAttribute('src'); - } - }]); - - return Video; - }(_block.BlockEmbed); - - Video.blotName = 'video'; - Video.className = 'ql-video'; - Video.tagName = 'IFRAME'; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - exports.default = Video; +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -/***/ }, -/* 70 */ -/***/ function(module, exports, __webpack_require__) { +var _block = __webpack_require__(4); - 'use strict'; +var _link = __webpack_require__(27); - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.FormulaBlot = undefined; +var _link2 = _interopRequireDefault(_link); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ATTRIBUTES = ['height', 'width']; + +var Video = function (_BlockEmbed) { + _inherits(Video, _BlockEmbed); + + function Video() { + _classCallCheck(this, Video); + + return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments)); + } + + _createClass(Video, [{ + key: 'format', + value: function format(name, value) { + if (ATTRIBUTES.indexOf(name) > -1) { + if (value) { + this.domNode.setAttribute(name, value); + } else { + this.domNode.removeAttribute(name); + } + } else { + _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value); + } + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value); + node.setAttribute('frameborder', '0'); + node.setAttribute('allowfullscreen', true); + node.setAttribute('src', this.sanitize(value)); + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return ATTRIBUTES.reduce(function (formats, attribute) { + if (domNode.hasAttribute(attribute)) { + formats[attribute] = domNode.getAttribute(attribute); + } + return formats; + }, {}); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return _link2.default.sanitize(url); + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('src'); + } + }]); + + return Video; +}(_block.BlockEmbed); + +Video.blotName = 'video'; +Video.className = 'ql-video'; +Video.tagName = 'IFRAME'; - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +exports.default = Video; - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { - var _embed = __webpack_require__(32); +"use strict"; - var _embed2 = _interopRequireDefault(_embed); - var _quill = __webpack_require__(18); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.FormulaBlot = undefined; - var _quill2 = _interopRequireDefault(_quill); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _embed = __webpack_require__(35); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var _embed2 = _interopRequireDefault(_embed); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _quill = __webpack_require__(5); - var FormulaBlot = function (_Embed) { - _inherits(FormulaBlot, _Embed); +var _quill2 = _interopRequireDefault(_quill); - function FormulaBlot() { - _classCallCheck(this, FormulaBlot); +var _module = __webpack_require__(9); - return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments)); - } +var _module2 = _interopRequireDefault(_module); - _createClass(FormulaBlot, [{ - key: 'index', - value: function index() { - return 1; - } - }], [{ - key: 'create', - value: function create(value) { - var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value); - if (typeof value === 'string') { - window.katex.render(value, node); - node.setAttribute('data-value', value); - } - node.setAttribute('contenteditable', false); - return node; - } - }, { - key: 'value', - value: function value(domNode) { - return domNode.getAttribute('data-value'); - } - }]); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - return FormulaBlot; - }(_embed2.default); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - FormulaBlot.blotName = 'formula'; - FormulaBlot.className = 'ql-formula'; - FormulaBlot.tagName = 'SPAN'; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - function Formula() { - if (window.katex == null) { - throw new Error('Formula module requires KaTeX.'); - } - _quill2.default.register(FormulaBlot, true); - } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - exports.FormulaBlot = FormulaBlot; - exports.default = Formula; +var FormulaBlot = function (_Embed) { + _inherits(FormulaBlot, _Embed); -/***/ }, -/* 71 */ -/***/ function(module, exports, __webpack_require__) { + function FormulaBlot() { + _classCallCheck(this, FormulaBlot); - 'use strict'; + return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments)); + } - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.CodeToken = exports.CodeBlock = undefined; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _quill = __webpack_require__(18); - - var _quill2 = _interopRequireDefault(_quill); - - var _module = __webpack_require__(43); - - var _module2 = _interopRequireDefault(_module); - - var _code = __webpack_require__(28); - - var _code2 = _interopRequireDefault(_code); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var SyntaxCodeBlock = function (_CodeBlock) { - _inherits(SyntaxCodeBlock, _CodeBlock); - - function SyntaxCodeBlock() { - _classCallCheck(this, SyntaxCodeBlock); - - return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments)); - } - - _createClass(SyntaxCodeBlock, [{ - key: 'replaceWith', - value: function replaceWith(block) { - this.domNode.textContent = this.domNode.textContent; - this.attach(); - _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block); - } - }, { - key: 'highlight', - value: function highlight(_highlight) { - if (this.cachedHTML !== this.domNode.innerHTML) { - var text = this.domNode.textContent; - if (text.trim().length > 0 || this.cachedHTML == null) { - this.domNode.innerHTML = _highlight(text); - this.attach(); - } - this.cachedHTML = this.domNode.innerHTML; - } - } - }]); - - return SyntaxCodeBlock; - }(_code2.default); - - SyntaxCodeBlock.className = 'ql-syntax'; - - var CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', { - scope: _parchment2.default.Scope.INLINE - }); - - var Syntax = function (_Module) { - _inherits(Syntax, _Module); - - function Syntax(quill, options) { - _classCallCheck(this, Syntax); - - var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options)); - - if (typeof _this2.options.highlight !== 'function') { - throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.'); - } - _quill2.default.register(CodeToken, true); - _quill2.default.register(SyntaxCodeBlock, true); - var timer = null; - _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { - if (timer != null) return; - timer = setTimeout(function () { - _this2.highlight(); - timer = null; - }, 100); - }); - _this2.highlight(); - return _this2; - } - - _createClass(Syntax, [{ - key: 'highlight', - value: function highlight() { - var _this3 = this; - - if (this.quill.selection.composing) return; - var range = this.quill.getSelection(); - this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) { - code.highlight(_this3.options.highlight); - }); - this.quill.update(_quill2.default.sources.SILENT); - if (range != null) { - this.quill.setSelection(range, _quill2.default.sources.SILENT); - } - } - }]); - - return Syntax; - }(_module2.default); - - Syntax.DEFAULTS = { - highlight: function () { - if (window.hljs == null) return null; - return function (text) { - var result = window.hljs.highlightAuto(text); - return result.value; - }; - }() - }; - - exports.CodeBlock = SyntaxCodeBlock; - exports.CodeToken = CodeToken; - exports.default = Syntax; + _createClass(FormulaBlot, null, [{ + key: 'create', + value: function create(value) { + var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value); + if (typeof value === 'string') { + window.katex.render(value, node, { + throwOnError: false, + errorColor: '#f00' + }); + node.setAttribute('data-value', value); + } + return node; + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('data-value'); + } + }]); -/***/ }, -/* 72 */ -/***/ function(module, exports, __webpack_require__) { + return FormulaBlot; +}(_embed2.default); - 'use strict'; +FormulaBlot.blotName = 'formula'; +FormulaBlot.className = 'ql-formula'; +FormulaBlot.tagName = 'SPAN'; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.addControls = exports.default = undefined; - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _quillDelta = __webpack_require__(20); - - var _quillDelta2 = _interopRequireDefault(_quillDelta); - - var _parchment = __webpack_require__(2); - - var _parchment2 = _interopRequireDefault(_parchment); - - var _quill = __webpack_require__(18); - - var _quill2 = _interopRequireDefault(_quill); - - var _logger = __webpack_require__(38); - - var _logger2 = _interopRequireDefault(_logger); - - var _module = __webpack_require__(43); - - var _module2 = _interopRequireDefault(_module); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var debug = (0, _logger2.default)('quill:toolbar'); - - var Toolbar = function (_Module) { - _inherits(Toolbar, _Module); - - function Toolbar(quill, options) { - _classCallCheck(this, Toolbar); - - var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options)); - - if (Array.isArray(_this.options.container)) { - var container = document.createElement('div'); - addControls(container, _this.options.container); - quill.container.parentNode.insertBefore(container, quill.container); - _this.container = container; - } else if (typeof _this.options.container === 'string') { - _this.container = document.querySelector(_this.options.container); - } else { - _this.container = _this.options.container; - } - if (!(_this.container instanceof HTMLElement)) { - var _ret; - - return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret); - } - _this.container.classList.add('ql-toolbar'); - _this.controls = []; - _this.handlers = {}; - Object.keys(_this.options.handlers).forEach(function (format) { - _this.addHandler(format, _this.options.handlers[format]); - }); - [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) { - _this.attach(input); - }); - _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) { - if (type === _quill2.default.events.SELECTION_CHANGE) { - _this.update(range); - } - }); - _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { - var _this$quill$selection = _this.quill.selection.getRange(), - _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), - range = _this$quill$selection2[0]; // quill.getSelection triggers update - - - _this.update(range); - }); - return _this; - } - - _createClass(Toolbar, [{ - key: 'addHandler', - value: function addHandler(format, handler) { - this.handlers[format] = handler; - } - }, { - key: 'attach', - value: function attach(input) { - var _this2 = this; - - var format = [].find.call(input.classList, function (className) { - return className.indexOf('ql-') === 0; - }); - if (!format) return; - format = format.slice('ql-'.length); - if (input.tagName === 'BUTTON') { - input.setAttribute('type', 'button'); - } - if (this.handlers[format] == null) { - if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) { - debug.warn('ignoring attaching to disabled format', format, input); - return; - } - if (_parchment2.default.query(format) == null) { - debug.warn('ignoring attaching to nonexistent format', format, input); - return; - } - } - var eventName = input.tagName === 'SELECT' ? 'change' : 'click'; - input.addEventListener(eventName, function (e) { - var value = void 0; - if (input.tagName === 'SELECT') { - if (input.selectedIndex < 0) return; - var selected = input.options[input.selectedIndex]; - if (selected.hasAttribute('selected')) { - value = false; - } else { - value = selected.value || false; - } - } else { - if (input.classList.contains('ql-active')) { - value = false; - } else { - value = input.value || !input.hasAttribute('value'); - } - e.preventDefault(); - } - _this2.quill.focus(); - - var _quill$selection$getR = _this2.quill.selection.getRange(), - _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), - range = _quill$selection$getR2[0]; - - if (_this2.handlers[format] != null) { - _this2.handlers[format].call(_this2, value); - } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) { - value = prompt('Enter ' + format); - if (!value) return; - _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER); - } else { - _this2.quill.format(format, value, _quill2.default.sources.USER); - } - _this2.update(range); - }); - // TODO use weakmap - this.controls.push([format, input]); - } - }, { - key: 'update', - value: function update(range) { - var formats = range == null ? {} : this.quill.getFormat(range); - this.controls.forEach(function (pair) { - var _pair = _slicedToArray(pair, 2), - format = _pair[0], - input = _pair[1]; - - if (input.tagName === 'SELECT') { - var option = void 0; - if (range == null) { - option = null; - } else if (formats[format] == null) { - option = input.querySelector('option[selected]'); - } else if (!Array.isArray(formats[format])) { - var value = formats[format]; - if (typeof value === 'string') { - value = value.replace(/\"/g, '\\"'); - } - option = input.querySelector('option[value="' + value + '"]'); - } - if (option == null) { - input.value = ''; // TODO make configurable? - input.selectedIndex = -1; - } else { - option.selected = true; - } - } else { - if (range == null) { - input.classList.remove('ql-active'); - } else if (input.hasAttribute('value')) { - // both being null should match (default values) - // '1' should match with 1 (headers) - var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value'); - input.classList.toggle('ql-active', isActive); - } else { - input.classList.toggle('ql-active', formats[format] != null); - } - } - }); - } - }]); - - return Toolbar; - }(_module2.default); - - Toolbar.DEFAULTS = {}; - - function addButton(container, format, value) { - var input = document.createElement('button'); - input.setAttribute('type', 'button'); - input.classList.add('ql-' + format); - if (value != null) { - input.value = value; - } - container.appendChild(input); - } +var Formula = function (_Module) { + _inherits(Formula, _Module); - function addControls(container, groups) { - if (!Array.isArray(groups[0])) { - groups = [groups]; - } - groups.forEach(function (controls) { - var group = document.createElement('span'); - group.classList.add('ql-formats'); - controls.forEach(function (control) { - if (typeof control === 'string') { - addButton(group, control); - } else { - var format = Object.keys(control)[0]; - var value = control[format]; - if (Array.isArray(value)) { - addSelect(group, format, value); - } else { - addButton(group, format, value); - } - } - }); - container.appendChild(group); - }); - } + _createClass(Formula, null, [{ + key: 'register', + value: function register() { + _quill2.default.register(FormulaBlot, true); + } + }]); - function addSelect(container, format, values) { - var input = document.createElement('select'); - input.classList.add('ql-' + format); - values.forEach(function (value) { - var option = document.createElement('option'); - if (value !== false) { - option.setAttribute('value', value); - } else { - option.setAttribute('selected', 'selected'); - } - input.appendChild(option); - }); - container.appendChild(input); - } + function Formula() { + _classCallCheck(this, Formula); - Toolbar.DEFAULTS = { - container: null, - handlers: { - clean: function clean() { - var _this3 = this; - - var range = this.quill.getSelection(); - if (range == null) return; - if (range.length == 0) { - var formats = this.quill.getFormat(); - Object.keys(formats).forEach(function (name) { - // Clean functionality in existing apps only clean inline formats - if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) { - _this3.quill.format(name, false); - } - }); - } else { - this.quill.removeFormat(range, _quill2.default.sources.USER); - } - }, - direction: function direction(value) { - var align = this.quill.getFormat()['align']; - if (value === 'rtl' && align == null) { - this.quill.format('align', 'right', _quill2.default.sources.USER); - } else if (!value && align === 'right') { - this.quill.format('align', false, _quill2.default.sources.USER); - } - this.quill.format('direction', value, _quill2.default.sources.USER); - }, - link: function link(value) { - if (value === true) { - value = prompt('Enter link URL:'); - } - this.quill.format('link', value, _quill2.default.sources.USER); - }, - indent: function indent(value) { - var range = this.quill.getSelection(); - var formats = this.quill.getFormat(range); - var indent = parseInt(formats.indent || 0); - if (value === '+1' || value === '-1') { - var modifier = value === '+1' ? 1 : -1; - if (formats.direction === 'rtl') modifier *= -1; - this.quill.format('indent', indent + modifier, _quill2.default.sources.USER); - } - } - } - }; + var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this)); - exports.default = Toolbar; - exports.addControls = addControls; + if (window.katex == null) { + throw new Error('Formula module requires KaTeX.'); + } + return _this2; + } -/***/ }, -/* 73 */ -/***/ function(module, exports, __webpack_require__) { + return Formula; +}(_module2.default); - 'use strict'; +exports.FormulaBlot = FormulaBlot; +exports.default = Formula; - module.exports = { - 'align': { - '': __webpack_require__(74), - 'center': __webpack_require__(75), - 'right': __webpack_require__(76), - 'justify': __webpack_require__(77) - }, - 'background': __webpack_require__(78), - 'blockquote': __webpack_require__(79), - 'bold': __webpack_require__(80), - 'clean': __webpack_require__(81), - 'code': __webpack_require__(82), - 'code-block': __webpack_require__(82), - 'color': __webpack_require__(83), - 'direction': { - '': __webpack_require__(84), - 'rtl': __webpack_require__(85) - }, - 'float': { - 'center': __webpack_require__(86), - 'full': __webpack_require__(87), - 'left': __webpack_require__(88), - 'right': __webpack_require__(89) - }, - 'formula': __webpack_require__(90), - 'header': { - '1': __webpack_require__(91), - '2': __webpack_require__(92) - }, - 'italic': __webpack_require__(93), - 'image': __webpack_require__(94), - 'indent': { - '+1': __webpack_require__(95), - '-1': __webpack_require__(96) - }, - 'link': __webpack_require__(97), - 'list': { - 'ordered': __webpack_require__(98), - 'bullet': __webpack_require__(99) - }, - 'script': { - 'sub': __webpack_require__(100), - 'super': __webpack_require__(101) - }, - 'strike': __webpack_require__(102), - 'underline': __webpack_require__(103), - 'video': __webpack_require__(104) - }; +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 74 */ -/***/ function(module, exports) { +"use strict"; - module.exports = " "; -/***/ }, -/* 75 */ -/***/ function(module, exports) { +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.CodeToken = exports.CodeBlock = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); - module.exports = " "; +var _code = __webpack_require__(13); -/***/ }, +var _code2 = _interopRequireDefault(_code); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var SyntaxCodeBlock = function (_CodeBlock) { + _inherits(SyntaxCodeBlock, _CodeBlock); + + function SyntaxCodeBlock() { + _classCallCheck(this, SyntaxCodeBlock); + + return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments)); + } + + _createClass(SyntaxCodeBlock, [{ + key: 'replaceWith', + value: function replaceWith(block) { + this.domNode.textContent = this.domNode.textContent; + this.attach(); + _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block); + } + }, { + key: 'highlight', + value: function highlight(_highlight) { + var text = this.domNode.textContent; + if (this.cachedText !== text) { + if (text.trim().length > 0 || this.cachedText == null) { + this.domNode.innerHTML = _highlight(text); + this.domNode.normalize(); + this.attach(); + } + this.cachedText = text; + } + } + }]); + + return SyntaxCodeBlock; +}(_code2.default); + +SyntaxCodeBlock.className = 'ql-syntax'; + +var CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', { + scope: _parchment2.default.Scope.INLINE +}); + +var Syntax = function (_Module) { + _inherits(Syntax, _Module); + + _createClass(Syntax, null, [{ + key: 'register', + value: function register() { + _quill2.default.register(CodeToken, true); + _quill2.default.register(SyntaxCodeBlock, true); + } + }]); + + function Syntax(quill, options) { + _classCallCheck(this, Syntax); + + var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options)); + + if (typeof _this2.options.highlight !== 'function') { + throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.'); + } + var timer = null; + _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { + clearTimeout(timer); + timer = setTimeout(function () { + _this2.highlight(); + timer = null; + }, _this2.options.interval); + }); + _this2.highlight(); + return _this2; + } + + _createClass(Syntax, [{ + key: 'highlight', + value: function highlight() { + var _this3 = this; + + if (this.quill.selection.composing) return; + this.quill.update(_quill2.default.sources.USER); + var range = this.quill.getSelection(); + this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) { + code.highlight(_this3.options.highlight); + }); + this.quill.update(_quill2.default.sources.SILENT); + if (range != null) { + this.quill.setSelection(range, _quill2.default.sources.SILENT); + } + } + }]); + + return Syntax; +}(_module2.default); + +Syntax.DEFAULTS = { + highlight: function () { + if (window.hljs == null) return null; + return function (text) { + var result = window.hljs.highlightAuto(text); + return result.value; + }; + }(), + interval: 1000 +}; + +exports.CodeBlock = SyntaxCodeBlock; +exports.CodeToken = CodeToken; +exports.default = Syntax; + +/***/ }), /* 76 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 77 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 78 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 79 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 80 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 81 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 82 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 83 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 84 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 85 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 86 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 87 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 88 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 89 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 90 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 91 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 92 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 93 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 94 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 95 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 96 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 97 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 98 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 99 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 100 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 101 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 102 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 103 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 104 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 105 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _dropdown = __webpack_require__(106); - - var _dropdown2 = _interopRequireDefault(_dropdown); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var Picker = function () { - function Picker(select) { - var _this = this; - - _classCallCheck(this, Picker); - - 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('click', function () { - _this.container.classList.toggle('ql-expanded'); - }); - this.select.addEventListener('change', this.update.bind(this)); - } - - _createClass(Picker, [{ - key: 'buildItem', - value: function buildItem(option) { - var _this2 = this; - - var item = document.createElement('span'); - item.classList.add('ql-picker-item'); - if (option.hasAttribute('value')) { - item.setAttribute('data-value', option.getAttribute('value')); - } - if (option.textContent) { - item.setAttribute('data-label', option.textContent); - } - item.addEventListener('click', function () { - _this2.selectItem(item, true); - }); - return item; - } - }, { - key: 'buildLabel', - value: function buildLabel() { - var label = document.createElement('span'); - label.classList.add('ql-picker-label'); - label.innerHTML = _dropdown2.default; - this.container.appendChild(label); - return label; - } - }, { - key: 'buildOptions', - value: function buildOptions() { - var _this3 = this; - - var options = document.createElement('span'); - options.classList.add('ql-picker-options'); - [].slice.call(this.select.options).forEach(function (option) { - var item = _this3.buildItem(option); - options.appendChild(item); - if (option.hasAttribute('selected')) { - _this3.selectItem(item); - } - }); - this.container.appendChild(options); - } - }, { - key: 'buildPicker', - value: function buildPicker() { - var _this4 = this; - - [].slice.call(this.select.attributes).forEach(function (item) { - _this4.container.setAttribute(item.name, item.value); - }); - this.container.classList.add('ql-picker'); - this.label = this.buildLabel(); - this.buildOptions(); - } - }, { - key: 'close', - value: function close() { - this.container.classList.remove('ql-expanded'); - } - }, { - key: 'selectItem', - value: function selectItem(item) { - var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - var selected = this.container.querySelector('.ql-selected'); - if (item === selected) return; - if (selected != null) { - selected.classList.remove('ql-selected'); - } - if (item != null) { - item.classList.add('ql-selected'); - this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item); - if (item.hasAttribute('data-value')) { - this.label.setAttribute('data-value', item.getAttribute('data-value')); - } else { - this.label.removeAttribute('data-value'); - } - if (item.hasAttribute('data-label')) { - this.label.setAttribute('data-label', item.getAttribute('data-label')); - } else { - this.label.removeAttribute('data-label'); - } - if (trigger) { - if (typeof Event === 'function') { - this.select.dispatchEvent(new Event('change')); - } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') { - // IE11 - var event = document.createEvent('Event'); - event.initEvent('change', true, true); - this.select.dispatchEvent(event); - } - this.close(); - } - } else { - this.label.removeAttribute('data-value'); - this.label.removeAttribute('data-label'); - } - } - }, { - key: 'update', - value: function update() { - var option = void 0; - if (this.select.selectedIndex > -1) { - var 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); - } - var isActive = option != null && option !== this.select.querySelector('option[selected]'); - this.label.classList.toggle('ql-active', isActive); - } - }]); - - return Picker; - }(); +/***/ (function(module, exports) { - exports.default = Picker; +module.exports = " "; -/***/ }, +/***/ }), /* 106 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { - module.exports = " "; +module.exports = " "; -/***/ }, +/***/ }), /* 107 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { - 'use strict'; +module.exports = " "; - Object.defineProperty(exports, "__esModule", { - value: true - }); +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +"use strict"; - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - var _picker = __webpack_require__(105); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BubbleTooltip = undefined; - var _picker2 = _interopRequireDefault(_picker); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _extend = __webpack_require__(3); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var _extend2 = _interopRequireDefault(_extend); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _emitter = __webpack_require__(8); - var ColorPicker = function (_Picker) { - _inherits(ColorPicker, _Picker); +var _emitter2 = _interopRequireDefault(_emitter); - function ColorPicker(select, label) { - _classCallCheck(this, ColorPicker); +var _base = __webpack_require__(43); - var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select)); +var _base2 = _interopRequireDefault(_base); - _this.label.innerHTML = label; - _this.container.classList.add('ql-color-picker'); - [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) { - item.classList.add('ql-primary'); - }); - return _this; - } +var _selection = __webpack_require__(15); - _createClass(ColorPicker, [{ - key: 'buildItem', - value: function buildItem(option) { - var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option); - item.style.backgroundColor = option.getAttribute('value') || ''; - return item; - } - }, { - key: 'selectItem', - value: function selectItem(item, trigger) { - _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger); - var colorLabel = this.label.querySelector('.ql-color-label'); - var value = item ? item.getAttribute('data-value') || '' : ''; - if (colorLabel) { - if (colorLabel.tagName === 'line') { - colorLabel.style.stroke = value; - } else { - colorLabel.style.fill = value; - } - } - } - }]); +var _icons = __webpack_require__(41); - return ColorPicker; - }(_picker2.default); +var _icons2 = _interopRequireDefault(_icons); - exports.default = ColorPicker; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/***/ }, -/* 108 */ -/***/ function(module, exports, __webpack_require__) { +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - 'use strict'; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - Object.defineProperty(exports, "__esModule", { - value: true - }); +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']]; - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +var BubbleTheme = function (_BaseTheme) { + _inherits(BubbleTheme, _BaseTheme); - var _picker = __webpack_require__(105); + function BubbleTheme(quill, options) { + _classCallCheck(this, BubbleTheme); - var _picker2 = _interopRequireDefault(_picker); + if (options.modules.toolbar != null && options.modules.toolbar.container == null) { + options.modules.toolbar.container = TOOLBAR_CONFIG; + } - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options)); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + _this.quill.container.classList.add('ql-bubble'); + return _this; + } - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + _createClass(BubbleTheme, [{ + key: 'extendToolbar', + value: function extendToolbar(toolbar) { + this.tooltip = new BubbleTooltip(this.quill, this.options.bounds); + this.tooltip.root.appendChild(toolbar.container); + this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); + this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); + } + }]); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + return BubbleTheme; +}(_base2.default); - var IconPicker = function (_Picker) { - _inherits(IconPicker, _Picker); +BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + link: function link(value) { + if (!value) { + this.quill.format('link', false); + } else { + this.quill.theme.tooltip.edit(); + } + } + } + } + } +}); - function IconPicker(select, icons) { - _classCallCheck(this, IconPicker); +var BubbleTooltip = function (_BaseTooltip) { + _inherits(BubbleTooltip, _BaseTooltip); - var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select)); + function BubbleTooltip(quill, bounds) { + _classCallCheck(this, BubbleTooltip); - _this.container.classList.add('ql-icon-picker'); - [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) { - item.innerHTML = icons[item.getAttribute('data-value') || '']; - }); - _this.defaultItem = _this.container.querySelector('.ql-selected'); - _this.selectItem(_this.defaultItem); - return _this; - } + var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds)); - _createClass(IconPicker, [{ - key: 'selectItem', - value: function selectItem(item, trigger) { - _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger); - item = item || this.defaultItem; - this.label.innerHTML = item.innerHTML; - } - }]); + _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) { + if (type !== _emitter2.default.events.SELECTION_CHANGE) return; + if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) { + _this2.show(); + // Lock our width so we will expand beyond our offsetParent boundaries + _this2.root.style.left = '0px'; + _this2.root.style.width = ''; + _this2.root.style.width = _this2.root.offsetWidth + 'px'; + var lines = _this2.quill.getLines(range.index, range.length); + if (lines.length === 1) { + _this2.position(_this2.quill.getBounds(range)); + } else { + var lastLine = lines[lines.length - 1]; + var index = _this2.quill.getIndex(lastLine); + var length = Math.min(lastLine.length() - 1, range.index + range.length - index); + var _bounds = _this2.quill.getBounds(new _selection.Range(index, length)); + _this2.position(_bounds); + } + } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) { + _this2.hide(); + } + }); + return _this2; + } + + _createClass(BubbleTooltip, [{ + key: 'listen', + value: function listen() { + var _this3 = this; + + _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this); + this.root.querySelector('.ql-close').addEventListener('click', function () { + _this3.root.classList.remove('ql-editing'); + }); + this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () { + // Let selection be restored by toolbar handlers before repositioning + setTimeout(function () { + if (_this3.root.classList.contains('ql-hidden')) return; + var range = _this3.quill.getSelection(); + if (range != null) { + _this3.position(_this3.quill.getBounds(range)); + } + }, 1); + }); + } + }, { + key: 'cancel', + value: function cancel() { + this.show(); + } + }, { + key: 'position', + value: function position(reference) { + var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference); + var arrow = this.root.querySelector('.ql-tooltip-arrow'); + arrow.style.marginLeft = ''; + if (shift === 0) return shift; + arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px'; + } + }]); + + return BubbleTooltip; +}(_base.BaseTooltip); - return IconPicker; - }(_picker2.default); +BubbleTooltip.TEMPLATE = ['', '
    ', '', '', '
    '].join(''); - exports.default = IconPicker; +exports.BubbleTooltip = BubbleTooltip; +exports.default = BubbleTheme; -/***/ }, +/***/ }), /* 109 */ -/***/ function(module, exports) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var Tooltip = function () { - function Tooltip(quill, boundsContainer) { - var _this = this; - - _classCallCheck(this, Tooltip); - - this.quill = quill; - this.boundsContainer = boundsContainer || document.body; - this.root = quill.addContainer('ql-tooltip'); - this.root.innerHTML = this.constructor.TEMPLATE; - var offset = parseInt(window.getComputedStyle(this.root).marginTop); - this.quill.root.addEventListener('scroll', function () { - _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + offset + 'px'; - _this.checkBounds(); - }); - this.hide(); - } - - _createClass(Tooltip, [{ - key: 'checkBounds', - value: function checkBounds() { - this.root.classList.toggle('ql-out-top', this.root.offsetTop <= 0); - this.root.classList.remove('ql-out-bottom'); - this.root.classList.toggle('ql-out-bottom', this.root.offsetTop + this.root.offsetHeight >= this.quill.root.offsetHeight); - } - }, { - key: 'hide', - value: function hide() { - this.root.classList.add('ql-hidden'); - } - }, { - key: 'position', - value: function position(reference) { - var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2; - var top = reference.bottom + this.quill.root.scrollTop; - this.root.style.left = left + 'px'; - this.root.style.top = top + 'px'; - var containerBounds = this.boundsContainer.getBoundingClientRect(); - var rootBounds = this.root.getBoundingClientRect(); - var shift = 0; - if (rootBounds.right > containerBounds.right) { - shift = containerBounds.right - rootBounds.right; - this.root.style.left = left + shift + 'px'; - } - if (rootBounds.left < containerBounds.left) { - shift = containerBounds.left - rootBounds.left; - this.root.style.left = left + shift + 'px'; - } - this.checkBounds(); - return shift; - } - }, { - key: 'show', - value: function show() { - this.root.classList.remove('ql-editing'); - this.root.classList.remove('ql-hidden'); - } - }]); - - return Tooltip; - }(); - - exports.default = Tooltip; - -/***/ }, -/* 110 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.BubbleTooltip = undefined; - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _extend = __webpack_require__(30); - - var _extend2 = _interopRequireDefault(_extend); - - var _emitter = __webpack_require__(36); - - var _emitter2 = _interopRequireDefault(_emitter); - - var _base = __webpack_require__(111); - - var _base2 = _interopRequireDefault(_base); - - var _selection = __webpack_require__(44); - - var _icons = __webpack_require__(73); - - var _icons2 = _interopRequireDefault(_icons); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']]; - - var BubbleTheme = function (_BaseTheme) { - _inherits(BubbleTheme, _BaseTheme); - - function BubbleTheme(quill, options) { - _classCallCheck(this, BubbleTheme); - - if (options.modules.toolbar != null && options.modules.toolbar.container == null) { - options.modules.toolbar.container = TOOLBAR_CONFIG; - } - - var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options)); - - _this.quill.container.classList.add('ql-bubble'); - return _this; - } - - _createClass(BubbleTheme, [{ - key: 'extendToolbar', - value: function extendToolbar(toolbar) { - this.tooltip = new BubbleTooltip(this.quill, this.options.bounds); - this.tooltip.root.appendChild(toolbar.container); - this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); - this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); - } - }]); - - return BubbleTheme; - }(_base2.default); - - BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { - modules: { - toolbar: { - handlers: { - link: function link(value) { - if (!value) { - this.quill.format('link', false); - } else { - this.quill.theme.tooltip.edit(); - } - } - } - } - } - }); - - var BubbleTooltip = function (_BaseTooltip) { - _inherits(BubbleTooltip, _BaseTooltip); - - function BubbleTooltip(quill, bounds) { - _classCallCheck(this, BubbleTooltip); - - var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds)); - - _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range) { - if (type !== _emitter2.default.events.SELECTION_CHANGE) return; - if (range != null && range.length > 0) { - _this2.show(); - // Lock our width so we will expand beyond our offsetParent boundaries - _this2.root.style.left = '0px'; - _this2.root.style.width = ''; - _this2.root.style.width = _this2.root.offsetWidth + 'px'; - var lines = _this2.quill.scroll.lines(range.index, range.length); - if (lines.length === 1) { - _this2.position(_this2.quill.getBounds(range)); - } else { - var lastLine = lines[lines.length - 1]; - var index = lastLine.offset(_this2.quill.scroll); - var length = Math.min(lastLine.length() - 1, range.index + range.length - index); - var _bounds = _this2.quill.getBounds(new _selection.Range(index, length)); - _this2.position(_bounds); - } - } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) { - _this2.hide(); - } - }); - return _this2; - } - - _createClass(BubbleTooltip, [{ - key: 'listen', - value: function listen() { - var _this3 = this; - - _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this); - this.root.querySelector('.ql-close').addEventListener('click', function () { - _this3.root.classList.remove('ql-editing'); - }); - this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () { - // Let selection be restored by toolbar handlers before repositioning - setTimeout(function () { - if (_this3.root.classList.contains('ql-hidden')) return; - var range = _this3.quill.getSelection(); - if (range != null) { - _this3.position(_this3.quill.getBounds(range)); - } - }, 1); - }); - } - }, { - key: 'cancel', - value: function cancel() { - this.show(); - } - }, { - key: 'position', - value: function position(reference) { - var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference); - var arrow = this.root.querySelector('.ql-tooltip-arrow'); - arrow.style.marginLeft = ''; - if (shift === 0) return shift; - arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px'; - } - }]); - - return BubbleTooltip; - }(_base.BaseTooltip); - - BubbleTooltip.TEMPLATE = ['', '
    ', '', '', '
    '].join(''); - - exports.BubbleTooltip = BubbleTooltip; - exports.default = BubbleTheme; - -/***/ }, -/* 111 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = exports.BaseTooltip = undefined; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _extend = __webpack_require__(30); - - var _extend2 = _interopRequireDefault(_extend); - - var _quillDelta = __webpack_require__(20); - - var _quillDelta2 = _interopRequireDefault(_quillDelta); - - var _emitter = __webpack_require__(36); - - var _emitter2 = _interopRequireDefault(_emitter); - - var _keyboard = __webpack_require__(56); - - var _keyboard2 = _interopRequireDefault(_keyboard); - - var _theme = __webpack_require__(45); - - var _theme2 = _interopRequireDefault(_theme); - - var _colorPicker = __webpack_require__(107); - - var _colorPicker2 = _interopRequireDefault(_colorPicker); - - var _iconPicker = __webpack_require__(108); - - var _iconPicker2 = _interopRequireDefault(_iconPicker); - - var _picker = __webpack_require__(105); - - var _picker2 = _interopRequireDefault(_picker); - - var _tooltip = __webpack_require__(109); - - var _tooltip2 = _interopRequireDefault(_tooltip); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var ALIGNS = [false, 'center', 'right', 'justify']; - - var 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"]; - - var FONTS = [false, 'serif', 'monospace']; - - var HEADERS = ['1', '2', '3', false]; - - var SIZES = ['small', false, 'large', 'huge']; - - var BaseTheme = function (_Theme) { - _inherits(BaseTheme, _Theme); - - function BaseTheme(quill, options) { - _classCallCheck(this, BaseTheme); - - var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options)); - - var listener = function listener(e) { - if (!document.body.contains(quill.root)) { - return document.body.removeEventListener('click', listener); - } - if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) { - _this.tooltip.hide(); - } - if (_this.pickers != null) { - _this.pickers.forEach(function (picker) { - if (!picker.container.contains(e.target)) { - picker.close(); - } - }); - } - }; - document.body.addEventListener('click', listener); - return _this; - } - - _createClass(BaseTheme, [{ - key: 'addModule', - value: function addModule(name) { - var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name); - if (name === 'toolbar') { - this.extendToolbar(module); - } - return module; - } - }, { - key: 'buildButtons', - value: function buildButtons(buttons, icons) { - buttons.forEach(function (button) { - var className = button.getAttribute('class') || ''; - className.split(/\s+/).forEach(function (name) { - if (!name.startsWith('ql-')) return; - name = name.slice('ql-'.length); - if (icons[name] == null) return; - if (name === 'direction') { - button.innerHTML = icons[name][''] + icons[name]['rtl']; - } else if (typeof icons[name] === 'string') { - button.innerHTML = icons[name]; - } else { - var value = button.value || ''; - if (value != null && icons[name][value]) { - button.innerHTML = icons[name][value]; - } - } - }); - }); - } - }, { - key: 'buildPickers', - value: function buildPickers(selects, icons) { - var _this2 = this; - - this.pickers = selects.map(function (select) { - if (select.classList.contains('ql-align')) { - if (select.querySelector('option') == null) { - fillSelect(select, ALIGNS); - } - return new _iconPicker2.default(select, icons.align); - } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) { - var format = select.classList.contains('ql-background') ? 'background' : 'color'; - if (select.querySelector('option') == null) { - fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000'); - } - return new _colorPicker2.default(select, icons[format]); - } else { - if (select.querySelector('option') == null) { - if (select.classList.contains('ql-font')) { - fillSelect(select, FONTS); - } else if (select.classList.contains('ql-header')) { - fillSelect(select, HEADERS); - } else if (select.classList.contains('ql-size')) { - fillSelect(select, SIZES); - } - } - return new _picker2.default(select); - } - }); - var update = function update() { - _this2.pickers.forEach(function (picker) { - picker.update(); - }); - }; - this.quill.on(_emitter2.default.events.SELECTION_CHANGE, update).on(_emitter2.default.events.SCROLL_OPTIMIZE, update); - } - }]); - - return BaseTheme; - }(_theme2.default); - - BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, { - modules: { - toolbar: { - handlers: { - formula: function formula() { - this.quill.theme.tooltip.edit('formula'); - }, - image: function image() { - var _this3 = this; - - var fileInput = this.container.querySelector('input.ql-image[type=file]'); - if (fileInput == null) { - fileInput = document.createElement('input'); - fileInput.setAttribute('type', 'file'); - fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon, image/svg+xml'); - fileInput.classList.add('ql-image'); - fileInput.addEventListener('change', function () { - if (fileInput.files != null && fileInput.files[0] != null) { - var reader = new FileReader(); - reader.onload = function (e) { - var range = _this3.quill.getSelection(true); - _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER); - fileInput.value = ""; - }; - reader.readAsDataURL(fileInput.files[0]); - } - }); - this.container.appendChild(fileInput); - } - fileInput.click(); - }, - video: function video() { - this.quill.theme.tooltip.edit('video'); - } - } - } - } - }); - - var BaseTooltip = function (_Tooltip) { - _inherits(BaseTooltip, _Tooltip); - - function BaseTooltip(quill, boundsContainer) { - _classCallCheck(this, BaseTooltip); - - var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer)); - - _this4.textbox = _this4.root.querySelector('input[type="text"]'); - _this4.listen(); - return _this4; - } - - _createClass(BaseTooltip, [{ - key: 'listen', - value: function listen() { - var _this5 = this; - - this.textbox.addEventListener('keydown', function (event) { - if (_keyboard2.default.match(event, 'enter')) { - _this5.save(); - event.preventDefault(); - } else if (_keyboard2.default.match(event, 'escape')) { - _this5.cancel(); - event.preventDefault(); - } - }); - } - }, { - key: 'cancel', - value: function cancel() { - this.hide(); - } - }, { - key: 'edit', - value: function edit() { - var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link'; - var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - this.root.classList.remove('ql-hidden'); - this.root.classList.add('ql-editing'); - if (preview != null) { - this.textbox.value = preview; - } else if (mode !== this.root.getAttribute('data-mode')) { - this.textbox.value = ''; - } - this.position(this.quill.getBounds(this.quill.selection.savedRange)); - this.textbox.select(); - this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || ''); - this.root.setAttribute('data-mode', mode); - } - }, { - key: 'restoreFocus', - value: function restoreFocus() { - var scrollTop = this.quill.root.scrollTop; - this.quill.focus(); - this.quill.root.scrollTop = scrollTop; - } - }, { - key: 'save', - value: function save() { - var value = this.textbox.value; - switch (this.root.getAttribute('data-mode')) { - case 'link': - { - var scrollTop = this.quill.root.scrollTop; - if (this.linkRange) { - this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER); - delete this.linkRange; - } else { - this.restoreFocus(); - this.quill.format('link', value, _emitter2.default.sources.USER); - } - this.quill.root.scrollTop = scrollTop; - break; - } - case 'video': - { - var match = value.match(/^(https?):\/\/(www\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || value.match(/^(https?):\/\/(www\.)?youtu\.be\/([a-zA-Z0-9_-]+)/); - if (match) { - value = match[1] + '://www.youtube.com/embed/' + match[3] + '?showinfo=0'; - } else if (match = value.match(/^(https?):\/\/(www\.)?vimeo\.com\/(\d+)/)) { - // eslint-disable-line no-cond-assign - value = match[1] + '://player.vimeo.com/video/' + match[3] + '/'; - } - } // eslint-disable-next-line no-fallthrough - case 'formula': - { - var range = this.quill.getSelection(true); - var index = range.index + range.length; - if (range != null) { - this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER); - if (this.root.getAttribute('data-mode') === 'formula') { - this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER); - } - this.quill.setSelection(index + 2, _emitter2.default.sources.USER); - } - break; - } - default: - } - this.textbox.value = ''; - this.hide(); - } - }]); - - return BaseTooltip; - }(_tooltip2.default); - - function fillSelect(select, values) { - var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - values.forEach(function (value) { - var option = document.createElement('option'); - if (value === defaultValue) { - option.setAttribute('selected', 'selected'); - } else { - option.setAttribute('value', value); - } - select.appendChild(option); - }); - } +/***/ (function(module, exports, __webpack_require__) { - exports.BaseTooltip = BaseTooltip; - exports.default = BaseTheme; +module.exports = __webpack_require__(63); -/***/ }, -/* 112 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _extend = __webpack_require__(30); - - var _extend2 = _interopRequireDefault(_extend); - - var _emitter = __webpack_require__(36); - - var _emitter2 = _interopRequireDefault(_emitter); - - var _base = __webpack_require__(111); - - var _base2 = _interopRequireDefault(_base); - - var _link = __webpack_require__(64); - - var _link2 = _interopRequireDefault(_link); - - var _selection = __webpack_require__(44); - - var _icons = __webpack_require__(73); - - var _icons2 = _interopRequireDefault(_icons); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']]; - - var SnowTheme = function (_BaseTheme) { - _inherits(SnowTheme, _BaseTheme); - - function SnowTheme(quill, options) { - _classCallCheck(this, SnowTheme); - - if (options.modules.toolbar != null && options.modules.toolbar.container == null) { - options.modules.toolbar.container = TOOLBAR_CONFIG; - } - - var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options)); - - _this.quill.container.classList.add('ql-snow'); - return _this; - } - - _createClass(SnowTheme, [{ - key: 'extendToolbar', - value: function extendToolbar(toolbar) { - toolbar.container.classList.add('ql-snow'); - this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); - this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); - this.tooltip = new SnowTooltip(this.quill, this.options.bounds); - if (toolbar.container.querySelector('.ql-link')) { - this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) { - toolbar.handlers['link'].call(toolbar, !context.format.link); - }); - } - } - }]); - - return SnowTheme; - }(_base2.default); - - SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { - modules: { - toolbar: { - handlers: { - link: function link(value) { - if (value) { - var range = this.quill.getSelection(); - if (range == null || range.length == 0) return; - var preview = this.quill.getText(range); - if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) { - preview = 'mailto:' + preview; - } - var tooltip = this.quill.theme.tooltip; - tooltip.edit('link', preview); - } else { - this.quill.format('link', false); - } - } - } - } - } - }); - - var SnowTooltip = function (_BaseTooltip) { - _inherits(SnowTooltip, _BaseTooltip); - - function SnowTooltip(quill, bounds) { - _classCallCheck(this, SnowTooltip); - - var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds)); - - _this2.preview = _this2.root.querySelector('a.ql-preview'); - return _this2; - } - - _createClass(SnowTooltip, [{ - key: 'listen', - value: function listen() { - var _this3 = this; - - _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this); - this.root.querySelector('a.ql-action').addEventListener('click', function (event) { - if (_this3.root.classList.contains('ql-editing')) { - _this3.save(); - } else { - _this3.edit('link', _this3.preview.textContent); - } - event.preventDefault(); - }); - this.root.querySelector('a.ql-remove').addEventListener('click', function (event) { - if (_this3.linkRange != null) { - _this3.restoreFocus(); - _this3.quill.formatText(_this3.linkRange, 'link', false, _emitter2.default.sources.USER); - delete _this3.linkRange; - } - event.preventDefault(); - _this3.hide(); - }); - this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range) { - if (range == null) return; - if (range.length === 0) { - var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), - _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), - link = _quill$scroll$descend2[0], - offset = _quill$scroll$descend2[1]; - - if (link != null) { - _this3.linkRange = new _selection.Range(range.index - offset, link.length()); - var preview = _link2.default.formats(link.domNode); - _this3.preview.textContent = preview; - _this3.preview.setAttribute('href', preview); - _this3.show(); - _this3.position(_this3.quill.getBounds(_this3.linkRange)); - return; - } - } else { - delete _this3.linkRange; - } - _this3.hide(); - }); - } - }, { - key: 'show', - value: function show() { - _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this); - this.root.removeAttribute('data-mode'); - } - }]); - - return SnowTooltip; - }(_base.BaseTooltip); - SnowTooltip.TEMPLATE = ['', '', '', ''].join(''); - - exports.default = SnowTheme; - -/***/ } -/******/ ]) -}); -; \ No newline at end of file +/***/ }) +/******/ ])["default"]; +}); \ No newline at end of file diff -Nru bibledit-5.0.912/quill/quill.min.js bibledit-5.0.922/quill/quill.min.js --- bibledit-5.0.912/quill/quill.min.js 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/quill/quill.min.js 2018-03-12 06:39:22.000000000 +0000 @@ -1,41 +1,8 @@ /*! - * Quill Editor v1.1.5 + * Quill Editor v1.3.6 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Quill=e():t.Quill=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}(function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))switch(typeof t[e]){case"function":break;case"object":t[e]=function(e){var n=e.slice(1),r=t[e[0]];return function(t,e,o){r.apply(this,[t,e,o].concat(n))}}(t[e]);break;default:t[e]=t[t[e]]}return t}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var o=n(1),i=r(o),l=n(49),a=n(52),s=n(57),u=n(58),c=r(u),f=n(59),p=r(f),h=n(60),d=r(h),y=n(50),v=n(51),b=n(53),g=n(54),m=n(61),_=r(m),O=n(62),w=r(O),x=n(63),k=r(x),E=n(64),j=r(E),A=n(65),N=r(A),q=n(66),T=r(q),P=n(67),S=r(P),L=n(68),C=r(L),M=n(28),R=r(M),I=n(69),B=r(I),D=n(70),U=r(D),H=n(71),F=r(H),K=n(72),z=r(K),Z=n(104),W=r(Z),V=n(106),Y=r(V),G=n(107),X=r(G),Q=n(108),$=r(Q),J=n(109),tt=r(J),et=n(111),nt=r(et);i.default.register({"attributors/attribute/direction":a.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":y.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":a.DirectionClass,"attributors/class/font":b.FontClass,"attributors/class/size":g.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":y.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":a.DirectionStyle,"attributors/style/font":b.FontStyle,"attributors/style/size":g.SizeStyle},!0),i.default.register({"formats/align":l.AlignClass,"formats/direction":a.DirectionClass,"formats/indent":s.IndentClass,"formats/background":y.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":b.FontClass,"formats/size":g.SizeClass,"formats/blockquote":c.default,"formats/code-block":R.default,"formats/header":p.default,"formats/list":d.default,"formats/bold":_.default,"formats/code":M.Code,"formats/italic":w.default,"formats/link":k.default,"formats/script":j.default,"formats/strike":N.default,"formats/underline":T.default,"formats/image":S.default,"formats/video":C.default,"formats/list/item":h.ListItem,"modules/formula":B.default,"modules/syntax":U.default,"modules/toolbar":F.default,"themes/bubble":tt.default,"themes/snow":nt.default,"ui/icons":z.default,"ui/picker":W.default,"ui/icon-picker":X.default,"ui/color-picker":Y.default,"ui/tooltip":$.default},!0),t.exports=i.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var o=n(2),i=r(o),l=n(18),a=r(l),s=n(29),u=r(s),c=n(31),f=r(c),p=n(46),h=r(p),d=n(35),y=r(d),v=n(32),b=r(v),g=n(33),m=r(g),_=n(47),O=r(_),w=n(34),x=r(w),k=n(48),E=r(k),j=n(55),A=r(j),N=n(56),q=r(N);a.default.register({"blots/block":u.default,"blots/block/embed":s.BlockEmbed,"blots/break":f.default,"blots/container":h.default,"blots/cursor":y.default,"blots/embed":b.default,"blots/inline":m.default,"blots/scroll":O.default,"blots/text":x.default,"modules/clipboard":E.default,"modules/history":A.default,"modules/keyboard":q.default}),i.default.register(u.default,f.default,y.default,m.default,O.default,x.default),t.exports=a.default},function(t,e,n){"use strict";var r=n(3),o=n(7),i=n(12),l=n(13),a=n(14),s=n(15),u=n(16),c=n(17),f=n(8),p=n(10),h=n(11),d=n(9),y=n(6),v={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:r.default,Format:o.default,Leaf:i.default,Embed:u.default,Scroll:l.default,Block:s.default,Inline:a.default,Text:c.default,Attributor:{Attribute:f.default,Class:p.default,Style:h.default,Store:d.default}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=v},function(t,e,n){"use strict";function r(t){var e=a.find(t);if(null==e)try{e=a.create(t)}catch(n){e=a.create(a.Scope.INLINE),[].slice.call(t.childNodes).forEach(function(t){e.domNode.appendChild(t)}),t.parentNode.replaceChild(e.domNode,t),e.attach()}return e}var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(4),l=n(5),a=n(6),s=function(t){function e(){t.apply(this,arguments)}return o(e,t),e.prototype.appendChild=function(t){this.insertBefore(t)},e.prototype.attach=function(){var e=this;t.prototype.attach.call(this),this.children=new i.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(t){try{var n=r(t);e.insertBefore(n,e.children.head)}catch(t){if(t instanceof a.ParchmentError)return;throw t}})},e.prototype.deleteAt=function(t,e){return 0===t&&e===this.length()?this.remove():void this.children.forEachAt(t,e,function(t,e,n){t.deleteAt(e,n)})},e.prototype.descendant=function(t,n){var r=this.children.find(n),o=r[0],i=r[1];return null==t.blotName&&t(o)||null!=t.blotName&&o instanceof t?[o,i]:o instanceof e?o.descendant(t,i):[null,-1]},e.prototype.descendants=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE);var o=[],i=r;return this.children.forEachAt(n,r,function(n,r,l){(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&o.push(n),n instanceof e&&(o=o.concat(n.descendants(t,r,i))),i-=l}),o},e.prototype.detach=function(){this.children.forEach(function(t){t.detach()}),t.prototype.detach.call(this)},e.prototype.formatAt=function(t,e,n,r){this.children.forEachAt(t,e,function(t,e,o){t.formatAt(e,o,n,r)})},e.prototype.insertAt=function(t,e,n){var r=this.children.find(t),o=r[0],i=r[1];if(o)o.insertAt(i,e,n);else{var l=null==n?a.create("text",e):a.create(e,n);this.appendChild(l)}},e.prototype.insertBefore=function(t,e){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(e){return t instanceof e}))throw new a.ParchmentError("Cannot insert "+t.statics.blotName+" into "+this.statics.blotName);t.insertInto(this,e)},e.prototype.length=function(){return this.children.reduce(function(t,e){return t+e.length()},0)},e.prototype.moveChildren=function(t,e){this.children.forEach(function(n){t.insertBefore(n,e)})},e.prototype.optimize=function(){if(t.prototype.optimize.call(this),0===this.children.length)if(null!=this.statics.defaultChild){var e=a.create(this.statics.defaultChild);this.appendChild(e),e.optimize()}else this.remove()},e.prototype.path=function(t,n){void 0===n&&(n=!1);var r=this.children.find(t,n),o=r[0],i=r[1],l=[[this,t]];return o instanceof e?l.concat(o.path(i,n)):(null!=o&&l.push([o,i]),l)},e.prototype.removeChild=function(t){this.children.remove(t)},e.prototype.replace=function(n){n instanceof e&&n.moveChildren(this),t.prototype.replace.call(this,n)},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(t,this.length(),function(t,r,o){t=t.split(r,e),n.appendChild(t)}),n},e.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},e.prototype.update=function(t){var e=this,n=[],o=[];t.forEach(function(t){t.target===e.domNode&&"childList"===t.type&&(n.push.apply(n,t.addedNodes),o.push.apply(o,t.removedNodes))}),o.forEach(function(t){if(!(null!=t.parentNode&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var n=a.find(t);null!=n&&(null!=n.domNode.parentNode&&n.domNode.parentNode!==e.domNode||n.detach())}}),n.filter(function(t){return t.parentNode==e.domNode}).sort(function(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(t){var n=null;null!=t.nextSibling&&(n=a.find(t.nextSibling));var o=r(t);o.next==n&&null!=o.next||(null!=o.parent&&o.parent.removeChild(e),e.insertBefore(o,n))})},e}(l.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=s},function(t,e){"use strict";var n=function(){function t(){this.head=this.tail=void 0,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=void 0,this.head=this.tail=t),this.length+=1},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var o=n.length();if(ta?n(r,t-a,Math.min(e,a+u-t)):n(r,0,Math.min(u,t+e-a)),a+=u}},t.prototype.map=function(t){return this.reduce(function(e,n){return e.push(t(n)),e},[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,n){"use strict";var r=n(6),o=function(){function t(t){this.domNode=t,this.attach()}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){this.domNode[r.DATA_KEY]={blot:this}},t.prototype.clone=function(){var t=this.domNode.cloneNode();return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){var n=this.isolate(t,e);n.remove()},t.prototype.formatAt=function(t,e,n,o){var i=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&o)i.wrap(n,o);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var l=r.create(this.statics.scope);i.wrap(l),l.format(n,o)}},t.prototype.insertAt=function(t,e,n){var o=null==n?r.create("text",e):r.create(e,n),i=this.split(t);this.parent.insertBefore(o,i)},t.prototype.insertInto=function(t,e){if(null!=this.parent&&this.parent.children.remove(this),t.children.insertBefore(this,e),null!=e)var n=e.domNode;null!=this.next&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t){void 0===t&&(t=[])},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=o},function(t,e){"use strict";function n(t,e){var n=o(t);if(null==n)throw new a("Unable to create "+t+" blot");var r=n,i=t instanceof Node?t:r.create(e);return new r(i,e)}function r(t,n){return void 0===n&&(n=!1),null==t?null:null!=t[e.DATA_KEY]?t[e.DATA_KEY].blot:n?r(t.parentNode,n):null}function o(t,e){void 0===e&&(e=p.ANY);var n;if("string"==typeof t)n=f[t]||s[t];else if(t instanceof Text)n=f.text;else if("number"==typeof t)t&p.LEVEL&p.BLOCK?n=f.block:t&p.LEVEL&p.INLINE&&(n=f.inline);else if(t instanceof HTMLElement){var r=(t.getAttribute("class")||"").split(/\s+/);for(var o in r)if(n=u[r[o]])break;n=n||c[t.tagName]}return null==n&&t instanceof Node&&console.log(t.nodeType),null==n?null:e&p.LEVEL&n.scope&&e&p.TYPE&n.scope?n:null}function i(){for(var t=[],e=0;e1)return t.map(function(t){return i(t)});var n=t[0];if("string"!=typeof n.blotName&&"string"!=typeof n.attrName)throw new a("Invalid definition");if("abstract"===n.blotName)throw new a("Cannot register abstract class");if(f[n.blotName||n.attrName]=n,"string"==typeof n.keyName)s[n.keyName]=n;else if(null!=n.className&&(u[n.className]=n),null!=n.tagName){Array.isArray(n.tagName)?n.tagName=n.tagName.map(function(t){return t.toUpperCase()}):n.tagName=n.tagName.toUpperCase();var r=Array.isArray(n.tagName)?n.tagName:[n.tagName];r.forEach(function(t){null!=c[t]&&null!=n.className||(c[t]=n)})}return n}var l=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},a=function(t){function e(e){e="[Parchment] "+e,t.call(this,e),this.message=e,this.name=this.constructor.name}return l(e,t),e}(Error);e.ParchmentError=a;var s={},u={},c={},f={};e.DATA_KEY="__blot",function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(e.Scope||(e.Scope={}));var p=e.Scope;e.create=n,e.find=r,e.query=o,e.register=i},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(8),i=n(9),l=n(3),a=n(6),s=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.formats=function(t){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)},e.prototype.attach=function(){t.prototype.attach.call(this),this.attributes=new i.default(this.domNode)},e.prototype.format=function(t,e){var n=a.query(t);n instanceof o.default?this.attributes.attribute(n,e):e&&(null==n||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e))},e.prototype.formats=function(){var t=this.attributes.values(),e=this.statics.formats(this.domNode);return null!=e&&(t[this.statics.blotName]=e),t},e.prototype.replaceWith=function(e,n){var r=t.prototype.replaceWith.call(this,e,n);return this.attributes.copy(r),r},e.prototype.update=function(e){var n=this;t.prototype.update.call(this,e),e.some(function(t){return t.target===n.domNode&&"attributes"===t.type})&&this.attributes.build()},e.prototype.wrap=function(n,r){var o=t.prototype.wrap.call(this,n,r);return o instanceof e&&o.statics.scope===this.statics.scope&&this.attributes.move(o),o},e}(l.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=s},function(t,e,n){"use strict";var r=n(6),o=function(){function t(t,e,n){void 0===n&&(n={}),this.attrName=t,this.keyName=e;var o=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|o:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return t.keys=function(t){return[].map.call(t.attributes,function(t){return t.name})},t.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)},t.prototype.canAdd=function(t,e){var n=r.query(t,r.Scope.BLOT&(this.scope|r.Scope.TYPE));return null!=n&&(null==this.whitelist||this.whitelist.indexOf(e)>-1)},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){return t.getAttribute(this.keyName)},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=o},function(t,e,n){"use strict";var r=n(8),o=n(10),i=n(11),l=n(6),a=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=o.default.keys(this.domNode),a=i.default.keys(this.domNode);e.concat(n).concat(a).forEach(function(e){var n=l.query(e,l.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)})},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach(function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)})},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach(function(t){e.attributes[t].remove(e.domNode)}),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce(function(e,n){return e[n]=t.attributes[n].value(t.domNode),e},{})},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=a},function(t,e,n){"use strict";function r(t,e){var n=t.getAttribute("class")||"";return n.split(/\s+/).filter(function(t){return 0===t.indexOf(e+"-")})}var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(8),l=function(t){function e(){t.apply(this,arguments)}return o(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){var e=r(t,this.keyName);e.forEach(function(e){t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=r(t,this.keyName)[0]||"";return e.slice(this.keyName.length+1)},e}(i.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},function(t,e,n){"use strict";function r(t){var e=t.split("-"),n=e.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return e[0]+n}var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(8),l=function(t){function e(){t.apply(this,arguments)}return o(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map(function(t){var e=t.split(":");return e[0].trim()})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[r(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[r(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){return t.style[r(this.keyName)]},e}(i.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(5),i=n(6),l=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.value=function(t){return!0},e.prototype.index=function(t,e){return t!==this.domNode?-1:Math.min(e,1)},e.prototype.position=function(t,e){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){return t={},t[this.statics.blotName]=this.statics.value(this.domNode)||!0,t;var t},e.scope=i.Scope.INLINE_BLOT,e}(o.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(3),i=n(6),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},a=100,s=function(t){function e(e){var n=this;t.call(this,e),this.parent=null,this.observer=new MutationObserver(function(t){n.update(t)}),this.observer.observe(this.domNode,l)}return r(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach(function(t){t.remove()}):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,o){this.update(),t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e){var n=this;void 0===e&&(e=[]),t.prototype.optimize.call(this),e.push.apply(e,this.observer.takeRecords());for(var r=function(t,e){void 0===e&&(e=!0),null!=t&&t!==n&&null!=t.domNode.parentNode&&(null==t.domNode[i.DATA_KEY].mutations&&(t.domNode[i.DATA_KEY].mutations=[]),e&&r(t.parent))},l=function(t){null!=t.domNode[i.DATA_KEY]&&null!=t.domNode[i.DATA_KEY].mutations&&(t instanceof o.default&&t.children.forEach(l),t.optimize())},s=e,u=0;s.length>0;u+=1){if(u>=a)throw new Error("[Parchment] Maximum optimize iterations reached");s.forEach(function(t){var e=i.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(r(i.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,function(t){var e=i.find(t,!1);r(e,!1),e instanceof o.default&&e.children.forEach(function(t){r(t,!1)})})):"attributes"===t.type&&r(e.prev)),r(e))}),this.children.forEach(l),s=this.observer.takeRecords(),e.push.apply(e,s)}},e.prototype.update=function(e){var n=this;e=e||this.observer.takeRecords(),e.map(function(t){var e=i.find(t.target,!0);if(null!=e)return null==e.domNode[i.DATA_KEY].mutations?(e.domNode[i.DATA_KEY].mutations=[t],e):(e.domNode[i.DATA_KEY].mutations.push(t),null)}).forEach(function(t){null!=t&&t!==n&&null!=t.domNode[i.DATA_KEY]&&t.update(t.domNode[i.DATA_KEY].mutations||[])}),null!=this.domNode[i.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[i.DATA_KEY].mutations),this.optimize(e)},e.blotName="scroll",e.defaultChild="block",e.scope=i.Scope.BLOCK_BLOT,e.tagName="DIV",e}(o.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=s},function(t,e,n){"use strict";function r(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(7),l=n(6),a=function(t){function e(){t.apply(this,arguments)}return o(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach(function(t){t instanceof i.default||(t=t.wrap(e.blotName,!0)),o.attributes.copy(t)}),this.unwrap())},e.prototype.formatAt=function(e,n,r,o){if(null!=this.formats()[r]||l.query(r,l.Scope.ATTRIBUTE)){var i=this.isolate(e,n);i.format(r,o)}else t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.optimize=function(){t.prototype.optimize.call(this);var n=this.formats();if(0===Object.keys(n).length)return this.unwrap();var o=this.next;o instanceof e&&o.prev===this&&r(n,o.formats())&&(o.moveChildren(this),o.remove())},e.blotName="inline",e.scope=l.Scope.INLINE_BLOT,e.tagName="SPAN",e}(i.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=a},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(7),i=n(6),l=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.formats=function(n){var r=i.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=i.query(n,i.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,o){null!=i.query(r,i.Scope.BLOCK)?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=i.query(n,i.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var o=this.split(e),l=i.create(n,r);o.parent.insertBefore(l,o)}},e.blotName="block",e.scope=i.Scope.BLOCK_BLOT,e.tagName="P",e}(o.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(12),i=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,o){0===e&&n===this.length()?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(o.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(12),i=n(6),l=function(t){function e(e){t.call(this,e),this.text=this.statics.value(this.domNode)}return r(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){return t.data},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(){t.prototype.optimize.call(this),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=i.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t){var e=this;t.some(function(t){return"characterData"===t.type&&t.target===e.domNode})&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=i.Scope.INLINE_BLOT,e}(o.default);Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(e=(0,j.default)(!0,{container:t,modules:{clipboard:!0,keyboard:!0,history:!0}},e),e.theme&&e.theme!==S.DEFAULTS.theme){if(e.theme=S.import("themes/"+e.theme),null==e.theme)throw new Error("Invalid theme "+e.theme+". Did you register it?")}else e.theme=T.default;var n=(0,j.default)(!0,{},e.theme.DEFAULTS);[n,e].forEach(function(t){t.modules=t.modules||{},Object.keys(t.modules).forEach(function(e){t.modules[e]===!0&&(t.modules[e]={})})});var r=Object.keys(n.modules).concat(Object.keys(e.modules)),o=r.reduce(function(t,e){var n=S.import("modules/"+e);return null==n?P.error("Cannot load "+e+" module. Are you sure you registered it?"):t[e]=n.DEFAULTS||{},t},{});return null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar}),e=(0,j.default)(!0,{},S.DEFAULTS,{modules:o},n,e),["bounds","container"].forEach(function(t){"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),e.modules=Object.keys(e.modules).reduce(function(t,n){return e.modules[n]&&(t[n]=e.modules[n]),t},{}),e}function a(t,e,n,r){if(!this.options.strict&&!this.isEnabled()&&e===g.default.sources.USER)return new d.default;var o=null==n?null:this.getSelection(),i=this.editor.delta,l=t();if(null!=o&&(n===!0&&(n=o.index),null==r?o=u(o,l,e):0!==r&&(o=u(o,n,r,e)),this.setSelection(o,g.default.sources.SILENT)),l.length()>0){var a,s=[g.default.events.TEXT_CHANGE,l,i,e];if((a=this.emitter).emit.apply(a,[g.default.events.EDITOR_CHANGE].concat(s)),e!==g.default.sources.SILENT){var c;(c=this.emitter).emit.apply(c,s)}}return l}function s(t,e,n,r,o){var i={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(o=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(o=r,r=n,n=e,e=0),"object"===("undefined"==typeof n?"undefined":c(n))?(i=n,o=r):"string"==typeof n&&(null!=r?i[n]=r:o=n),o=o||g.default.sources.API,[t,e,i,o]}function u(t,e,n,r){if(null==t)return null;var o=void 0,i=void 0;if(e instanceof d.default){var l=[t.index,t.index+t.length].map(function(t){return e.transformPosition(t,r===g.default.sources.USER)}),a=f(l,2);o=a[0],i=a[1]}else{var s=[t.index,t.index+t.length].map(function(t){return t=0?t+n:Math.max(e,t+n)}),u=f(s,2);o=u[0],i=u[1]}return new x.Range(o,i-o)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=void 0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(i(this,t),this.options=l(e,r),this.container=this.options.container,null==this.container)return P.error("Invalid Quill container",e);this.options.debug&&t.debug(this.options.debug);var o=this.container.innerHTML.trim(); -this.container.classList.add("ql-container"),this.container.innerHTML="",this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new g.default,this.scroll=w.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new v.default(this.scroll),this.selection=new k.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(g.default.events.EDITOR_CHANGE,function(t){t===g.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(g.default.events.SCROLL_UPDATE,function(t,e){var r=n.selection.lastRange,o=r&&0===r.length?r.index:void 0;a.call(n,function(){return n.editor.update(null,e,o)},t)});var s=this.clipboard.convert("
    "+o+"


    ");this.setContents(s),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return p(t,null,[{key:"debug",value:function(t){t===!0&&(t="log"),N.default.level(t)}},{key:"import",value:function(t){return null==this.imports[t]&&P.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){var o=t.attrName||t.blotName;"string"==typeof o?this.register("formats/"+o,t,e):Object.keys(t).forEach(function(r){n.register(r,t[r],e)})}else null==this.imports[t]||r||P.warn("Overwriting "+t+" with",e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName&&w.default.register(e)}}]),p(t,[{key:"addContainer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){var n=t;t=document.createElement("div"),t.classList.add(n)}return this.container.insertBefore(t,e),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,n){var r=this,o=s(t,e,n),i=f(o,4);return t=i[0],e=i[1],n=i[3],a.call(this,function(){return r.editor.deleteText(t,e)},n,t,-1*e)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t),t||this.blur()}},{key:"focus",value:function(){this.selection.focus(),this.selection.scrollIntoView()}},{key:"format",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g.default.sources.API;return a.call(this,function(){var r=n.getSelection(!0),i=new d.default;if(null==r)return i;if(w.default.query(t,w.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,o({},t,e));else{if(0===r.length)return n.selection.format(t,e),i;i=n.editor.formatText(r.index,r.length,o({},t,e))}return n.setSelection(r,g.default.sources.SILENT),i},r)}},{key:"formatLine",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,e,n,r,o),c=f(u,4);return t=c[0],e=c[1],l=c[2],o=c[3],a.call(this,function(){return i.editor.formatLine(t,e,l)},o,t,0)}},{key:"formatText",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,e,n,r,o),c=f(u,4);return t=c[0],e=c[1],l=c[2],o=c[3],a.call(this,function(){return i.editor.formatText(t,e,l)},o,t,0)}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length)}},{key:"getContents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=s(t,e),r=f(n,2);return t=r[0],e=r[1],this.editor.getContents(t,e)}},{key:"getFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=s(t,e),r=f(n,2);return t=r[0],e=r[1],this.editor.getText(t,e)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.sources.API;return a.call(this,function(){return o.editor.insertEmbed(e,n,r)},i,e)}},{key:"insertText",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,0,n,r,o),c=f(u,4);return t=c[0],l=c[2],o=c[3],a.call(this,function(){return i.editor.insertText(t,e,l)},o,t,e.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}},{key:"removeFormat",value:function(t,e,n){var r=this,o=s(t,e,n),i=f(o,4);return t=i[0],e=i[1],n=i[3],a.call(this,function(){return r.editor.removeFormat(t,e)},n,t)}},{key:"setContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API;return a.call(this,function(){t=new d.default(t);var n=e.getLength(),r=e.editor.deleteText(0,n),o=e.editor.applyDelta(t),i=o.ops[o.ops.length-1];null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(e.editor.deleteText(e.getLength()-1,1),o.delete(1));var l=r.compose(o);return l},n)}},{key:"setSelection",value:function(e,n,r){if(null==e)this.selection.setRange(null,n||t.sources.API);else{var o=s(e,n,r),i=f(o,4);e=i[0],n=i[1],r=i[3],this.selection.setRange(new x.Range(e,n),r)}this.selection.scrollIntoView()}},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API,n=(new d.default).insert(t);return this.setContents(n,e)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.default.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}},{key:"updateContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API;return a.call(this,function(){return t=new d.default(t),e.editor.applyDelta(t,n)},n,!0)}}]),t}();S.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,strict:!0,theme:"default"},S.events=g.default.events,S.sources=g.default.sources,S.version="1.1.5",S.imports={delta:d.default,parchment:w.default,"core/module":_.default,"core/theme":T.default},e.expandConfig=l,e.overload=s,e.default=S},function(t,e){"use strict";var n=document.createElement("div");n.classList.toggle("test-class",!1),n.classList.contains("test-class")&&!function(){var t=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,n){return arguments.length>1&&!this.contains(e)==!n?n:t.call(this,e)}}(),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return r!==-1&&r===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function t(e){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var t,n=Object(this),r=n.length>>>0,o=arguments[1],i=0;i0&&(n.attributes=e),this.push(n))},s.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},s.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},s.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=i(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,n=this.ops[e-1],"object"!=typeof n))return this.ops.unshift(t),this;if(o(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},s.prototype.filter=function(t){return this.ops.filter(t)},s.prototype.forEach=function(t){this.ops.forEach(t)},s.prototype.map=function(t){return this.ops.map(t)},s.prototype.partition=function(t){var e=[],n=[];return this.forEach(function(r){var o=t(r)?e:n;o.push(r)}),[e,n]},s.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},s.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},s.prototype.length=function(){return this.reduce(function(t,e){return t+l.length(e)},0)},s.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var n=[],r=l.iterator(this.ops),o=0;o0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},s.prototype.diff=function(t,e){if(this.ops===t.ops)return new s;var n=[this,t].map(function(e){return e.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:a;var r=e===t?"on":"with";throw new Error("diff() called "+r+" non-document")}).join("")}),i=new s,u=r(n[0],n[1],e),c=l.iterator(this.ops),f=l.iterator(t.ops);return u.forEach(function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case r.INSERT:n=Math.min(f.peekLength(),e),i.push(f.next(n));break;case r.DELETE:n=Math.min(e,c.peekLength()),c.next(n),i.delete(n);break;case r.EQUAL:n=Math.min(c.peekLength(),f.peekLength(),e);var a=c.next(n),s=f.next(n);o(a.insert,s.insert)?i.retain(n,l.attributes.diff(a.attributes,s.attributes)):i.push(s).delete(n)}e-=n}}),i.chop()},s.prototype.eachLine=function(t,e){e=e||"\n";for(var n=l.iterator(this.ops),r=new s;n.hasNext();){if("insert"!==n.peekType())return;var o=n.peek(),i=l.length(o)-n.peekLength(),a="string"==typeof o.insert?o.insert.indexOf(e,i)-i:-1;a<0?r.push(n.next()):a>0?r.push(n.next(a)):(t(r,n.next(1).attributes||{}),r=new s)}r.length()>0&&t(r,{})},s.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=l.iterator(this.ops),r=l.iterator(t.ops),o=new s;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())o.push(r.next());else{var i=Math.min(n.peekLength(),r.peekLength()),a=n.next(i),u=r.next(i);if(a.delete)continue;u.delete?o.push(u):o.retain(i,l.attributes.transform(a.attributes,u.attributes,e))}else o.retain(l.length(n.next()));return o.chop()},s.prototype.transformPosition=function(t,e){e=!!e;for(var n=l.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(re.length?t:e,l=t.length>e.length?e:t,a=i.indexOf(l);if(a!=-1)return r=[[d,i.substring(0,a)],[y,l],[d,i.substring(a+l.length)]],t.length>e.length&&(r[0][0]=r[2][0]=h),r;if(1==l.length)return[[h,t],[d,e]];var u=s(t,e);if(u){var c=u[0],f=u[1],p=u[2],v=u[3],b=u[4],g=n(c,p),m=n(f,v);return g.concat([[y,b]],m)}return o(t,e)}function o(t,e){for(var n=t.length,r=e.length,o=Math.ceil((n+r)/2),l=o,a=2*o,s=new Array(a),u=new Array(a),c=0;cn)v+=2;else if(x>r)y+=2;else if(p){var k=l+f-_;if(k>=0&&k=E)return i(t,e,O,x)}}}for(var j=-m+b;j<=m-g;j+=2){var E,k=l+j;E=j==-m||j!=m&&u[k-1]n)g+=2;else if(A>r)b+=2;else if(!p){var w=l+f-j;if(w>=0&&w=E)return i(t,e,O,x)}}}}return[[h,t],[d,e]]}function i(t,e,r,o){var i=t.substring(0,r),l=e.substring(0,o),a=t.substring(r),s=e.substring(o),u=n(i,l),c=n(a,s);return u.concat(c)}function l(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),o=r,i=0;n=t.length?[r,o,i,s,f]:null}var r=t.length>e.length?t:e,o=t.length>e.length?e:t;if(r.length<4||2*o.lengthu[4].length?s:u:s;var c,f,p,h;t.length>e.length?(c=i[0],f=i[1],p=i[2],h=i[3]):(p=i[0],h=i[1],c=i[2],f=i[3]);var d=i[4];return[c,f,p,h,d]}function u(t){t.push([y,""]);for(var e,n=0,r=0,o=0,i="",s="";n1?(0!==r&&0!==o&&(e=l(s,i),0!==e&&(n-r-o>0&&t[n-r-o-1][0]==y?t[n-r-o-1][1]+=s.substring(0,e):(t.splice(0,0,[y,s.substring(0,e)]),n++),s=s.substring(e),i=i.substring(e)),e=a(s,i),0!==e&&(t[n][1]=s.substring(s.length-e)+t[n][1],s=s.substring(0,s.length-e),i=i.substring(0,i.length-e))),0===r?t.splice(n-o,r+o,[d,s]):0===o?t.splice(n-r,r+o,[h,i]):t.splice(n-r-o,r+o,[h,i],[d,s]),n=n-r-o+(r?1:0)+(o?1:0)+1):0!==n&&t[n-1][0]==y?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,o=0,r=0,i="",s=""}""===t[t.length-1][1]&&t.pop();var c=!1;for(n=1;n0&&r.splice(o+2,0,[l[0],a]),p(r,o,3)}return t}function p(t,e,n){for(var r=e+n-1;r>=0&&r>=e-1;r--)if(r+10?r:void 0},diff:function(t,e){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce(function(n,r){return o(t[r],e[r])||(n[r]=void 0===e[r]?null:e[r]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce(function(n,r){return void 0===t[r]&&(n[r]=e[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(t){return new r(t)},length:function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}};r.prototype.hasNext=function(){return this.peekLength()<1/0},r.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=l.length(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(n,t):o.insert=e.insert,o}return{retain:1/0}},r.prototype.peek=function(){return this.ops[this.index]},r.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},r.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.exports=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){return Object.keys(e).reduce(function(n,r){return null==t[r]?n:(e[r]===t[r]?n[r]=e[r]:Array.isArray(e[r])?e[r].indexOf(t[r])<0&&(n[r]=e[r].concat([t[r]])):n[r]=[e[r],t[r]],n)},{})}function a(t){return t.reduce(function(t,e){if(1===e.insert){var n=(0,k.default)(e.attributes);return delete n.image,t.insert({image:e.attributes.image},n)}if(null==e.attributes||e.attributes.list!==!0&&e.attributes.bullet!==!0||(e=(0,k.default)(e),e.attributes.list?e.attributes.list="ordered":(e.attributes.list="bullet",delete e.attributes.bullet)),"string"==typeof e.insert){var r=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(r,e.attributes)}return t.push(e)},new p.default)}Object.defineProperty(e,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function t(t,e){for(var n=0;n=r&&!a.endsWith("\n")&&(n=!0),e.scroll.insertAt(t,a);var c=e.scroll.line(t),f=u(c,2),p=f[0],h=f[1],y=(0,N.default)({},(0,O.bubbleFormats)(p));if(p instanceof w.default){var b=p.descendant(v.default.Leaf,h),g=u(b,1),m=g[0];y=(0,N.default)(y,(0,O.bubbleFormats)(m))}l=d.default.attributes.diff(y,l)||{}}else if("object"===s(o.insert)){var _=Object.keys(o.insert)[0];if(null==_)return t;e.scroll.insertAt(t,_,o.insert[_])}r+=i}return Object.keys(l).forEach(function(n){e.scroll.formatAt(t,i,n,l[n])}),t+i},0),t.reduce(function(t,n){return"number"==typeof n.delete?(e.scroll.deleteAt(t,n.delete),t):t+(n.retain||n.insert.length||1)},0),this.scroll.batch=!1,this.scroll.optimize(),this.update(t)}},{key:"deleteText",value:function(t,e){return this.scroll.deleteAt(t,e),this.update((new p.default).retain(t).delete(e))}},{key:"formatLine",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(o){var i=n.scroll.lines(t,Math.max(e,1)),l=e;i.forEach(function(e){var i=e.length();if(e instanceof g.default){var a=t-e.offset(n.scroll),s=e.newlineIndex(a+l)-a+1;e.formatAt(a,s,o,r[o])}else e.format(o,r[o]);l-=i})}),this.scroll.optimize(),this.update((new p.default).retain(t).retain(e,(0,k.default)(r)))}},{key:"formatText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e,o,r[o])}),this.update((new p.default).retain(t).retain(e,(0,k.default)(r)))}},{key:"getContents",value:function(t,e){return this.delta.slice(t,t+e)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(t,e){return t.concat(e.delta())},new p.default)}},{key:"getFormat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===e?this.scroll.path(t).forEach(function(t){var e=u(t,1),o=e[0];o instanceof w.default?n.push(o):o instanceof v.default.Leaf&&r.push(o)}):(n=this.scroll.lines(t,e),r=this.scroll.descendants(v.default.Leaf,t,e));var o=[n,r].map(function(t){if(0===t.length)return{};for(var e=(0,O.bubbleFormats)(t.shift());Object.keys(e).length>0;){var n=t.shift();if(null==n)return e;e=l((0,O.bubbleFormats)(n),e)}return e});return N.default.apply(N.default,o)}},{key:"getText",value:function(t,e){return this.getContents(t,e).filter(function(t){return"string"==typeof t.insert}).map(function(t){return t.insert}).join("")}},{key:"insertEmbed",value:function(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new p.default).retain(t).insert(o({},e,n)))}},{key:"insertText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e.length,o,r[o])}),this.update((new p.default).retain(t).insert(e,(0,k.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var t=this.scroll.children.head;return t.length()<=1&&0==Object.keys(t.formats()).length}},{key:"removeFormat",value:function(t,e){var n=this.getText(t,e),r=this.scroll.line(t+e),o=u(r,2),i=o[0],l=o[1],a=0,s=new p.default;null!=i&&(a=i instanceof g.default?i.newlineIndex(l)-l+1:i.length()-l,s=i.delta().slice(l,l+a-1).insert("\n"));var c=this.getContents(t,e+a),f=c.diff((new p.default).insert(n).concat(s)),h=(new p.default).retain(t).concat(f);return this.applyDelta(h)}},{key:"update",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=this.delta;return 1===n.length&&"characterData"===n[0].type&&v.default.find(n[0].target)?!function(){var i=v.default.find(n[0].target),l=(0,O.bubbleFormats)(i),a=i.offset(e.scroll),s=n[0].oldValue.replace(_.default.CONTENTS,""),u=(new p.default).insert(s),c=(new p.default).insert(i.value()),f=(new p.default).retain(a).concat(u.diff(c,r));t=f.reduce(function(t,e){return e.insert?t.insert(e.insert,l):t.push(e)},new p.default),e.delta=o.compose(t)}():(this.delta=this.getDelta(),t&&(0,j.default)(o.compose(t),this.delta)||(t=o.diff(this.delta,r))),t}}]),t}();e.default=q},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function t(t,e){for(var n=0;n=t+n)){var l=this.newlineIndex(t,!0)+1,a=i-l+1,s=this.isolate(l,a),u=s.next;s.format(r,o),u instanceof e&&u.formatAt(0,t-l+n-a,r,o)}}}},{key:"insertAt",value:function(t,e,n){if(null==n){var r=this.descendant(m.default,t),o=a(r,2),i=o[0],l=o[1];i.insertAt(l,e)}}},{key:"length",value:function t(){var t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}},{key:"newlineIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var n=this.domNode.textContent.slice(t).indexOf("\n");return n>-1?t+n:-1}},{key:"optimize",value:function(){this.domNode.textContent.endsWith("\n")||this.appendChild(h.default.create("text","\n")),u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this);var t=this.next;null!=t&&t.prev===this&&t.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===t.statics.formats(t.domNode)&&(t.optimize(),t.moveChildren(this),t.remove())}},{key:"replace",value:function(t){u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(t){var e=h.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof h.default.Embed?e.remove():e.unwrap()})}}],[{key:"create",value:function(t){var n=u(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t); -return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),e}(y.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",e.Code=_,e.default=O},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=(0,f.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:a(t.parent,e))}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BlockEmbed=e.bubbleFormats=void 0;var s=function(){function t(t,e){for(var n=0;n0&&(t1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-k)){var r=this.clone();return 0===t?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"split",this).call(this,t,n);return this.cache={},o}}]),e}(y.default.Block);j.blotName="block",j.tagName="P",j.defaultChild="break",j.allowedChildren=[O.default,m.default,x.default],e.bubbleFormats=a,e.BlockEmbed=E,e.default=j},25,function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n0){var t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}],[{key:"compare",value:function(t,n){var r=e.order.indexOf(t),o=e.order.indexOf(n);return r>=0||o>=0?r-o:t===n?0:t1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};n(this,t),this.quill=e,this.options=r};r.DEFAULTS={},e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:0;i(this,t),this.index=e,this.length=n},O=function(){function t(e,n){var r=this;i(this,t),this.emitter=n,this.scroll=e,this.composing=!1,this.root=this.scroll.domNode,this.root.addEventListener("compositionstart",function(){r.composing=!0}),this.root.addEventListener("compositionend",function(){r.composing=!1}),this.cursor=c.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),["keyup","mouseup","mouseleave","touchend","touchleave","focus","blur"].forEach(function(t){r.root.addEventListener(t,function(){setTimeout(r.update.bind(r,v.default.sources.USER),100)})}),this.emitter.on(v.default.events.EDITOR_CHANGE,function(t,e){t===v.default.events.TEXT_CHANGE&&e.length()>0&&r.update(v.default.sources.SILENT)}),this.emitter.on(v.default.events.SCROLL_BEFORE_UPDATE,function(){var t=r.getNativeRange();null!=t&&t.start.node!==r.cursor.textNode&&r.emitter.once(v.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(t){}})}),this.update(v.default.sources.SILENT)}return s(t,[{key:"focus",value:function(){if(!this.hasFocus()){var t=document.body.scrollTop;this.root.focus(),document.body.scrollTop=t,this.setRange(this.savedRange)}}},{key:"format",value:function(t,e){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!c.default.query(t,c.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=c.default.find(n.start.node,!1);if(null==r)return;if(r instanceof c.default.Leaf){var o=r.split(n.start.offset);r.parent.insertBefore(this.cursor,o)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;var r=void 0,o=void 0,i=this.scroll.leaf(t),l=a(i,2),s=l[0],u=l[1];if(null==s)return null;var c=s.position(u,!0),f=a(c,2);o=f[0],u=f[1];var p=document.createRange();if(e>0){p.setStart(o,u);var h=this.scroll.leaf(t+e),d=a(h,2);if(s=d[0],u=d[1],null==s)return null;var y=s.position(u,!0),v=a(y,2);o=v[0],u=v[1],p.setEnd(o,u),r=p.getBoundingClientRect()}else{var b="left",g=void 0;o instanceof Text?(u0&&(b="right")),r={height:g.height,left:g[b],width:0,top:g.top}}var m=this.root.parentNode.getBoundingClientRect();return{left:r.left-m.left,right:r.left+r.width-m.left,top:r.top-m.top,bottom:r.top+r.height-m.top,height:r.height,width:r.width}}},{key:"getNativeRange",value:function(){var t=document.getSelection();if(null==t||t.rangeCount<=0)return null;var e=t.getRangeAt(0);if(null==e)return null;if(!l(this.root,e.startContainer)||!e.collapsed&&!l(this.root,e.endContainer))return null;var n={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[n.start,n.end].forEach(function(t){for(var e=t.node,n=t.offset;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;e=e.lastChild,n=e instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n}),m.info("getNativeRange",n),n}},{key:"getRange",value:function(){var t=this,e=this.getNativeRange();if(null==e)return[null,null];var n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);var r=n.map(function(e){var n=a(e,2),r=n[0],o=n[1],i=c.default.find(r,!0),l=i.offset(t.scroll);return 0===o?l:i instanceof c.default.Container?l+i.length():l+i.index(r,o)}),i=Math.min.apply(Math,o(r)),l=Math.max.apply(Math,o(r));return[new _(i,l-i),e]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"scrollIntoView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.lastRange;if(null!=t){var e=this.getBounds(t.index,t.length);if(null!=e)if(this.root.offsetHeight2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(m.info("setNativeRange",t,e,n,r),null==t||null!=this.root.parentNode&&null!=t.parentNode&&null!=n.parentNode){var i=document.getSelection();if(null!=i)if(null!=t){this.hasFocus()||this.root.focus();var l=this.getNativeRange();if(null==l||o||t!==l.start.node||e!==l.start.offset||n!==l.end.node||r!==l.end.offset){var a=document.createRange();a.setStart(t,e),a.setEnd(n,r),i.removeAllRanges(),i.addRange(a)}}else i.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v.default.sources.API;"string"==typeof n&&(r=n,n=!1),m.info("setRange",t),null!=t?!function(){var r=t.collapsed?[t.index]:[t.index,t.index+t.length],i=[],l=e.scroll.length();r.forEach(function(t,n){t=Math.min(l-1,t);var r=void 0,o=e.scroll.leaf(t),s=a(o,2),u=s[0],c=s[1],f=u.position(c,0!==n),p=a(f,2);r=p[0],c=p[1],i.push(r,c)}),i.length<2&&(i=i.concat(i)),e.setNativeRange.apply(e,o(i).concat([n]))}():this.setNativeRange(null),this.update(r)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.default.sources.USER,e=void 0,n=this.lastRange,r=this.getRange(),o=a(r,2);if(this.lastRange=o[0],e=o[1],null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,d.default)(n,this.lastRange)){var i;!this.composing&&null!=e&&e.native.collapsed&&e.start.node!==this.cursor.textNode&&this.cursor.restore();var l=[v.default.events.SELECTION_CHANGE,(0,p.default)(this.lastRange),(0,p.default)(n),t];if((i=this.emitter).emit.apply(i,[v.default.events.EDITOR_CHANGE].concat(l)),t!==v.default.sources.SILENT){var s;(s=this.emitter).emit.apply(s,l)}}}}]),t}();e.Range=_,e.default=O},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0&&!(i instanceof y.BlockEmbed)&&!(f instanceof y.BlockEmbed)){f instanceof w.default&&f.deleteAt(f.length()-1,1);var p=f.children.head instanceof g.default?null:f.children.head;i.moveChildren(f,p),i.remove()}this.optimize()}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function(t,n,r,o){(null==this.whitelist||this.whitelist[r])&&(c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,r,o),this.optimize())}},{key:"insertAt",value:function(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==p.default.query(n,p.default.Scope.BLOCK)){var o=p.default.create(this.statics.defaultChild);this.appendChild(o),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),o.insertAt(0,n,r)}else{var i=p.default.create(n,r);this.appendChild(i)}else c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r);this.optimize()}}},{key:"insertBefore",value:function(t,n){if(t.statics.scope===p.default.Scope.INLINE_BLOT){var r=p.default.create(this.statics.defaultChild);r.appendChild(t),t=r}c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n)}},{key:"leaf",value:function(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function(t){return t===this.length()?this.line(t-1):this.descendant(a,t)}},{key:"lines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,n=function t(e,n,r){var o=[],i=r;return e.children.forEachAt(n,r,function(e,n,r){a(e)?o.push(e):e instanceof p.default.Container&&(o=o.concat(t(e,n,i))),i-=r}),o};return n(this,t,e)}},{key:"optimize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.batch!==!0&&(c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t),t.length>0&&this.emitter.emit(d.default.events.SCROLL_OPTIMIZE,t))}},{key:"path",value:function(t){return c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){if(this.batch!==!0){var n=d.default.sources.USER;"string"==typeof t&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(d.default.events.SCROLL_BEFORE_UPDATE,n,t),c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"update",this).call(this,t.concat([])),t.length>0&&this.emitter.emit(d.default.events.SCROLL_UPDATE,n,t)}}}]),e}(p.default.Scroll);x.blotName="scroll",x.className="ql-editor",x.tagName="DIV",x.defaultChild="block",x.allowedChildren=[v.default,y.BlockEmbed,_.default],e.default=x},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e=0&&n.length-1}function p(t,e,n){return n.compose((new k.default).retain(n.length(),o({},t,!0)))}function h(t,e){var n=j.default.Attributor.Attribute.keys(t),r=j.default.Attributor.Class.keys(t),o=j.default.Attributor.Style.keys(t),i={};return n.concat(r).concat(o).forEach(function(e){var n=j.default.query(e,j.default.Scope.ATTRIBUTE);null!=n&&(i[n.attrName]=n.value(t),i[n.attrName])||(null!=H[e]&&(n=H[e],i[n.attrName]=n.value(t)),null!=F[e]&&(n=F[e],i[n.attrName]=n.value(t)))}),Object.keys(i).length>0&&(e=e.compose((new k.default).retain(e.length(),i))),e}function d(t,e){var n=j.default.query(t);if(null==n)return e;if(n.prototype instanceof j.default.Embed){var r={},i=n.value(t);null!=i&&(r[n.blotName]=i,e=(new k.default).insert(r,n.formats(t)))}else if("function"==typeof n.formats){var l=o({},n.blotName,n.formats(t));e=e.compose((new k.default).retain(e.length(),l))}return e}function y(t,e){return c(e,"\n")||e.insert("\n"),e}function v(){return new k.default}function b(t,e){return f(t)&&!c(e,"\n")&&e.insert("\n"),e}function g(t,e){if(f(t)&&null!=t.nextElementSibling&&!c(e,"\n\n")){var n=t.offsetHeight+parseFloat(u(t).marginTop)+parseFloat(u(t).marginBottom);t.nextElementSibling.offsetTop>t.offsetTop+1.5*n&&e.insert("\n")}return e}function m(t,e){var n={},r=t.style||{};return r.fontWeight&&"bold"===u(t).fontWeight&&(n.bold=!0),Object.keys(n).length>0&&(e=e.compose((new k.default).retain(e.length(),n))),parseFloat(r.textIndent||0)>0&&(e=(new k.default).insert("\t").concat(e)),e}function _(t,e){var n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(!u(t.parentNode).whiteSpace.startsWith("pre")){var r=function(t,e){return e=e.replace(/[^\u00a0]/g,""),e.length<1&&t?" ":e};n=n.replace(/\r\n/g," ").replace(/\n/g," "),n=n.replace(/\s\s+/g,r.bind(r,!0)),(null==t.previousSibling&&f(t.parentNode)||null!=t.previousSibling&&f(t.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==t.nextSibling&&f(t.parentNode)||null!=t.nextSibling&&f(t.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return e.insert(n)}Object.defineProperty(e,"__esModule",{value:!0}),e.matchText=e.matchSpacing=e.matchNewline=e.matchBlot=e.matchAttributor=e.default=void 0;var O=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),w=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:N.default.sources.API;if("string"==typeof t)return this.quill.setContents(this.convert(t),e);var r=this.convert(e);return this.quill.updateContents((new k.default).retain(t).concat(r),n)}},{key:"onPaste",value:function(t){var e=this;if(!t.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=(new k.default).retain(n.index).delete(n.length),o=document.body.scrollTop;this.container.focus(),setTimeout(function(){e.quill.selection.update(N.default.sources.SILENT),r=r.concat(e.convert()),e.quill.updateContents(r,N.default.sources.USER),e.quill.setSelection(r.length()-n.length,N.default.sources.SILENT),document.body.scrollTop=o,e.quill.selection.scrollIntoView()},1)}}}]),e}(S.default);K.DEFAULTS={matchers:[]},e.default=K,e.matchAttributor=h,e.matchBlot=d,e.matchNewline=b,e.matchSpacing=g,e.matchText=_},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.AlignStyle=e.AlignClass=e.AlignAttribute=void 0;var o=n(2),i=r(o),l={scope:i.default.Scope.BLOCK,whitelist:["right","center","justify"]},a=new i.default.Attributor.Attribute("align","align",l),s=new i.default.Attributor.Class("align","ql-align",l),u=new i.default.Attributor.Style("align","text-align",l);e.AlignAttribute=a,e.AlignClass=s,e.AlignStyle=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.BackgroundStyle=e.BackgroundClass=void 0;var o=n(2),i=r(o),l=n(51),a=new i.default.Attributor.Class("background","ql-bg",{scope:i.default.Scope.INLINE}),s=new l.ColorAttributor("background","background-color",{scope:i.default.Scope.INLINE});e.BackgroundClass=a,e.BackgroundStyle=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorStyle=e.ColorClass=e.ColorAttributor=void 0;var a=function(){function t(t,e){for(var n=0;nr&&this.stack.undo.length>0){var o=this.stack.undo.pop();n=n.compose(o.undo),t=o.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(t){this.stack.undo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}),this.stack.redo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),e}(y.default);v.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=v,e.getLastChangeIndex=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(0!==t.index){var n=this.quill.scroll.line(t.index),r=y(n,1),o=r[0],i={};if(0===e.offset){var l=o.formats(),a=this.quill.getFormat(t.index-1,1);i=k.default.attributes.diff(l,a)||{}}this.quill.deleteText(t.index-1,1,N.default.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(t.index-1,1,i,N.default.sources.USER),this.quill.selection.scrollIntoView()}}function s(t){t.index>=this.quill.getLength()-1||this.quill.deleteText(t.index,1,N.default.sources.USER)}function u(t){this.quill.deleteText(t,N.default.sources.USER),this.quill.setSelection(t.index,N.default.sources.SILENT),this.quill.selection.scrollIntoView()}function c(t,e){var n=this;t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);var r=Object.keys(e.format).reduce(function(t,n){return j.default.query(n,j.default.Scope.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t},{});this.quill.insertText(t.index,"\n",r,N.default.sources.USER),this.quill.selection.scrollIntoView(),Object.keys(e.format).forEach(function(t){null==r[t]&&(Array.isArray(e.format[t])||"link"!==t&&n.quill.format(t,e.format[t],N.default.sources.USER))})}function f(t){return{key:M.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(e){var n=j.default.query("code-block"),r=e.index,o=e.length,i=this.quill.scroll.descendant(n,r),l=y(i,2),a=l[0],s=l[1];if(null!=a){var u=this.quill.scroll.offset(a),c=a.newlineIndex(s,!0)+1,f=a.newlineIndex(u+s+o),p=a.domNode.textContent.slice(c,f).split("\n");s=0,p.forEach(function(e,i){t?(a.insertAt(c+s,n.TAB),s+=n.TAB.length,0===i?r+=n.TAB.length:o+=n.TAB.length):e.startsWith(n.TAB)&&(a.deleteAt(c+s,n.TAB.length),s-=n.TAB.length,0===i?r-=n.TAB.length:o-=n.TAB.length),s+=e.length+1}),this.quill.update(N.default.sources.USER),this.quill.setSelection(r,o,N.default.sources.SILENT)}}}}function p(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],N.default.sources.USER)}}}function h(t){if("string"==typeof t||"number"==typeof t)return h({key:t});if("object"===("undefined"==typeof t?"undefined":d(t))&&(t=(0,g.default)(t,!1)),"string"==typeof t.key)if(null!=M.keys[t.key.toUpperCase()])t.key=M.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t}Object.defineProperty(e,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),v=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=h(t);return null==r||null==r.key?L.warn("Attempted to add invalid keyboard binding",r):("function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),r=(0,w.default)(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],void this.bindings[r.key].push(r))}},{key:"listen",value:function(){var t=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var r=n.which||n.keyCode,o=(t.bindings[r]||[]).filter(function(t){return e.match(n,t)});if(0!==o.length){var i=t.quill.getSelection();if(null!=i&&t.quill.hasFocus()){var l=t.quill.scroll.line(i.index),a=y(l,2),s=a[0],u=a[1],c=t.quill.scroll.leaf(i.index),f=y(c,2),p=f[0],h=f[1],v=0===i.length?[p,h]:t.quill.scroll.leaf(i.index+i.length),b=y(v,2),g=b[0],m=b[1],O=p instanceof j.default.Text?p.value().slice(0,h):"",w=g instanceof j.default.Text?g.value().slice(m):"",x={collapsed:0===i.length,empty:0===i.length&&s.length()<=1,format:t.quill.getFormat(i),offset:u,prefix:O,suffix:w},k=o.some(function(e){if(null!=e.collapsed&&e.collapsed!==x.collapsed)return!1;if(null!=e.empty&&e.empty!==x.empty)return!1;if(null!=e.offset&&e.offset!==x.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(function(t){return null==x.format[t]}))return!1}else if("object"===d(e.format)&&!Object.keys(e.format).every(function(t){return e.format[t]===!0?null!=x.format[t]:e.format[t]===!1?null==x.format[t]:(0,_.default)(e.format[t],x.format[t])}))return!1;return!(null!=e.prefix&&!e.prefix.test(x.prefix))&&(!(null!=e.suffix&&!e.suffix.test(x.suffix))&&e.handler.call(t,i,x)!==!0)});k&&n.preventDefault()}}}})}}]),e}(S.default);M.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},M.DEFAULTS={bindings:{bold:p("bold"),italic:p("italic"),underline:p("underline"),indent:{key:M.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){return!(!e.collapsed||0===e.offset)||void this.quill.format("indent","+1",N.default.sources.USER)}},outdent:{key:M.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){return!(!e.collapsed||0===e.offset)||void this.quill.format("indent","-1",N.default.sources.USER)}},"outdent backspace":{key:M.keys.BACKSPACE,collapsed:!0,format:["blockquote","indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",N.default.sources.USER):null!=e.format.blockquote?this.quill.format("blockquote",!1,N.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,N.default.sources.USER)}},"indent code-block":f(!0),"outdent code-block":f(!1),"remove tab":{key:M.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,N.default.sources.USER)}},tab:{key:M.keys.TAB,handler:function(t,e){e.collapsed||this.quill.scroll.deleteAt(t.index,t.length),this.quill.insertText(t.index,"\t",N.default.sources.USER),this.quill.setSelection(t.index+1,N.default.sources.SILENT)}},"list empty enter":{key:M.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,N.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,N.default.sources.USER)}},"header enter":{key:M.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t){this.quill.scroll.insertAt(t.index,"\n"),this.quill.formatText(t.index+1,1,"header",!1,N.default.sources.USER),this.quill.setSelection(t.index+1,N.default.sources.SILENT),this.quill.selection.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^(1\.|-)$/,handler:function(t,e){var n=e.prefix.length;this.quill.scroll.deleteAt(t.index-n,n),this.quill.formatLine(t.index-n,1,"list",1===n?"bullet":"ordered",N.default.sources.USER),this.quill.setSelection(t.index-n,N.default.sources.SILENT)}}}},e.default=M},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var a=function(){function t(t,e){for(var n=0;n0&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return o({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(t,n){if(t instanceof v)u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n);else{var r=null==n?this.length():n.offset(this),o=this.split(r);o.parent.insertBefore(t,o)}}},{key:"optimize",value:function(){u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this);var t=this.next;null!=t&&t.prev===this&&t.statics.blotName===this.statics.blotName&&t.domNode.tagName===this.domNode.tagName&&(t.moveChildren(this),t.remove())}},{key:"replace",value:function(t){if(t.statics.blotName!==this.statics.blotName){var n=f.default.create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t)}}],[{key:"create",value:function(t){return"ordered"===t?t="OL":"bullet"===t&&(t="UL"),u(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t)}},{key:"formats",value:function(t){return"OL"===t.tagName?"ordered":"UL"===t.tagName?"bullet":void 0}}]),e}(y.default);b.blotName="list",b.scope=f.default.Scope.BLOCK_BLOT,b.tagName=["OL","UL"],b.defaultChild="list-item",b.allowedChildren=[v],e.ListItem=v,e.default=b},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n-1}Object.defineProperty(e,"__esModule",{value:!0}),e.sanitize=e.default=void 0;var s=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=s(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"==typeof t&&n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return p.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,f.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(c.default);h.blotName="image",h.tagName="IMG",e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=s(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return p.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"sanitize",value:function(t){return f.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(u.BlockEmbed);h.blotName="video",h.className="ql-video",h.tagName="IFRAME",e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(){if(null==window.katex)throw new Error("Formula module requires KaTeX.");h.default.register(d,!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var s=function(){function t(t,e){for(var n=0;n0||null==this.cachedHTML)&&(this.domNode.innerHTML=t(e),this.attach()),this.cachedHTML=this.domNode.innerHTML}}}]),e}(v.default);b.className="ql-syntax";var g=new c.default.Attributor.Class("token","hljs",{scope:c.default.Scope.INLINE}),m=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if("function"!=typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");p.default.register(g,!0),p.default.register(b,!0);var l=null;return r.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){null==l&&(l=setTimeout(function(){r.highlight(),l=null},100))}),r.highlight(),r}return l(e,t),a(e,[{key:"highlight",value:function(){var t=this;if(!this.quill.selection.composing){var e=this.quill.getSelection();this.quill.scroll.descendants(b).forEach(function(e){e.highlight(t.options.highlight)}),this.quill.update(p.default.sources.SILENT),null!=e&&this.quill.setSelection(e,p.default.sources.SILENT)}}}]),e}(d.default);m.DEFAULTS={highlight:function(){return null==window.hljs?null:function(t){var e=window.hljs.highlightAuto(t);return e.value}}()},e.CodeBlock=b,e.CodeToken=g,e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e,n){var r=document.createElement("button");r.setAttribute("type","button"),r.classList.add("ql-"+e),null!=n&&(r.value=n),t.appendChild(r)}function u(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(function(e){var n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(function(t){if("string"==typeof t)s(n,t);else{var e=Object.keys(t)[0],r=t[e];Array.isArray(r)?c(n,e,r):s(n,e,r)}}),t.appendChild(n)})}function c(t,e,n){var r=document.createElement("select");r.classList.add("ql-"+e),n.forEach(function(t){var e=document.createElement("option");t!==!1?e.setAttribute("value",t):e.setAttribute("selected","selected"),r.appendChild(e)}),t.appendChild(r)}Object.defineProperty(e,"__esModule",{value:!0}),e.addControls=e.default=void 0;var f=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(){function t(t,e){for(var n=0;n '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '; -},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(t!==n)if(null!=n&&n.classList.remove("ql-selected"),null!=t){if(t.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":i(Event))){var r=document.createEvent("Event");r.initEvent("change",!0,!0),this.select.dispatchEvent(r)}this.close()}}else this.label.removeAttribute("data-value"),this.label.removeAttribute("data-label")}},{key:"update",value:function(){var t=void 0;if(this.select.selectedIndex>-1){var e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);var n=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),t}();e.default=u},function(t,e){t.exports=' '},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n=this.quill.root.offsetHeight)}},{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(t){var e=t.left+t.width/2-this.root.offsetWidth/2,n=t.bottom+this.quill.root.scrollTop;this.root.style.left=e+"px",this.root.style.top=n+"px";var r=this.boundsContainer.getBoundingClientRect(),o=this.root.getBoundingClientRect(),i=0;return o.right>r.right&&(i=r.right-o.right,this.root.style.left=e+i+"px"),o.left0){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var n=r.quill.scroll.lines(e.index,e.length);if(1===n.length)r.position(r.quill.getBounds(e));else{var o=n[n.length-1],i=o.offset(r.quill.scroll),l=Math.min(o.length()-1,e.index+e.length-i),a=r.quill.getBounds(new y.Range(i,l));r.position(a)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}),r}return l(e,t),s(e,[{key:"listen",value:function(){var t=this;a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){t.root.classList.remove("ql-editing")}),this.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!t.root.classList.contains("ql-hidden")){var e=t.quill.getSelection();null!=e&&t.position(t.quill.getBounds(e))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var n=a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"position",this).call(this,t),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",0===n?n:void(r.style.marginLeft=-1*n-r.offsetWidth/2+"px")}}]),e}(h.BaseTooltip);_.TEMPLATE=['','
    ','','',"
    "].join(""),e.BubbleTooltip=_,e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(function(e){var r=document.createElement("option");e===n?r.setAttribute("selected","selected"):r.setAttribute("value",e),t.appendChild(r)})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var s=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||""),this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function(){var t=this.quill.root.scrollTop;this.quill.focus(),this.quill.root.scrollTop=t}},{key:"save",value:function(){var t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,y.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,y.default.sources.USER)),this.quill.root.scrollTop=e;break;case"video":var n=t.match(/^(https?):\/\/(www\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(https?):\/\/(www\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);n?t=n[1]+"://www.youtube.com/embed/"+n[3]+"?showinfo=0":(n=t.match(/^(https?):\/\/(www\.)?vimeo\.com\/(\d+)/))&&(t=n[1]+"://player.vimeo.com/video/"+n[3]+"/");case"formula":var r=this.quill.getSelection(!0),o=r.index+r.length;null!=r&&(this.quill.insertEmbed(o,this.root.getAttribute("data-mode"),t,y.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(o+1," ",y.default.sources.USER),this.quill.setSelection(o+2,y.default.sources.USER))}this.textbox.value="",this.hide()}}]),e}(A.default);e.BaseTooltip=C,e.default=L},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0); -}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},u=function(){function t(t,e){for(var n=0;n','','',''].join(""),e.default=w},function(t,e,n,r,o){function i(t){return null===t||void 0===t}function l(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function a(t,e,n){var r,o;if(i(t)||i(e))return!1;if(t.prototype!==e.prototype)return!1;if(c(t))return!!c(e)&&(t=s.call(t),e=s.call(e),f(t,e,n));if(l(t)){if(!l(e))return!1;if(t.length!==e.length)return!1;for(r=0;r=0;r--)if(a[r]!=p[r])return!1;for(r=a.length-1;r>=0;r--)if(o=a[r],!f(t[o],e[o],n))return!1;return typeof t==typeof e}var s=Array.prototype.slice,u=n(r),c=n(o),f=t.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:a(t,e,n))}}]))}); +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Quill=e():t.Quill=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=45)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17),o=n(18),i=n(19),l=n(48),a=n(49),s=n(50),u=n(51),c=n(52),f=n(11),h=n(29),p=n(30),d=n(28),y=n(1),v={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:r.default,Format:o.default,Leaf:i.default,Embed:u.default,Scroll:l.default,Block:s.default,Inline:a.default,Text:c.default,Attributor:{Attribute:f.default,Class:h.default,Style:p.default,Store:d.default}};e.default=v},function(t,e,n){"use strict";function r(t,e){var n=i(t);if(null==n)throw new s("Unable to create "+t+" blot");var r=n;return new r(t instanceof Node||t.nodeType===Node.TEXT_NODE?t:r.create(e),e)}function o(t,n){return void 0===n&&(n=!1),null==t?null:null!=t[e.DATA_KEY]?t[e.DATA_KEY].blot:n?o(t.parentNode,n):null}function i(t,e){void 0===e&&(e=p.ANY);var n;if("string"==typeof t)n=h[t]||u[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)n=h.text;else if("number"==typeof t)t&p.LEVEL&p.BLOCK?n=h.block:t&p.LEVEL&p.INLINE&&(n=h.inline);else if(t instanceof HTMLElement){var r=(t.getAttribute("class")||"").split(/\s+/);for(var o in r)if(n=c[r[o]])break;n=n||f[t.tagName]}return null==n?null:e&p.LEVEL&n.scope&&e&p.TYPE&n.scope?n:null}function l(){for(var t=[],e=0;e1)return t.map(function(t){return l(t)});var n=t[0];if("string"!=typeof n.blotName&&"string"!=typeof n.attrName)throw new s("Invalid definition");if("abstract"===n.blotName)throw new s("Cannot register abstract class");if(h[n.blotName||n.attrName]=n,"string"==typeof n.keyName)u[n.keyName]=n;else if(null!=n.className&&(c[n.className]=n),null!=n.tagName){Array.isArray(n.tagName)?n.tagName=n.tagName.map(function(t){return t.toUpperCase()}):n.tagName=n.tagName.toUpperCase();var r=Array.isArray(n.tagName)?n.tagName:[n.tagName];r.forEach(function(t){null!=f[t]&&null!=n.className||(f[t]=n)})}return n}var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){function e(e){var n=this;return e="[Parchment] "+e,n=t.call(this,e)||this,n.message=e,n.name=n.constructor.name,n}return a(e,t),e}(Error);e.ParchmentError=s;var u={},c={},f={},h={};e.DATA_KEY="__blot";var p;!function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(p=e.Scope||(e.Scope={})),e.create=r,e.find=o,e.query=i,e.register=l},function(t,e){"use strict";var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===r.call(t)},i=function(t){if(!t||"[object Object]"!==r.call(t))return!1;var e=n.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!e&&!o)return!1;var i;for(i in t);return void 0===i||n.call(t,i)};t.exports=function t(){var e,n,r,l,a,s,u=arguments[0],c=1,f=arguments.length,h=!1;for("boolean"==typeof u&&(h=u,u=arguments[1]||{},c=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});c1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=(0,f.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:a(t.parent,e))}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BlockEmbed=e.bubbleFormats=void 0;var s=function(){function t(t,e){for(var n=0;n0&&(t1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-1)){var r=this.clone();return 0===t?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"split",this).call(this,t,n);return this.cache={},o}}]),e}(y.default.Block);x.blotName="block",x.tagName="P",x.defaultChild="break",x.allowedChildren=[m.default,y.default.Embed,O.default],e.bubbleFormats=a,e.BlockEmbed=w,e.default=x},function(t,e,n){var r=n(54),o=n(12),i=n(2),l=n(20),a=String.fromCharCode(0),s=function(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]};s.prototype.insert=function(t,e){var n={};return 0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},s.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},s.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},s.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=i(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,"object"!=typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(o(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},s.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},s.prototype.filter=function(t){return this.ops.filter(t)},s.prototype.forEach=function(t){this.ops.forEach(t)},s.prototype.map=function(t){return this.ops.map(t)},s.prototype.partition=function(t){var e=[],n=[];return this.forEach(function(r){(t(r)?e:n).push(r)}),[e,n]},s.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},s.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+l.length(e):e.delete?t-e.delete:t},0)},s.prototype.length=function(){return this.reduce(function(t,e){return t+l.length(e)},0)},s.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var n=[],r=l.iterator(this.ops),o=0;o0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},s.prototype.diff=function(t,e){if(this.ops===t.ops)return new s;var n=[this,t].map(function(e){return e.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:a;var r=e===t?"on":"with";throw new Error("diff() called "+r+" non-document")}).join("")}),i=new s,u=r(n[0],n[1],e),c=l.iterator(this.ops),f=l.iterator(t.ops);return u.forEach(function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case r.INSERT:n=Math.min(f.peekLength(),e),i.push(f.next(n));break;case r.DELETE:n=Math.min(e,c.peekLength()),c.next(n),i.delete(n);break;case r.EQUAL:n=Math.min(c.peekLength(),f.peekLength(),e);var a=c.next(n),s=f.next(n);o(a.insert,s.insert)?i.retain(n,l.attributes.diff(a.attributes,s.attributes)):i.push(s).delete(n)}e-=n}}),i.chop()},s.prototype.eachLine=function(t,e){e=e||"\n";for(var n=l.iterator(this.ops),r=new s,o=0;n.hasNext();){if("insert"!==n.peekType())return;var i=n.peek(),a=l.length(i)-n.peekLength(),u="string"==typeof i.insert?i.insert.indexOf(e,a)-a:-1;if(u<0)r.push(n.next());else if(u>0)r.push(n.next(u));else{if(!1===t(r,n.next(1).attributes||{},o))return;o+=1,r=new s}}r.length()>0&&t(r,{},o)},s.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=l.iterator(this.ops),r=l.iterator(t.ops),o=new s;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())o.push(r.next());else{var i=Math.min(n.peekLength(),r.peekLength()),a=n.next(i),u=r.next(i);if(a.delete)continue;u.delete?o.push(u):o.retain(i,l.attributes.transform(a.attributes,u.attributes,e))}else o.retain(l.length(n.next()));return o.chop()},s.prototype.transformPosition=function(t,e){e=!!e;for(var n=l.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(t,n){var r=e.order.indexOf(t),o=e.order.indexOf(n);return r>=0||o>=0?r-o:t===n?0:t0){var a,s=[g.default.events.TEXT_CHANGE,l,i,e];if((a=this.emitter).emit.apply(a,[g.default.events.EDITOR_CHANGE].concat(s)),e!==g.default.sources.SILENT){var c;(c=this.emitter).emit.apply(c,s)}}return l}function s(t,e,n,r,o){var i={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(o=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(o=r,r=n,n=e,e=0),"object"===(void 0===n?"undefined":c(n))?(i=n,o=r):"string"==typeof n&&(null!=r?i[n]=r:o=n),o=o||g.default.sources.API,[t,e,i,o]}function u(t,e,n,r){if(null==t)return null;var o=void 0,i=void 0;if(e instanceof d.default){var l=[t.index,t.index+t.length].map(function(t){return e.transformPosition(t,r!==g.default.sources.USER)}),a=f(l,2);o=a[0],i=a[1]}else{var s=[t.index,t.index+t.length].map(function(t){return t=0?t+n:Math.max(e,t+n)}),u=f(s,2);o=u[0],i=u[1]}return new x.Range(o,i-o)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=void 0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(i(this,t),this.options=l(e,r),this.container=this.options.container,null==this.container)return P.error("Invalid Quill container",e);this.options.debug&&t.debug(this.options.debug);var o=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new g.default,this.scroll=w.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new v.default(this.scroll),this.selection=new k.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(g.default.events.EDITOR_CHANGE,function(t){t===g.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(g.default.events.SCROLL_UPDATE,function(t,e){var r=n.selection.lastRange,o=r&&0===r.length?r.index:void 0;a.call(n,function(){return n.editor.update(null,e,o)},t)});var s=this.clipboard.convert("
    "+o+"


    ");this.setContents(s),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return h(t,null,[{key:"debug",value:function(t){!0===t&&(t="log"),A.default.level(t)}},{key:"find",value:function(t){return t.__quill||w.default.find(t)}},{key:"import",value:function(t){return null==this.imports[t]&&P.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){var o=t.attrName||t.blotName;"string"==typeof o?this.register("formats/"+o,t,e):Object.keys(t).forEach(function(r){n.register(r,t[r],e)})}else null==this.imports[t]||r||P.warn("Overwriting "+t+" with",e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName?w.default.register(e):t.startsWith("modules")&&"function"==typeof e.register&&e.register()}}]),h(t,[{key:"addContainer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){var n=t;t=document.createElement("div"),t.classList.add(n)}return this.container.insertBefore(t,e),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,n){var r=this,o=s(t,e,n),i=f(o,4);return t=i[0],e=i[1],n=i[3],a.call(this,function(){return r.editor.deleteText(t,e)},n,t,-1*e)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}},{key:"focus",value:function(){var t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}},{key:"format",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g.default.sources.API;return a.call(this,function(){var r=n.getSelection(!0),i=new d.default;if(null==r)return i;if(w.default.query(t,w.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,o({},t,e));else{if(0===r.length)return n.selection.format(t,e),i;i=n.editor.formatText(r.index,r.length,o({},t,e))}return n.setSelection(r,g.default.sources.SILENT),i},r)}},{key:"formatLine",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,e,n,r,o),c=f(u,4);return t=c[0],e=c[1],l=c[2],o=c[3],a.call(this,function(){return i.editor.formatLine(t,e,l)},o,t,0)}},{key:"formatText",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,e,n,r,o),c=f(u,4);return t=c[0],e=c[1],l=c[2],o=c[3],a.call(this,function(){return i.editor.formatText(t,e,l)},o,t,0)}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=void 0;n="number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:"getContents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=s(t,e),r=f(n,2);return t=r[0],e=r[1],this.editor.getContents(t,e)}},{key:"getFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}},{key:"getIndex",value:function(t){return t.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(t){return this.scroll.leaf(t)}},{key:"getLine",value:function(t){return this.scroll.line(t)}},{key:"getLines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=s(t,e),r=f(n,2);return t=r[0],e=r[1],this.editor.getText(t,e)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.sources.API;return a.call(this,function(){return o.editor.insertEmbed(e,n,r)},i,e)}},{key:"insertText",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,0,n,r,o),c=f(u,4);return t=c[0],l=c[2],o=c[3],a.call(this,function(){return i.editor.insertText(t,e,l)},o,t,e.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}},{key:"removeFormat",value:function(t,e,n){var r=this,o=s(t,e,n),i=f(o,4);return t=i[0],e=i[1],n=i[3],a.call(this,function(){return r.editor.removeFormat(t,e)},n,t)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API;return a.call(this,function(){t=new d.default(t);var n=e.getLength(),r=e.editor.deleteText(0,n),o=e.editor.applyDelta(t),i=o.ops[o.ops.length-1];return null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(e.editor.deleteText(e.getLength()-1,1),o.delete(1)),r.compose(o)},n)}},{key:"setSelection",value:function(e,n,r){if(null==e)this.selection.setRange(null,n||t.sources.API);else{var o=s(e,n,r),i=f(o,4);e=i[0],n=i[1],r=i[3],this.selection.setRange(new x.Range(e,n),r),r!==g.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API,n=(new d.default).insert(t);return this.setContents(n,e)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.default.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}},{key:"updateContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API;return a.call(this,function(){return t=new d.default(t),e.editor.applyDelta(t,n)},n,!0)}}]),t}();S.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},S.events=g.default.events,S.sources=g.default.sources,S.version="1.3.6",S.imports={delta:d.default,parchment:w.default,"core/module":_.default,"core/theme":T.default},e.expandConfig=l,e.overload=s,e.default=S},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),this.quill=e,this.options=n};o.DEFAULTS={},e.default=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=n(0),a=function(t){return t&&t.__esModule?t:{default:t}}(l),s=function(t){function e(){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),e}(a.default.Text);e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n1?e-1:0),r=1;r1?n-1:0),o=1;o-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=o},function(t,e,n){function r(t){return null===t||void 0===t}function o(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function i(t,e,n){var i,c;if(r(t)||r(e))return!1;if(t.prototype!==e.prototype)return!1;if(s(t))return!!s(e)&&(t=l.call(t),e=l.call(e),u(t,e,n));if(o(t)){if(!o(e))return!1;if(t.length!==e.length)return!1;for(i=0;i=0;i--)if(f[i]!=h[i])return!1;for(i=f.length-1;i>=0;i--)if(c=f[i],!u(t[c],e[c],n))return!1;return typeof t==typeof e}var l=Array.prototype.slice,a=n(55),s=n(56),u=t.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:i(t,e,n))}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function t(t,e){for(var n=0;n=t+n)){var l=this.newlineIndex(t,!0)+1,a=i-l+1,s=this.isolate(l,a),u=s.next;s.format(r,o),u instanceof e&&u.formatAt(0,t-l+n-a,r,o)}}}},{key:"insertAt",value:function(t,e,n){if(null==n){var r=this.descendant(m.default,t),o=a(r,2),i=o[0],l=o[1];i.insertAt(l,e)}}},{key:"length",value:function(){var t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}},{key:"newlineIndex",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var e=this.domNode.textContent.slice(t).indexOf("\n");return e>-1?t+e:-1}},{key:"optimize",value:function(t){this.domNode.textContent.endsWith("\n")||this.appendChild(p.default.create("text","\n")),u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(t),n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(t){var e=p.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof p.default.Embed?e.remove():e.unwrap()})}}],[{key:"create",value:function(t){var n=u(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),e}(y.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",e.Code=_,e.default=O},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n-1}Object.defineProperty(e,"__esModule",{value:!0}),e.sanitize=e.default=void 0;var a=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(t!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":l(Event))){var r=document.createEvent("Event");r.initEvent("change",!0,!0),this.select.dispatchEvent(r)}this.close()}}},{key:"update",value:function(){var t=void 0;if(this.select.selectedIndex>-1){var e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);var n=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),t}();e.default=p},function(t,e,n){"use strict";function r(t){var e=a.find(t);if(null==e)try{e=a.create(t)}catch(n){e=a.create(a.Scope.INLINE),[].slice.call(t.childNodes).forEach(function(t){e.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(e.domNode,t),e.attach()}return e}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(47),l=n(27),a=n(1),s=function(t){function e(e){var n=t.call(this,e)||this;return n.build(),n}return o(e,t),e.prototype.appendChild=function(t){this.insertBefore(t)},e.prototype.attach=function(){t.prototype.attach.call(this),this.children.forEach(function(t){t.attach()})},e.prototype.build=function(){var t=this;this.children=new i.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(e){try{var n=r(e);t.insertBefore(n,t.children.head||void 0)}catch(t){if(t instanceof a.ParchmentError)return;throw t}})},e.prototype.deleteAt=function(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,function(t,e,n){t.deleteAt(e,n)})},e.prototype.descendant=function(t,n){var r=this.children.find(n),o=r[0],i=r[1];return null==t.blotName&&t(o)||null!=t.blotName&&o instanceof t?[o,i]:o instanceof e?o.descendant(t,i):[null,-1]},e.prototype.descendants=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE);var o=[],i=r;return this.children.forEachAt(n,r,function(n,r,l){(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&o.push(n),n instanceof e&&(o=o.concat(n.descendants(t,r,i))),i-=l}),o},e.prototype.detach=function(){this.children.forEach(function(t){t.detach()}),t.prototype.detach.call(this)},e.prototype.formatAt=function(t,e,n,r){this.children.forEachAt(t,e,function(t,e,o){t.formatAt(e,o,n,r)})},e.prototype.insertAt=function(t,e,n){var r=this.children.find(t),o=r[0],i=r[1];if(o)o.insertAt(i,e,n);else{var l=null==n?a.create("text",e):a.create(e,n);this.appendChild(l)}},e.prototype.insertBefore=function(t,e){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(e){return t instanceof e}))throw new a.ParchmentError("Cannot insert "+t.statics.blotName+" into "+this.statics.blotName);t.insertInto(this,e)},e.prototype.length=function(){return this.children.reduce(function(t,e){return t+e.length()},0)},e.prototype.moveChildren=function(t,e){this.children.forEach(function(n){t.insertBefore(n,e)})},e.prototype.optimize=function(e){if(t.prototype.optimize.call(this,e),0===this.children.length)if(null!=this.statics.defaultChild){var n=a.create(this.statics.defaultChild);this.appendChild(n),n.optimize(e)}else this.remove()},e.prototype.path=function(t,n){void 0===n&&(n=!1);var r=this.children.find(t,n),o=r[0],i=r[1],l=[[this,t]];return o instanceof e?l.concat(o.path(i,n)):(null!=o&&l.push([o,i]),l)},e.prototype.removeChild=function(t){this.children.remove(t)},e.prototype.replace=function(n){n instanceof e&&n.moveChildren(this),t.prototype.replace.call(this,n)},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(t,this.length(),function(t,r,o){t=t.split(r,e),n.appendChild(t)}),n},e.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},e.prototype.update=function(t,e){var n=this,o=[],i=[];t.forEach(function(t){t.target===n.domNode&&"childList"===t.type&&(o.push.apply(o,t.addedNodes),i.push.apply(i,t.removedNodes))}),i.forEach(function(t){if(!(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var e=a.find(t);null!=e&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==n.domNode||e.detach())}}),o.filter(function(t){return t.parentNode==n.domNode}).sort(function(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(t){var e=null;null!=t.nextSibling&&(e=a.find(t.nextSibling));var o=r(t);o.next==e&&null!=o.next||(null!=o.parent&&o.parent.removeChild(n),n.insertBefore(o,e||void 0))})},e}(l.default);e.default=s},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(11),i=n(28),l=n(17),a=n(1),s=function(t){function e(e){var n=t.call(this,e)||this;return n.attributes=new i.default(n.domNode),n}return r(e,t),e.formats=function(t){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)},e.prototype.format=function(t,e){var n=a.query(t);n instanceof o.default?this.attributes.attribute(n,e):e&&(null==n||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e))},e.prototype.formats=function(){var t=this.attributes.values(),e=this.statics.formats(this.domNode);return null!=e&&(t[this.statics.blotName]=e),t},e.prototype.replaceWith=function(e,n){var r=t.prototype.replaceWith.call(this,e,n);return this.attributes.copy(r),r},e.prototype.update=function(e,n){var r=this;t.prototype.update.call(this,e,n),e.some(function(t){return t.target===r.domNode&&"attributes"===t.type})&&this.attributes.build()},e.prototype.wrap=function(n,r){var o=t.prototype.wrap.call(this,n,r);return o instanceof e&&o.statics.scope===this.statics.scope&&this.attributes.move(o),o},e}(l.default);e.default=s},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(27),i=n(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.value=function(t){return!0},e.prototype.index=function(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1},e.prototype.position=function(t,e){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){return t={},t[this.statics.blotName]=this.statics.value(this.domNode)||!0,t;var t},e.scope=i.Scope.INLINE_BLOT,e}(o.default);e.default=l},function(t,e,n){function r(t){this.ops=t,this.index=0,this.offset=0}var o=n(12),i=n(2),l={attributes:{compose:function(t,e,n){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var r=i(!0,{},e);n||(r=Object.keys(r).reduce(function(t,e){return null!=r[e]&&(t[e]=r[e]),t},{}));for(var o in t)void 0!==t[o]&&void 0===e[o]&&(r[o]=t[o]);return Object.keys(r).length>0?r:void 0},diff:function(t,e){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce(function(n,r){return o(t[r],e[r])||(n[r]=void 0===e[r]?null:e[r]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce(function(n,r){return void 0===t[r]&&(n[r]=e[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(t){return new r(t)},length:function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}};r.prototype.hasNext=function(){return this.peekLength()<1/0},r.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=l.length(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(n,t):o.insert=e.insert,o}return{retain:1/0}},r.prototype.peek=function(){return this.ops[this.index]},r.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},r.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.exports=l},function(t,e){var n=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}function e(n,r,o,i,c){function f(n,o){if(null===n)return null;if(0===o)return n;var y,v;if("object"!=typeof n)return n;if(t(n,a))y=new a;else if(t(n,s))y=new s;else if(t(n,u))y=new u(function(t,e){n.then(function(e){t(f(e,o-1))},function(t){e(f(t,o-1))})});else if(e.__isArray(n))y=[];else if(e.__isRegExp(n))y=new RegExp(n.source,l(n)),n.lastIndex&&(y.lastIndex=n.lastIndex);else if(e.__isDate(n))y=new Date(n.getTime());else{if(d&&Buffer.isBuffer(n))return y=new Buffer(n.length),n.copy(y),y;t(n,Error)?y=Object.create(n):void 0===i?(v=Object.getPrototypeOf(n),y=Object.create(v)):(y=Object.create(i),v=i)}if(r){var b=h.indexOf(n);if(-1!=b)return p[b];h.push(n),p.push(y)}t(n,a)&&n.forEach(function(t,e){var n=f(e,o-1),r=f(t,o-1);y.set(n,r)}),t(n,s)&&n.forEach(function(t){var e=f(t,o-1);y.add(e)});for(var g in n){var m;v&&(m=Object.getOwnPropertyDescriptor(v,g)),m&&null==m.set||(y[g]=f(n[g],o-1))}if(Object.getOwnPropertySymbols)for(var _=Object.getOwnPropertySymbols(n),g=0;g<_.length;g++){var O=_[g],w=Object.getOwnPropertyDescriptor(n,O);(!w||w.enumerable||c)&&(y[O]=f(n[O],o-1),w.enumerable||Object.defineProperty(y,O,{enumerable:!1}))}if(c)for(var x=Object.getOwnPropertyNames(n),g=0;g1&&void 0!==arguments[1]?arguments[1]:0;i(this,t),this.index=e,this.length=n},O=function(){function t(e,n){var r=this;i(this,t),this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=c.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){r.mouseDown||setTimeout(r.update.bind(r,v.default.sources.USER),1)}),this.emitter.on(v.default.events.EDITOR_CHANGE,function(t,e){t===v.default.events.TEXT_CHANGE&&e.length()>0&&r.update(v.default.sources.SILENT)}),this.emitter.on(v.default.events.SCROLL_BEFORE_UPDATE,function(){if(r.hasFocus()){var t=r.getNativeRange();null!=t&&t.start.node!==r.cursor.textNode&&r.emitter.once(v.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(t){}})}}),this.emitter.on(v.default.events.SCROLL_OPTIMIZE,function(t,e){if(e.range){var n=e.range,o=n.startNode,i=n.startOffset,l=n.endNode,a=n.endOffset;r.setNativeRange(o,i,l,a)}}),this.update(v.default.sources.SILENT)}return s(t,[{key:"handleComposition",value:function(){var t=this;this.root.addEventListener("compositionstart",function(){t.composing=!0}),this.root.addEventListener("compositionend",function(){if(t.composing=!1,t.cursor.parent){var e=t.cursor.restore();if(!e)return;setTimeout(function(){t.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}},{key:"handleDragging",value:function(){var t=this;this.emitter.listenDOM("mousedown",document.body,function(){t.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){t.mouseDown=!1,t.update(v.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(t,e){if(null==this.scroll.whitelist||this.scroll.whitelist[t]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!c.default.query(t,c.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=c.default.find(n.start.node,!1);if(null==r)return;if(r instanceof c.default.Leaf){var o=r.split(n.start.offset);r.parent.insertBefore(this.cursor,o)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;var r=void 0,o=this.scroll.leaf(t),i=a(o,2),l=i[0],s=i[1];if(null==l)return null;var u=l.position(s,!0),c=a(u,2);r=c[0],s=c[1];var f=document.createRange();if(e>0){f.setStart(r,s);var h=this.scroll.leaf(t+e),p=a(h,2);if(l=p[0],s=p[1],null==l)return null;var d=l.position(s,!0),y=a(d,2);return r=y[0],s=y[1],f.setEnd(r,s),f.getBoundingClientRect()}var v="left",b=void 0;return r instanceof Text?(s0&&(v="right")),{bottom:b.top+b.height,height:b.height,left:b[v],right:b[v],top:b.top,width:0}}},{key:"getNativeRange",value:function(){var t=document.getSelection();if(null==t||t.rangeCount<=0)return null;var e=t.getRangeAt(0);if(null==e)return null;var n=this.normalizeNative(e);return m.info("getNativeRange",n),n}},{key:"getRange",value:function(){var t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(t){var e=this,n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);var r=n.map(function(t){var n=a(t,2),r=n[0],o=n[1],i=c.default.find(r,!0),l=i.offset(e.scroll);return 0===o?l:i instanceof c.default.Container?l+i.length():l+i.index(r,o)}),i=Math.min(Math.max.apply(Math,o(r)),this.scroll.length()-1),l=Math.min.apply(Math,[i].concat(o(r)));return new _(l,i-l)}},{key:"normalizeNative",value:function(t){if(!l(this.root,t.startContainer)||!t.collapsed&&!l(this.root,t.endContainer))return null;var e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(function(t){for(var e=t.node,n=t.offset;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;e=e.lastChild,n=e instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n}),e}},{key:"rangeToNative",value:function(t){var e=this,n=t.collapsed?[t.index]:[t.index,t.index+t.length],r=[],o=this.scroll.length();return n.forEach(function(t,n){t=Math.min(o-1,t);var i=void 0,l=e.scroll.leaf(t),s=a(l,2),u=s[0],c=s[1],f=u.position(c,0!==n),h=a(f,2);i=h[0],c=h[1],r.push(i,c)}),r.length<2&&(r=r.concat(r)),r}},{key:"scrollIntoView",value:function(t){var e=this.lastRange;if(null!=e){var n=this.getBounds(e.index,e.length);if(null!=n){var r=this.scroll.length()-1,o=this.scroll.line(Math.min(e.index,r)),i=a(o,1),l=i[0],s=l;if(e.length>0){var u=this.scroll.line(Math.min(e.index+e.length,r));s=a(u,1)[0]}if(null!=l&&null!=s){var c=t.getBoundingClientRect();n.topc.bottom&&(t.scrollTop+=n.bottom-c.bottom)}}}}},{key:"setNativeRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(m.info("setNativeRange",t,e,n,r),null==t||null!=this.root.parentNode&&null!=t.parentNode&&null!=n.parentNode){var i=document.getSelection();if(null!=i)if(null!=t){this.hasFocus()||this.root.focus();var l=(this.getNativeRange()||{}).native;if(null==l||o||t!==l.startContainer||e!==l.startOffset||n!==l.endContainer||r!==l.endOffset){"BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var a=document.createRange();a.setStart(t,e),a.setEnd(n,r),i.removeAllRanges(),i.addRange(a)}}else i.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v.default.sources.API;if("string"==typeof e&&(n=e,e=!1),m.info("setRange",t),null!=t){var r=this.rangeToNative(t);this.setNativeRange.apply(this,o(r).concat([e]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.default.sources.USER,e=this.lastRange,n=this.getRange(),r=a(n,2),o=r[0],i=r[1];if(this.lastRange=o,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,d.default)(e,this.lastRange)){var l;!this.composing&&null!=i&&i.native.collapsed&&i.start.node!==this.cursor.textNode&&this.cursor.restore();var s=[v.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(e),t];if((l=this.emitter).emit.apply(l,[v.default.events.EDITOR_CHANGE].concat(s)),t!==v.default.sources.SILENT){var u;(u=this.emitter).emit.apply(u,s)}}}}]),t}();e.Range=_,e.default=O},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=n(0),s=r(a),u=n(3),c=r(u),f=function(t){function e(){return o(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return l(e,t),e}(s.default.Container);f.allowedChildren=[c.default,u.BlockEmbed,f],e.default=f},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorStyle=e.ColorClass=e.ColorAttributor=void 0;var l=function(){function t(t,e){for(var n=0;n1){var u=o.formats(),c=this.quill.getFormat(t.index-1,1);i=A.default.attributes.diff(u,c)||{}}}var f=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-f,f,S.default.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(t.index-f,f,i,S.default.sources.USER),this.quill.focus()}}function c(t,e){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(!(t.index>=this.quill.getLength()-n)){var r={},o=0,i=this.quill.getLine(t.index),l=b(i,1),a=l[0];if(e.offset>=a.length()-1){var s=this.quill.getLine(t.index+1),u=b(s,1),c=u[0];if(c){var f=a.formats(),h=this.quill.getFormat(t.index,1);r=A.default.attributes.diff(f,h)||{},o=c.length()}}this.quill.deleteText(t.index,n,S.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index+o-1,n,r,S.default.sources.USER)}}function f(t){var e=this.quill.getLines(t),n={};if(e.length>1){var r=e[0].formats(),o=e[e.length-1].formats();n=A.default.attributes.diff(o,r)||{}}this.quill.deleteText(t,S.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index,1,n,S.default.sources.USER),this.quill.setSelection(t.index,S.default.sources.SILENT),this.quill.focus()}function h(t,e){var n=this;t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);var r=Object.keys(e.format).reduce(function(t,n){return T.default.query(n,T.default.Scope.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t},{});this.quill.insertText(t.index,"\n",r,S.default.sources.USER),this.quill.setSelection(t.index+1,S.default.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach(function(t){null==r[t]&&(Array.isArray(e.format[t])||"link"!==t&&n.quill.format(t,e.format[t],S.default.sources.USER))})}function p(t){return{key:D.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(e){var n=T.default.query("code-block"),r=e.index,o=e.length,i=this.quill.scroll.descendant(n,r),l=b(i,2),a=l[0],s=l[1];if(null!=a){var u=this.quill.getIndex(a),c=a.newlineIndex(s,!0)+1,f=a.newlineIndex(u+s+o),h=a.domNode.textContent.slice(c,f).split("\n");s=0,h.forEach(function(e,i){t?(a.insertAt(c+s,n.TAB),s+=n.TAB.length,0===i?r+=n.TAB.length:o+=n.TAB.length):e.startsWith(n.TAB)&&(a.deleteAt(c+s,n.TAB.length),s-=n.TAB.length,0===i?r-=n.TAB.length:o-=n.TAB.length),s+=e.length+1}),this.quill.update(S.default.sources.USER),this.quill.setSelection(r,o,S.default.sources.SILENT)}}}}function d(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],S.default.sources.USER)}}}function y(t){if("string"==typeof t||"number"==typeof t)return y({key:t});if("object"===(void 0===t?"undefined":v(t))&&(t=(0,_.default)(t,!1)),"string"==typeof t.key)if(null!=D.keys[t.key.toUpperCase()])t.key=D.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[B]=t.shortKey,delete t.shortKey),t}Object.defineProperty(e,"__esModule",{value:!0}),e.SHORTKEY=e.default=void 0;var v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),g=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=y(t);if(null==r||null==r.key)return I.warn("Attempted to add invalid keyboard binding",r);"function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),r=(0,k.default)(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var t=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var r=n.which||n.keyCode,o=(t.bindings[r]||[]).filter(function(t){return e.match(n,t)});if(0!==o.length){var i=t.quill.getSelection();if(null!=i&&t.quill.hasFocus()){var l=t.quill.getLine(i.index),a=b(l,2),s=a[0],u=a[1],c=t.quill.getLeaf(i.index),f=b(c,2),h=f[0],p=f[1],d=0===i.length?[h,p]:t.quill.getLeaf(i.index+i.length),y=b(d,2),g=y[0],m=y[1],_=h instanceof T.default.Text?h.value().slice(0,p):"",O=g instanceof T.default.Text?g.value().slice(m):"",x={collapsed:0===i.length,empty:0===i.length&&s.length()<=1,format:t.quill.getFormat(i),offset:u,prefix:_,suffix:O};o.some(function(e){if(null!=e.collapsed&&e.collapsed!==x.collapsed)return!1;if(null!=e.empty&&e.empty!==x.empty)return!1;if(null!=e.offset&&e.offset!==x.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(function(t){return null==x.format[t]}))return!1}else if("object"===v(e.format)&&!Object.keys(e.format).every(function(t){return!0===e.format[t]?null!=x.format[t]:!1===e.format[t]?null==x.format[t]:(0,w.default)(e.format[t],x.format[t])}))return!1;return!(null!=e.prefix&&!e.prefix.test(x.prefix))&&(!(null!=e.suffix&&!e.suffix.test(x.suffix))&&!0!==e.handler.call(t,i,x))})&&n.preventDefault()}}}})}}]),e}(R.default);D.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},D.DEFAULTS={bindings:{bold:d("bold"),italic:d("italic"),underline:d("underline"),indent:{key:D.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",S.default.sources.USER)}},outdent:{key:D.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","-1",S.default.sources.USER)}},"outdent backspace":{key:D.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",S.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,S.default.sources.USER)}},"indent code-block":p(!0),"outdent code-block":p(!1),"remove tab":{key:D.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,S.default.sources.USER)}},tab:{key:D.keys.TAB,handler:function(t){this.quill.history.cutoff();var e=(new N.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,S.default.sources.SILENT)}},"list empty enter":{key:D.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,S.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,S.default.sources.USER)}},"checklist enter":{key:D.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){var e=this.quill.getLine(t.index),n=b(e,2),r=n[0],o=n[1],i=(0,k.default)({},r.formats(),{list:"checked"}),l=(new N.default).retain(t.index).insert("\n",i).retain(r.length()-o-1).retain(1,{list:"unchecked"});this.quill.updateContents(l,S.default.sources.USER),this.quill.setSelection(t.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:D.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){var n=this.quill.getLine(t.index),r=b(n,2),o=r[0],i=r[1],l=(new N.default).retain(t.index).insert("\n",e.format).retain(o.length()-i-1).retain(1,{header:null});this.quill.updateContents(l,S.default.sources.USER),this.quill.setSelection(t.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){var n=e.prefix.length,r=this.quill.getLine(t.index),o=b(r,2),i=o[0],l=o[1];if(l>n)return!0;var a=void 0;switch(e.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(t.index," ",S.default.sources.USER),this.quill.history.cutoff();var s=(new N.default).retain(t.index-l).delete(n+1).retain(i.length()-2-l).retain(1,{list:a});this.quill.updateContents(s,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,S.default.sources.SILENT)}},"code exit":{key:D.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){var e=this.quill.getLine(t.index),n=b(e,2),r=n[0],o=n[1],i=(new N.default).retain(t.index+r.length()-o-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(i,S.default.sources.USER)}},"embed left":s(D.keys.LEFT,!1),"embed left shift":s(D.keys.LEFT,!0),"embed right":s(D.keys.RIGHT,!1),"embed right shift":s(D.keys.RIGHT,!0)}},e.default=D,e.SHORTKEY=B},function(t,e,n){"use strict";t.exports={align:{"":n(75),center:n(76),right:n(77),justify:n(78)},background:n(79),blockquote:n(80),bold:n(81),clean:n(82),code:n(40),"code-block":n(40),color:n(83),direction:{"":n(84),rtl:n(85)},float:{center:n(86),full:n(87),left:n(88),right:n(89)},formula:n(90),header:{1:n(91),2:n(92)},italic:n(93),image:n(94),indent:{"+1":n(95),"-1":n(96)},link:n(97),list:{ordered:n(98),bullet:n(99),check:n(100)},script:{sub:n(101),super:n(102)},strike:n(103),underline:n(104),video:n(105)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=function(){function t(t){this.domNode=t,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,o){var i=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&o)i.wrap(n,o);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var l=r.create(this.statics.scope);i.wrap(l),l.format(n,o)}},t.prototype.insertAt=function(t,e,n){var o=null==n?r.create("text",e):r.create(e,n),i=this.split(t);this.parent.insertBefore(o,i)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),o=n(29),i=n(30),l=n(1),a=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=o.default.keys(this.domNode),a=i.default.keys(this.domNode);e.concat(n).concat(a).forEach(function(e){var n=l.query(e,l.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)})},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach(function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)})},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach(function(t){e.attributes[t].remove(e.domNode)}),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce(function(e,n){return e[n]=t.attributes[n].value(t.domNode),e},{})},t}();e.default=a},function(t,e,n){"use strict";function r(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(function(t){return 0===t.indexOf(e+"-")})}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){r(t,this.keyName).forEach(function(e){t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=r(t,this.keyName)[0]||"",n=e.slice(this.keyName.length+1);return this.canAdd(t,n)?n:""},e}(i.default);e.default=l},function(t,e,n){"use strict";function r(t){var e=t.split("-"),n=e.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return e[0]+n}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map(function(t){return t.split(":")[0].trim()})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[r(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[r(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[r(this.keyName)];return this.canAdd(t,e)?e:""},e}(i.default);e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},u=function(){function t(t,e){for(var n=0;n '},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;nr.right&&(i=r.right-o.right,this.root.style.left=e+i+"px"),o.leftr.bottom){var l=o.bottom-o.top,a=t.bottom-t.top+l;this.root.style.top=n-a+"px",this.root.classList.add("ql-flip")}return i}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),t}();e.default=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?(e[1]||"https")+"://www.youtube.com/embed/"+e[2]+"?showinfo=0":(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(e[1]||"https")+"://player.vimeo.com/video/"+e[2]+"/":t}function s(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(function(e){var r=document.createElement("option");e===n?r.setAttribute("selected","selected"):r.setAttribute("value",e),t.appendChild(r)})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var u=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||""),this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function(){var t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,v.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,v.default.sources.USER)),this.quill.root.scrollTop=e;break;case"video":t=a(t);case"formula":if(!t)break;var n=this.quill.getSelection(!0);if(null!=n){var r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),t,v.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(r+1," ",v.default.sources.USER),this.quill.setSelection(r+2,v.default.sources.USER)}}this.textbox.value="",this.hide()}}]),e}(A.default);e.BaseTooltip=M,e.default=L},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(46),i=r(o),l=n(34),a=n(36),s=n(62),u=n(63),c=r(u),f=n(64),h=r(f),p=n(65),d=r(p),y=n(35),v=n(24),b=n(37),g=n(38),m=n(39),_=r(m),O=n(66),w=r(O),x=n(15),k=r(x),E=n(67),N=r(E),j=n(68),A=r(j),q=n(69),T=r(q),P=n(70),S=r(P),C=n(71),L=r(C),M=n(13),R=r(M),I=n(72),B=r(I),D=n(73),U=r(D),F=n(74),H=r(F),K=n(26),z=r(K),Z=n(16),V=r(Z),W=n(41),G=r(W),Y=n(42),X=r(Y),$=n(43),Q=r($),J=n(107),tt=r(J),et=n(108),nt=r(et);i.default.register({"attributors/attribute/direction":a.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":y.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":a.DirectionClass,"attributors/class/font":b.FontClass,"attributors/class/size":g.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":y.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":a.DirectionStyle,"attributors/style/font":b.FontStyle,"attributors/style/size":g.SizeStyle},!0),i.default.register({"formats/align":l.AlignClass,"formats/direction":a.DirectionClass,"formats/indent":s.IndentClass,"formats/background":y.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":b.FontClass,"formats/size":g.SizeClass,"formats/blockquote":c.default,"formats/code-block":R.default,"formats/header":h.default,"formats/list":d.default,"formats/bold":_.default,"formats/code":M.Code,"formats/italic":w.default,"formats/link":k.default,"formats/script":N.default,"formats/strike":A.default,"formats/underline":T.default,"formats/image":S.default,"formats/video":L.default,"formats/list/item":p.ListItem,"modules/formula":B.default,"modules/syntax":U.default,"modules/toolbar":H.default,"themes/bubble":tt.default,"themes/snow":nt.default,"ui/icons":z.default,"ui/picker":V.default,"ui/icon-picker":X.default,"ui/color-picker":G.default,"ui/tooltip":Q.default},!0),e.default=i.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=r(o),l=n(6),a=r(l),s=n(3),u=r(s),c=n(14),f=r(c),h=n(23),p=r(h),d=n(31),y=r(d),v=n(33),b=r(v),g=n(5),m=r(g),_=n(59),O=r(_),w=n(8),x=r(w),k=n(60),E=r(k),N=n(61),j=r(N),A=n(25),q=r(A);a.default.register({"blots/block":u.default,"blots/block/embed":s.BlockEmbed,"blots/break":f.default,"blots/container":p.default,"blots/cursor":y.default,"blots/embed":b.default,"blots/inline":m.default,"blots/scroll":O.default,"blots/text":x.default,"modules/clipboard":E.default,"modules/history":j.default,"modules/keyboard":q.default}),i.default.register(u.default,f.default,y.default,m.default,O.default,x.default),e.default=a.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var o=n.length();if(ta?n(r,t-a,Math.min(e,a+u-t)):n(r,0,Math.min(u,t+e-a)),a+=u}},t.prototype.map=function(t){return this.reduce(function(e,n){return e.push(t(n)),e},[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();e.default=r},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(17),i=n(1),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},a=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver(function(t){n.update(t)}),n.observer.observe(n.domNode,l),n.attach(),n}return r(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach(function(t){t.remove()}):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,o){this.update(),t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var l=[].slice.call(this.observer.takeRecords());l.length>0;)e.push(l.pop());for(var a=function(t,e){void 0===e&&(e=!0),null!=t&&t!==r&&null!=t.domNode.parentNode&&(null==t.domNode[i.DATA_KEY].mutations&&(t.domNode[i.DATA_KEY].mutations=[]),e&&a(t.parent))},s=function(t){null!=t.domNode[i.DATA_KEY]&&null!=t.domNode[i.DATA_KEY].mutations&&(t instanceof o.default&&t.children.forEach(s),t.optimize(n))},u=e,c=0;u.length>0;c+=1){if(c>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(function(t){var e=i.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(a(i.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,function(t){var e=i.find(t,!1);a(e,!1),e instanceof o.default&&e.children.forEach(function(t){a(t,!1)})})):"attributes"===t.type&&a(e.prev)),a(e))}),this.children.forEach(s),u=[].slice.call(this.observer.takeRecords()),l=u.slice();l.length>0;)e.push(l.pop())}},e.prototype.update=function(e,n){var r=this;void 0===n&&(n={}),e=e||this.observer.takeRecords(),e.map(function(t){var e=i.find(t.target,!0);return null==e?null:null==e.domNode[i.DATA_KEY].mutations?(e.domNode[i.DATA_KEY].mutations=[t],e):(e.domNode[i.DATA_KEY].mutations.push(t),null)}).forEach(function(t){null!=t&&t!==r&&null!=t.domNode[i.DATA_KEY]&&t.update(t.domNode[i.DATA_KEY].mutations||[],n)}),null!=this.domNode[i.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[i.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=i.Scope.BLOCK_BLOT,e.tagName="DIV",e}(o.default);e.default=a},function(t,e,n){"use strict";function r(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(18),l=n(1),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach(function(t){t instanceof i.default||(t=t.wrap(e.blotName,!0)),o.attributes.copy(t)}),this.unwrap())},e.prototype.formatAt=function(e,n,r,o){if(null!=this.formats()[r]||l.query(r,l.Scope.ATTRIBUTE)){this.isolate(e,n).format(r,o)}else t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var o=this.formats();if(0===Object.keys(o).length)return this.unwrap();var i=this.next;i instanceof e&&i.prev===this&&r(o,i.formats())&&(i.moveChildren(this),i.remove())},e.blotName="inline",e.scope=l.Scope.INLINE_BLOT,e.tagName="SPAN",e}(i.default);e.default=a},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(18),i=n(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(n){var r=i.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=i.query(n,i.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,o){null!=i.query(r,i.Scope.BLOCK)?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=i.query(n,i.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var o=this.split(e),l=i.create(n,r);o.parent.insertBefore(l,o)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=i.Scope.BLOCK_BLOT,e.tagName="P",e}(o.default);e.default=l},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(19),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,o){0===e&&n===this.length()?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(o.default);e.default=i},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(19),i=n(1),l=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return r(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=i.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some(function(t){return"characterData"===t.type&&t.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=i.Scope.INLINE_BLOT,e}(o.default);e.default=l},function(t,e,n){"use strict";var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return arguments.length>1&&!this.contains(t)==!e?e:o.call(this,t)}}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),r=n.length>>>0,o=arguments[1],i=0;ie.length?t:e,l=t.length>e.length?e:t,a=i.indexOf(l);if(-1!=a)return r=[[y,i.substring(0,a)],[v,l],[y,i.substring(a+l.length)]],t.length>e.length&&(r[0][0]=r[2][0]=d),r;if(1==l.length)return[[d,t],[y,e]];var u=s(t,e);if(u){var c=u[0],f=u[1],h=u[2],p=u[3],b=u[4],g=n(c,h),m=n(f,p);return g.concat([[v,b]],m)}return o(t,e)}function o(t,e){for(var n=t.length,r=e.length,o=Math.ceil((n+r)/2),l=o,a=2*o,s=new Array(a),u=new Array(a),c=0;cn)v+=2;else if(x>r)p+=2;else if(h){var k=l+f-_;if(k>=0&&k=E)return i(t,e,O,x)}}}for(var N=-m+b;N<=m-g;N+=2){var E,k=l+N;E=N==-m||N!=m&&u[k-1]n)g+=2;else if(j>r)b+=2;else if(!h){var w=l+f-N;if(w>=0&&w=E)return i(t,e,O,x)}}}}return[[d,t],[y,e]]}function i(t,e,r,o){var i=t.substring(0,r),l=e.substring(0,o),a=t.substring(r),s=e.substring(o),u=n(i,l),c=n(a,s);return u.concat(c)}function l(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),o=r,i=0;n=t.length?[r,o,i,s,f]:null}var r=t.length>e.length?t:e,o=t.length>e.length?e:t;if(r.length<4||2*o.lengthu[4].length?s:u:s;var c,f,h,p;return t.length>e.length?(c=i[0],f=i[1],h=i[2],p=i[3]):(h=i[0],p=i[1],c=i[2],f=i[3]),[c,f,h,p,i[4]]}function u(t){t.push([v,""]);for(var e,n=0,r=0,o=0,i="",s="";n1?(0!==r&&0!==o&&(e=l(s,i),0!==e&&(n-r-o>0&&t[n-r-o-1][0]==v?t[n-r-o-1][1]+=s.substring(0,e):(t.splice(0,0,[v,s.substring(0,e)]),n++),s=s.substring(e),i=i.substring(e)),0!==(e=a(s,i))&&(t[n][1]=s.substring(s.length-e)+t[n][1],s=s.substring(0,s.length-e),i=i.substring(0,i.length-e))),0===r?t.splice(n-o,r+o,[y,s]):0===o?t.splice(n-r,r+o,[d,i]):t.splice(n-r-o,r+o,[d,i],[y,s]),n=n-r-o+(r?1:0)+(o?1:0)+1):0!==n&&t[n-1][0]==v?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,o=0,r=0,i="",s=""}""===t[t.length-1][1]&&t.pop();var c=!1;for(n=1;n0&&r.splice(o+2,0,[l[0],a]),p(r,o,3)}return t}function h(t){for(var e=!1,n=function(t){return t.charCodeAt(0)>=56320&&t.charCodeAt(0)<=57343},r=2;r=55296&&t.charCodeAt(t.length-1)<=56319}(t[r-2][1])&&t[r-1][0]===d&&n(t[r-1][1])&&t[r][0]===y&&n(t[r][1])&&(e=!0,t[r-1][1]=t[r-2][1].slice(-1)+t[r-1][1],t[r][1]=t[r-2][1].slice(-1)+t[r][1],t[r-2][1]=t[r-2][1].slice(0,-1));if(!e)return t;for(var o=[],r=0;r0&&o.push(t[r]);return o}function p(t,e,n){for(var r=e+n-1;r>=0&&r>=e-1;r--)if(r+1=r&&!a.endsWith("\n")&&(n=!0),e.scroll.insertAt(t,a);var c=e.scroll.line(t),f=u(c,2),h=f[0],p=f[1],y=(0,T.default)({},(0,O.bubbleFormats)(h));if(h instanceof w.default){var b=h.descendant(v.default.Leaf,p),g=u(b,1),m=g[0];y=(0,T.default)(y,(0,O.bubbleFormats)(m))}l=d.default.attributes.diff(y,l)||{}}else if("object"===s(o.insert)){var _=Object.keys(o.insert)[0];if(null==_)return t;e.scroll.insertAt(t,_,o.insert[_])}r+=i}return Object.keys(l).forEach(function(n){e.scroll.formatAt(t,i,n,l[n])}),t+i},0),t.reduce(function(t,n){return"number"==typeof n.delete?(e.scroll.deleteAt(t,n.delete),t):t+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(t)}},{key:"deleteText",value:function(t,e){return this.scroll.deleteAt(t,e),this.update((new h.default).retain(t).delete(e))}},{key:"formatLine",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(o){if(null==n.scroll.whitelist||n.scroll.whitelist[o]){var i=n.scroll.lines(t,Math.max(e,1)),l=e;i.forEach(function(e){var i=e.length();if(e instanceof g.default){var a=t-e.offset(n.scroll),s=e.newlineIndex(a+l)-a+1;e.formatAt(a,s,o,r[o])}else e.format(o,r[o]);l-=i})}}),this.scroll.optimize(),this.update((new h.default).retain(t).retain(e,(0,N.default)(r)))}},{key:"formatText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e,o,r[o])}),this.update((new h.default).retain(t).retain(e,(0,N.default)(r)))}},{key:"getContents",value:function(t,e){return this.delta.slice(t,t+e)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(t,e){return t.concat(e.delta())},new h.default)}},{key:"getFormat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===e?this.scroll.path(t).forEach(function(t){var e=u(t,1),o=e[0];o instanceof w.default?n.push(o):o instanceof v.default.Leaf&&r.push(o)}):(n=this.scroll.lines(t,e),r=this.scroll.descendants(v.default.Leaf,t,e));var o=[n,r].map(function(t){if(0===t.length)return{};for(var e=(0,O.bubbleFormats)(t.shift());Object.keys(e).length>0;){var n=t.shift();if(null==n)return e;e=l((0,O.bubbleFormats)(n),e)}return e});return T.default.apply(T.default,o)}},{key:"getText",value:function(t,e){return this.getContents(t,e).filter(function(t){return"string"==typeof t.insert}).map(function(t){return t.insert}).join("")}},{key:"insertEmbed",value:function(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new h.default).retain(t).insert(o({},e,n)))}},{key:"insertText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e.length,o,r[o])}),this.update((new h.default).retain(t).insert(e,(0,N.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var t=this.scroll.children.head;return t.statics.blotName===w.default.blotName&&(!(t.children.length>1)&&t.children.head instanceof k.default)}},{key:"removeFormat",value:function(t,e){var n=this.getText(t,e),r=this.scroll.line(t+e),o=u(r,2),i=o[0],l=o[1],a=0,s=new h.default;null!=i&&(a=i instanceof g.default?i.newlineIndex(l)-l+1:i.length()-l,s=i.delta().slice(l,l+a-1).insert("\n"));var c=this.getContents(t,e+a),f=c.diff((new h.default).insert(n).concat(s)),p=(new h.default).retain(t).concat(f);return this.applyDelta(p)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(P)&&v.default.find(e[0].target)){var o=v.default.find(e[0].target),i=(0,O.bubbleFormats)(o),l=o.offset(this.scroll),a=e[0].oldValue.replace(_.default.CONTENTS,""),s=(new h.default).insert(a),u=(new h.default).insert(o.value());t=(new h.default).retain(l).concat(s.diff(u,n)).reduce(function(t,e){return e.insert?t.insert(e.insert,i):t.push(e)},new h.default),this.delta=r.compose(t)}else this.delta=this.getDelta(),t&&(0,A.default)(r.compose(t),this.delta)||(t=r.diff(this.delta,n));return t}}]),t}();e.default=S},function(t,e){"use strict";function n(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(){this._events=new n,this._eventsCount=0}var i=Object.prototype.hasOwnProperty,l="~";Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(l=!1)),o.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)i.call(t,e)&&n.push(l?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t,e){var n=l?l+t:t,r=this._events[n];if(e)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o0){if(i instanceof y.BlockEmbed||f instanceof y.BlockEmbed)return void this.optimize();if(i instanceof _.default){var h=i.newlineIndex(i.length(),!0);if(h>-1&&(i=i.split(h+1))===f)return void this.optimize()}else if(f instanceof _.default){var p=f.newlineIndex(0);p>-1&&f.split(p+1)}var d=f.children.head instanceof g.default?null:f.children.head;i.moveChildren(f,d),i.remove()}this.optimize()}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function(t,n,r,o){(null==this.whitelist||this.whitelist[r])&&(c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,r,o),this.optimize())}},{key:"insertAt",value:function(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==h.default.query(n,h.default.Scope.BLOCK)){var o=h.default.create(this.statics.defaultChild);this.appendChild(o),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),o.insertAt(0,n,r)}else{var i=h.default.create(n,r);this.appendChild(i)}else c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r);this.optimize()}}},{key:"insertBefore",value:function(t,n){if(t.statics.scope===h.default.Scope.INLINE_BLOT){var r=h.default.create(this.statics.defaultChild);r.appendChild(t),t=r}c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n)}},{key:"leaf",value:function(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function(t){return t===this.length()?this.line(t-1):this.descendant(a,t)}},{key:"lines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return function t(e,n,r){var o=[],i=r;return e.children.forEachAt(n,r,function(e,n,r){a(e)?o.push(e):e instanceof h.default.Container&&(o=o.concat(t(e,n,i))),i-=r}),o}(this,t,e)}},{key:"optimize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t,n),t.length>0&&this.emitter.emit(d.default.events.SCROLL_OPTIMIZE,t,n))}},{key:"path",value:function(t){return c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){if(!0!==this.batch){var n=d.default.sources.USER;"string"==typeof t&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(d.default.events.SCROLL_BEFORE_UPDATE,n,t),c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"update",this).call(this,t.concat([])),t.length>0&&this.emitter.emit(d.default.events.SCROLL_UPDATE,n,t)}}}]),e}(h.default.Scroll);x.blotName="scroll",x.className="ql-editor",x.tagName="DIV",x.defaultChild="block",x.allowedChildren=[v.default,y.BlockEmbed,w.default],e.default=x},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e,n){return"object"===(void 0===e?"undefined":x(e))?Object.keys(e).reduce(function(t,n){return s(t,n,e[n])},t):t.reduce(function(t,r){return r.attributes&&r.attributes[e]?t.push(r):t.insert(r.insert,(0,j.default)({},o({},e,n),r.attributes))},new q.default)}function u(t){if(t.nodeType!==Node.ELEMENT_NODE)return{};return t["__ql-computed-style"]||(t["__ql-computed-style"]=window.getComputedStyle(t))}function c(t,e){for(var n="",r=t.ops.length-1;r>=0&&n.length-1}function h(t,e,n){return t.nodeType===t.TEXT_NODE?n.reduce(function(e,n){return n(t,e)},new q.default):t.nodeType===t.ELEMENT_NODE?[].reduce.call(t.childNodes||[],function(r,o){var i=h(o,e,n);return o.nodeType===t.ELEMENT_NODE&&(i=e.reduce(function(t,e){return e(o,t)},i),i=(o[W]||[]).reduce(function(t,e){return e(o,t)},i)),r.concat(i)},new q.default):new q.default}function p(t,e,n){return s(n,t,!0)}function d(t,e){var n=P.default.Attributor.Attribute.keys(t),r=P.default.Attributor.Class.keys(t),o=P.default.Attributor.Style.keys(t),i={};return n.concat(r).concat(o).forEach(function(e){var n=P.default.query(e,P.default.Scope.ATTRIBUTE);null!=n&&(i[n.attrName]=n.value(t),i[n.attrName])||(n=Y[e],null==n||n.attrName!==e&&n.keyName!==e||(i[n.attrName]=n.value(t)||void 0),null==(n=X[e])||n.attrName!==e&&n.keyName!==e||(n=X[e],i[n.attrName]=n.value(t)||void 0))}),Object.keys(i).length>0&&(e=s(e,i)),e}function y(t,e){var n=P.default.query(t);if(null==n)return e;if(n.prototype instanceof P.default.Embed){var r={},o=n.value(t);null!=o&&(r[n.blotName]=o,e=(new q.default).insert(r,n.formats(t)))}else"function"==typeof n.formats&&(e=s(e,n.blotName,n.formats(t)));return e}function v(t,e){return c(e,"\n")||e.insert("\n"),e}function b(){return new q.default}function g(t,e){var n=P.default.query(t);if(null==n||"list-item"!==n.blotName||!c(e,"\n"))return e;for(var r=-1,o=t.parentNode;!o.classList.contains("ql-clipboard");)"list"===(P.default.query(o)||{}).blotName&&(r+=1),o=o.parentNode;return r<=0?e:e.compose((new q.default).retain(e.length()-1).retain(1,{indent:r}))}function m(t,e){return c(e,"\n")||(f(t)||e.length()>0&&t.nextSibling&&f(t.nextSibling))&&e.insert("\n"),e}function _(t,e){if(f(t)&&null!=t.nextElementSibling&&!c(e,"\n\n")){var n=t.offsetHeight+parseFloat(u(t).marginTop)+parseFloat(u(t).marginBottom);t.nextElementSibling.offsetTop>t.offsetTop+1.5*n&&e.insert("\n")}return e}function O(t,e){var n={},r=t.style||{};return r.fontStyle&&"italic"===u(t).fontStyle&&(n.italic=!0),r.fontWeight&&(u(t).fontWeight.startsWith("bold")||parseInt(u(t).fontWeight)>=700)&&(n.bold=!0),Object.keys(n).length>0&&(e=s(e,n)),parseFloat(r.textIndent||0)>0&&(e=(new q.default).insert("\t").concat(e)),e}function w(t,e){var n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard"))return e;if(!u(t.parentNode).whiteSpace.startsWith("pre")){var r=function(t,e){return e=e.replace(/[^\u00a0]/g,""),e.length<1&&t?" ":e};n=n.replace(/\r\n/g," ").replace(/\n/g," "),n=n.replace(/\s\s+/g,r.bind(r,!0)),(null==t.previousSibling&&f(t.parentNode)||null!=t.previousSibling&&f(t.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==t.nextSibling&&f(t.parentNode)||null!=t.nextSibling&&f(t.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return e.insert(n)}Object.defineProperty(e,"__esModule",{value:!0}),e.matchText=e.matchSpacing=e.matchNewline=e.matchBlot=e.matchAttributor=e.default=void 0;var x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),E=function(){function t(t,e){for(var n=0;n\r?\n +\<"),this.convert();var e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[F.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new q.default).insert(n,o({},F.default.blotName,e[F.default.blotName]))}var r=this.prepareMatching(),i=k(r,2),l=i[0],a=i[1],s=h(this.container,l,a);return c(s,"\n")&&null==s.ops[s.ops.length-1].attributes&&(s=s.compose((new q.default).retain(s.length()-1).delete(1))),V.log("convert",this.container.innerHTML,s),this.container.innerHTML="",s}},{key:"dangerouslyPasteHTML",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C.default.sources.API;if("string"==typeof t)this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,C.default.sources.SILENT);else{var r=this.convert(e);this.quill.updateContents((new q.default).retain(t).concat(r),n),this.quill.setSelection(t+r.length(),C.default.sources.SILENT)}}},{key:"onPaste",value:function(t){var e=this;if(!t.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=(new q.default).retain(n.index),o=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(C.default.sources.SILENT),setTimeout(function(){r=r.concat(e.convert()).delete(n.length),e.quill.updateContents(r,C.default.sources.USER),e.quill.setSelection(r.length()-n.length,C.default.sources.SILENT),e.quill.scrollingContainer.scrollTop=o,e.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var t=this,e=[],n=[];return this.matchers.forEach(function(r){var o=k(r,2),i=o[0],l=o[1];switch(i){case Node.TEXT_NODE:n.push(l);break;case Node.ELEMENT_NODE:e.push(l);break;default:[].forEach.call(t.container.querySelectorAll(i),function(t){t[W]=t[W]||[],t[W].push(l)})}}),[e,n]}}]),e}(I.default);$.DEFAULTS={matchers:[],matchVisual:!0},e.default=$,e.matchAttributor=d,e.matchBlot=y,e.matchNewline=m,e.matchSpacing=_,e.matchText=w},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e=t.ops[t.ops.length-1];return null!=e&&(null!=e.insert?"string"==typeof e.insert&&e.insert.endsWith("\n"):null!=e.attributes&&Object.keys(e.attributes).some(function(t){return null!=f.default.query(t,f.default.Scope.BLOCK)}))}function s(t){var e=t.reduce(function(t,e){return t+=e.delete||0},0),n=t.length()-e;return a(t)&&(n-=1),n}Object.defineProperty(e,"__esModule",{value:!0}),e.getLastChangeIndex=e.default=void 0;var u=function(){function t(t,e){for(var n=0;nr&&this.stack.undo.length>0){var o=this.stack.undo.pop();n=n.compose(o.undo),t=o.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(t){this.stack.undo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}),this.stack.redo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),e}(y.default);v.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=v,e.getLastChangeIndex=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var l=function(){function t(t,e){for(var n=0;n0&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return o({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(t,n){if(t instanceof v)u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n);else{var r=null==n?this.length():n.offset(this),o=this.split(r);o.parent.insertBefore(t,o)}}},{key:"optimize",value:function(t){u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){if(t.statics.blotName!==this.statics.blotName){var n=f.default.create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t)}}]),e}(y.default);b.blotName="list",b.scope=f.default.Scope.BLOCK_BLOT,b.tagName=["OL","UL"],b.defaultChild="list-item",b.allowedChildren=[v],e.ListItem=v,e.default=b},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=n(39),a=function(t){return t&&t.__esModule?t:{default:t}}(l),s=function(t){function e(){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),e}(a.default);s.blotName="italic",s.tagName=["EM","I"],e.default=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=a(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"==typeof t&&n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return f.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,c.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(u.default.Embed);h.blotName="image",h.tagName="IMG",e.default=h},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=a(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return f.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"sanitize",value:function(t){return c.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(s.BlockEmbed);h.blotName="video",h.className="ql-video",h.tagName="IFRAME",e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var a=function(){function t(t,e){for(var n=0;n0||null==this.cachedText)&&(this.domNode.innerHTML=t(e),this.domNode.normalize(),this.attach()),this.cachedText=e)}}]),e}(v.default);b.className="ql-syntax";var g=new c.default.Attributor.Class("token","hljs",{scope:c.default.Scope.INLINE}),m=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if("function"!=typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var l=null;return r.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(l),l=setTimeout(function(){r.highlight(),l=null},r.options.interval)}),r.highlight(),r}return l(e,t),a(e,null,[{key:"register",value:function(){h.default.register(g,!0),h.default.register(b,!0)}}]),a(e,[{key:"highlight",value:function(){var t=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var e=this.quill.getSelection();this.quill.scroll.descendants(b).forEach(function(e){e.highlight(t.options.highlight)}),this.quill.update(h.default.sources.SILENT),null!=e&&this.quill.setSelection(e,h.default.sources.SILENT)}}}]),e}(d.default);m.DEFAULTS={highlight:function(){return null==window.hljs?null:function(t){return window.hljs.highlightAuto(t).value}}(),interval:1e3},e.CodeBlock=b,e.CodeToken=g,e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e,n){var r=document.createElement("button");r.setAttribute("type","button"),r.classList.add("ql-"+e),null!=n&&(r.value=n),t.appendChild(r)}function u(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(function(e){var n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(function(t){if("string"==typeof t)s(n,t);else{var e=Object.keys(t)[0],r=t[e];Array.isArray(r)?c(n,e,r):s(n,e,r)}}),t.appendChild(n)})}function c(t,e,n){var r=document.createElement("select");r.classList.add("ql-"+e),n.forEach(function(t){var e=document.createElement("option");!1!==t?e.setAttribute("value",t):e.setAttribute("selected","selected"),r.appendChild(e)}),t.appendChild(r)}Object.defineProperty(e,"__esModule",{value:!0}),e.addControls=e.default=void 0;var f=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function t(t,e){for(var n=0;n '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BubbleTooltip=void 0;var a=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},s=function(){function t(t,e){for(var n=0;n0&&o===h.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var i=r.quill.getLines(e.index,e.length);if(1===i.length)r.position(r.quill.getBounds(e));else{var l=i[i.length-1],a=r.quill.getIndex(l),s=Math.min(l.length()-1,e.index+e.length-a),u=r.quill.getBounds(new y.Range(a,s));r.position(u)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}),r}return l(e,t),s(e,[{key:"listen",value:function(){var t=this;a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){t.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!t.root.classList.contains("ql-hidden")){var e=t.quill.getSelection();null!=e&&t.position(t.quill.getBounds(e))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var n=a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"position",this).call(this,t),r=this.root.querySelector(".ql-tooltip-arrow");if(r.style.marginLeft="",0===n)return n;r.style.marginLeft=-1*n-r.offsetWidth/2+"px"}}]),e}(p.BaseTooltip);_.TEMPLATE=['','
    ','','',"
    "].join(""),e.BubbleTooltip=_,e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},u=function(){function t(t,e){for(var n=0;n','','',''].join(""),e.default=w}]).default}); +//# sourceMappingURL=quill.min.js.map \ No newline at end of file diff -Nru bibledit-5.0.912/quill/quill.min.js.map bibledit-5.0.922/quill/quill.min.js.map --- bibledit-5.0.912/quill/quill.min.js.map 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/quill/quill.min.js.map 2018-03-12 06:39:22.000000000 +0000 @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///quill.min.js","webpack:///webpack/bootstrap 12da403d1f2adb6b6342","webpack:///./quill.js","webpack:///./core.js","webpack:///../parchment/src/parchment.ts","webpack:///../parchment/src/blot/abstract/container.ts","webpack:///../parchment/src/collection/linked-list.ts","webpack:///../parchment/src/blot/abstract/shadow.ts","webpack:///../parchment/src/registry.ts","webpack:///../parchment/src/blot/abstract/format.ts","webpack:///../parchment/src/attributor/attributor.ts","webpack:///../parchment/src/attributor/store.ts","webpack:///../parchment/src/attributor/class.ts","webpack:///../parchment/src/attributor/style.ts","webpack:///../parchment/src/blot/abstract/leaf.ts","webpack:///../parchment/src/blot/scroll.ts","webpack:///../parchment/src/blot/inline.ts","webpack:///../parchment/src/blot/block.ts","webpack:///../parchment/src/blot/embed.ts","webpack:///../parchment/src/blot/text.ts","webpack:///./core/quill.js","webpack:///./core/polyfill.js","webpack:///../delta/lib/delta.js","webpack:///../delta/~/fast-diff/diff.js","webpack:///../delta/~/deep-equal/lib/keys.js","webpack:///../delta/~/deep-equal/lib/is_arguments.js","webpack:///../delta/~/extend/index.js","webpack:///../delta/lib/op.js","webpack:///./core/editor.js","webpack:///./formats/code.js","webpack:///./blots/block.js","webpack:///./blots/break.js","webpack:///./blots/embed.js","webpack:///./blots/inline.js","webpack:///./blots/text.js","webpack:///./blots/cursor.js","webpack:///./core/emitter.js","webpack:///./~/eventemitter3/index.js","webpack:///./core/logger.js","webpack:///./~/clone/clone.js","webpack:///./core/module.js","webpack:///./core/selection.js","webpack:///./core/theme.js","webpack:///./blots/container.js","webpack:///./blots/scroll.js","webpack:///./modules/clipboard.js","webpack:///./formats/align.js","webpack:///./formats/background.js","webpack:///./formats/color.js","webpack:///./formats/direction.js","webpack:///./formats/font.js","webpack:///./formats/size.js","webpack:///./modules/history.js","webpack:///./modules/keyboard.js","webpack:///./formats/indent.js","webpack:///./formats/blockquote.js","webpack:///./formats/header.js","webpack:///./formats/list.js","webpack:///./formats/bold.js","webpack:///./formats/italic.js","webpack:///./formats/link.js","webpack:///./formats/script.js","webpack:///./formats/strike.js","webpack:///./formats/underline.js","webpack:///./formats/image.js","webpack:///./formats/video.js","webpack:///./modules/formula.js","webpack:///./modules/syntax.js","webpack:///./modules/toolbar.js","webpack:///./ui/icons.js","webpack:///./assets/icons/align-left.svg","webpack:///./assets/icons/align-center.svg","webpack:///./assets/icons/align-right.svg","webpack:///./assets/icons/align-justify.svg","webpack:///./assets/icons/background.svg","webpack:///./assets/icons/blockquote.svg","webpack:///./assets/icons/bold.svg","webpack:///./assets/icons/clean.svg","webpack:///./assets/icons/code.svg","webpack:///./assets/icons/color.svg","webpack:///./assets/icons/direction-ltr.svg","webpack:///./assets/icons/direction-rtl.svg","webpack:///./assets/icons/float-center.svg","webpack:///./assets/icons/float-full.svg","webpack:///./assets/icons/float-left.svg","webpack:///./assets/icons/float-right.svg","webpack:///./assets/icons/formula.svg","webpack:///./assets/icons/header.svg","webpack:///./assets/icons/header-2.svg","webpack:///./assets/icons/italic.svg","webpack:///./assets/icons/image.svg","webpack:///./assets/icons/indent.svg","webpack:///./assets/icons/outdent.svg","webpack:///./assets/icons/link.svg","webpack:///./assets/icons/list-ordered.svg","webpack:///./assets/icons/list-bullet.svg","webpack:///./assets/icons/subscript.svg","webpack:///./assets/icons/superscript.svg","webpack:///./assets/icons/strike.svg","webpack:///./assets/icons/underline.svg","webpack:///./assets/icons/video.svg","webpack:///./ui/picker.js","webpack:///./assets/icons/dropdown.svg","webpack:///./ui/color-picker.js","webpack:///./ui/icon-picker.js","webpack:///./ui/tooltip.js","webpack:///./themes/bubble.js","webpack:///./themes/base.js","webpack:///./themes/snow.js","webpack:///../delta/~/deep-equal/index.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","i","Object","prototype","hasOwnProperty","_m","args","slice","fn","a","b","apply","concat","_interopRequireDefault","obj","__esModule","default","_core","_core2","_align","_direction","_indent","_blockquote","_blockquote2","_header","_header2","_list","_list2","_background","_color","_font","_size","_bold","_bold2","_italic","_italic2","_link","_link2","_script","_script2","_strike","_strike2","_underline","_underline2","_image","_image2","_video","_video2","_code","_code2","_formula","_formula2","_syntax","_syntax2","_toolbar","_toolbar2","_icons","_icons2","_picker","_picker2","_colorPicker","_colorPicker2","_iconPicker","_iconPicker2","_tooltip","_tooltip2","_bubble","_bubble2","_snow","_snow2","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","formats/align","formats/direction","formats/indent","IndentClass","formats/background","formats/color","formats/font","formats/size","formats/blockquote","formats/code-block","formats/header","formats/list","formats/bold","formats/code","Code","formats/italic","formats/link","formats/script","formats/strike","formats/underline","formats/image","formats/video","formats/list/item","ListItem","modules/formula","modules/syntax","modules/toolbar","themes/bubble","themes/snow","ui/icons","ui/picker","ui/icon-picker","ui/color-picker","ui/tooltip","_parchment","_parchment2","_quill","_quill2","_block","_block2","_break","_break2","_container","_container2","_cursor","_cursor2","_embed","_embed2","_inline","_inline2","_scroll","_scroll2","_text","_text2","_clipboard","_clipboard2","_history","_history2","_keyboard","_keyboard2","blots/block","blots/block/embed","BlockEmbed","blots/break","blots/container","blots/cursor","blots/embed","blots/inline","blots/scroll","blots/text","modules/clipboard","modules/history","modules/keyboard","container_1","format_1","leaf_1","scroll_1","inline_1","block_1","embed_1","text_1","attributor_1","class_1","style_1","store_1","Registry","Parchment","Scope","create","find","query","Container","Format","Leaf","Embed","Scroll","Block","Inline","Text","Attributor","Attribute","Class","Style","Store","defineProperty","value","makeBlot","node","blot","e","INLINE","childNodes","forEach","child","domNode","appendChild","parentNode","replaceChild","attach","__extends","d","__","constructor","linked_list_1","shadow_1","ContainerBlot","_super","arguments","other","insertBefore","_this","children","reverse","head","err","ParchmentError","deleteAt","index","length","remove","forEachAt","offset","descendant","criteria","_a","blotName","descendants","Number","MAX_VALUE","lengthLeft","push","detach","formatAt","name","insertAt","def","childBlot","refBlot","statics","allowedChildren","some","insertInto","reduce","memo","moveChildren","targetParent","refNode","optimize","defaultChild","path","inclusive","position","removeChild","replace","target","split","force","next","after","clone","parent","unwrap","update","mutations","addedNodes","removedNodes","mutation","type","document","body","compareDocumentPosition","Node","DOCUMENT_POSITION_CONTAINED_BY","filter","sort","DOCUMENT_POSITION_FOLLOWING","nextSibling","LinkedList","tail","undefined","append","nodes","_i","contains","cur","iterator","prev","curNode","ret","length_1","callback","startNode","curIndex","curLength","Math","min","map","ShadowBlot","get","enumerable","configurable","tagName","Array","isArray","toUpperCase","parseInt","toString","createElement","indexOf","className","classList","add","DATA_KEY","cloneNode","isolate","BLOT","wrap","ATTRIBUTE","parent_1","scope","format","ref","parentBlot","refDomNode","replaceWith","replacement","wrapper","input","match","BlotClass","bubble","ANY","types","attributes","LEVEL","BLOCK","HTMLElement","names","getAttribute","classes","tags","console","log","nodeType","TYPE","Definitions","Definition","attrName","keyName","tagNames","tag","message","Error","FormatBlot","formats","toLowerCase","attribute","values","copy","build","move","options","attributeBit","whitelist","keys","item","canAdd","setAttribute","removeAttribute","AttributorStore","styles","attr","key","prefix","ClassAttributor","join","matches","result","camelize","parts","rest","part","StyleAttributor","arr","trim","style","LeafBlot","INLINE_BLOT","OBSERVER_CONFIG","characterData","characterDataOldValue","childList","subtree","MAX_OPTIMIZE_ITERATIONS","ScrollBlot","observer","MutationObserver","observe","disconnect","takeRecords","mark","markParent","remaining","previousSibling","grandChild","BLOCK_BLOT","isEqual","obj1","obj2","prop","InlineBlot","BlockBlot","EmbedBlot","TextBlot","text","createTextNode","data","splitText","_defineProperty","writable","_classCallCheck","instance","Constructor","TypeError","expandConfig","container","userConfig","_extend2","clipboard","keyboard","history","theme","Quill","DEFAULTS","import","_theme2","themeConfig","config","moduleNames","moduleConfig","moduleClass","debug","error","toolbar","querySelector","modify","modifier","source","shift","strict","isEnabled","_emitter4","sources","USER","_quillDelta2","range","getSelection","oldDelta","editor","delta","change","shiftRange","setSelection","SILENT","_emitter","events","TEXT_CHANGE","emitter","emit","EDITOR_CHANGE","_emitter2","overload","_typeof","API","start","end","_map","pos","transformPosition","_map2","_slicedToArray","_map3","max","_map4","_selection","Range","Symbol","sliceIterator","_arr","_n","_d","_e","_s","done","_createClass","defineProperties","props","descriptor","protoProps","staticProps","_quillDelta","_editor","_editor2","_emitter3","_module","_module2","_selection2","_extend","_logger","_logger2","_theme","_this2","html","innerHTML","addContainer","scroll","selection","addModule","init","on","toggle","isBlank","SCROLL_UPDATE","lastRange","contents","convert","setContents","clear","placeholder","readOnly","disable","limit","level","imports","overwrite","warn","startsWith","setRange","_this3","_overload","_overload2","deleteText","enable","enabled","blur","focus","scrollIntoView","_this4","formatLine","formatText","_this5","_overload3","_overload4","_this6","_overload5","_overload6","getBounds","getLength","_overload7","_overload8","getContents","getFormat","getRange","_overload9","_overload10","getText","hasFocus","embed","_this7","insertEmbed","_this8","_overload11","_overload12","insertText","off","once","dangerouslyPasteHTML","_this9","_overload13","_overload14","removeFormat","_this10","deleted","applied","applyDelta","lastOp","ops","insert","delete","compose","_overload15","_overload16","_this11","bounds","version","parchment","core/module","core/theme","elem","_toggle","DOMTokenList","token","String","searchString","substr","endsWith","subjectString","isFinite","floor","lastIndex","predicate","list","thisArg","addEventListener","execCommand","diff","equal","extend","op","NULL_CHARACTER","fromCharCode","Delta","newOp","retain","unshift","splice","partition","passed","failed","initial","chop","pop","Infinity","iter","hasNext","nextOp","thisIter","otherIter","peekType","peekLength","thisOp","otherOp","strings","prep","diffResult","component","opLength","INSERT","DELETE","EQUAL","eachLine","newline","line","peek","transform","priority","nextType","diff_main","text1","text2","cursor_pos","DIFF_EQUAL","commonlength","diff_commonPrefix","commonprefix","substring","diff_commonSuffix","commonsuffix","diffs","diff_compute_","diff_cleanupMerge","fix_cursor","DIFF_INSERT","DIFF_DELETE","longtext","shorttext","hm","diff_halfMatch_","text1_a","text1_b","text2_a","text2_b","mid_common","diffs_a","diffs_b","diff_bisect_","text1_length","text2_length","max_d","ceil","v_offset","v_length","v1","v2","x","front","k1start","k1end","k2start","k2end","k1","x1","k1_offset","y1","charAt","k2_offset","x2","diff_bisectSplit_","k2","y2","y","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","pointerend","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","j","best_common","prefixLength","suffixLength","hm1","hm2","pointer","count_delete","count_insert","text_delete","text_insert","changes","cursor_normalize_diff","current_pos","next_pos","split_pos","d_left","d_right","norm","ndiffs","cursor_pointer","d_next","merge_tuples","suffix","left_d","right_d","shim","supported","object","unsupported","propertyIsEnumerable","supportsArgumentsClass","hasOwn","toStr","isPlainObject","hasOwnConstructor","hasIsPrototypeOf","src","copyIsArray","deep","Iterator","lib","keepNull","retOp","combineFormats","combined","merged","normalizeDelta","_clone2","image","bullet","_op","_op2","_clone","_deepEqual","_deepEqual2","Editor","getDelta","consumeNextNewline","scrollLength","batch","_scroll$line","_scroll$line2","bubbleFormats","_line$descendant","_line$descendant2","leaf","lines","lengthRemaining","lineLength","codeIndex","codeLength","newlineIndex","leaves","_path","formatsArr","blots","_scroll$line3","_scroll$line4","cursorIndex","textBlot","oldValue","CONTENTS","oldText","newText","diffDelta","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","setPrototypeOf","__proto__","_get","property","receiver","Function","desc","getOwnPropertyDescriptor","getPrototypeOf","getter","_Inline","CodeBlock","_Block","textContent","frag","_descendant","_descendant2","nextNewline","prevNewline","isolateLength","_descendant3","_descendant4","searchIndex","lastIndexOf","querySelectorAll","TAB","NEWLINE_LENGTH","_Embed","BLOCK_ATTRIBUTE","block","_Parchment$Block","cache","Break","_Parchment$Embed","_Parchment$Inline","compare","selfIndex","order","otherIndex","_Parchment$Text","Cursor","textNode","_length","composing","getNativeRange","restoreText","_ref","lastChild","SCROLL_OPTIMIZE","setNativeRange","restore","_eventemitter","_eventemitter2","Emitter","_EventEmitter","SCROLL_BEFORE_UPDATE","SELECTION_CHANGE","Events","EE","context","EventEmitter","_events","_eventsCount","has","eventNames","getOwnPropertySymbols","listeners","event","exists","evt","available","l","ee","a1","a2","a3","a4","a5","len","removeListener","listener","removeAllListeners","addListener","setMaxListeners","prefixed","method","levels","_len","_key","namespace","ns","logger","bind","newLevel","circular","depth","proto","nativeMap","nativeSet","nativePromise","resolve","reject","then","__isArray","__isRegExp","RegExp","__getRegExpFlags","__isDate","Date","getTime","useBuffer","Buffer","isBuffer","allParents","allChildren","keyIterator","keyChild","valueChild","set","entryChild","attrs","symbols","symbol","__objToStr","o","re","flags","global","ignoreCase","multiline","Map","_","Set","Promise","clonePrototype","Module","quill","_toConsumableArray","arr2","from","Selection","cursor","savedRange","eventName","setTimeout","native","ignored","bodyTop","scrollTop","nativeRange","collapsed","_scroll$leaf","_scroll$leaf2","_leaf$position","_leaf$position2","createRange","setStart","_scroll$leaf3","_scroll$leaf4","_leaf$position3","_leaf$position4","setEnd","getBoundingClientRect","side","rect","height","left","width","top","containerBounds","right","bottom","rangeCount","getRangeAt","startContainer","endContainer","startOffset","endOffset","info","positions","indexes","_position","activeElement","offsetHeight","offsetTop","endNode","removeAllRanges","addRange","_scroll$leaf5","_scroll$leaf6","_leaf$position5","_leaf$position6","oldRange","_getRange","_getRange2","Theme","themes","_Parchment$Container","isLine","_Parchment$Scroll","_line","_line2","first","_line3","_line4","last","getLines","computeStyle","ELEMENT_NODE","DOM_KEY","window","getComputedStyle","deltaEndsWith","endText","display","matchAlias","matchAttributor","ATTRIBUTE_ATTRIBUTORS","STYLE_ATTRIBUTORS","matchBlot","matchBreak","matchIgnore","matchNewline","matchSpacing","nextElementSibling","nodeHeight","parseFloat","marginTop","marginBottom","matchStyles","fontWeight","bold","textIndent","matchText","whiteSpace","replacer","collapse","CLIPBOARD_CONFIG","TEXT_NODE","AlignAttribute","Clipboard","_Module","onPaste","matchers","pair","addMatcher","selector","matcher","textMatchers","elementMatchers","_pair","traverse","childNode","childrenDelta","paste","updateContents","defaultPrevented","ColorAttributor","_Parchment$Attributor","FontStyleAttributor","endsWithNewlineChange","getLastChangeIndex","deleteLength","changeIndex","History","lastRecorded","ignoreChange","userOnly","record","addBinding","shortKey","undo","shiftKey","redo","test","navigator","platform","dest","stack","changeDelta","undoDelta","timestamp","now","delay","maxStack","handleBackspace","_quill$scroll$line3","_quill$scroll$line4","curFormats","prevFormats","handleDelete","handleDeleteRange","handleEnter","lineFormats","makeCodeBlockHandler","indent","Keyboard","code-block","handler","_quill$scroll$descend","_quill$scroll$descend2","scrollOffset","makeFormatHandler","normalize","binding","charCodeAt","SHORTKEY","bindings","ENTER","metaKey","ctrlKey","altKey","BACKSPACE","userAgent","listen","which","keyCode","_quill$scroll$line","_quill$scroll$line2","_quill$scroll$leaf","_quill$scroll$leaf2","leafStart","offsetStart","_ref2","leafEnd","offsetEnd","prefixText","suffixText","curContext","empty","prevented","every","preventDefault","ESCAPE","LEFT","UP","RIGHT","DOWN","italic","underline","outdent","outdent backspace","blockquote","indent code-block","outdent code-block","remove tab","tab","list empty enter","header enter","list autofill","IdentAttributor","Blockquote","Header","List","_Container","Bold","Italic","_Bold","sanitize","url","protocols","anchor","href","protocol","Link","SANITIZED_URL","Script","Strike","Underline","ATTRIBUTES","Image","hasAttribute","Video","_BlockEmbed","Formula","katex","FormulaBlot","render","CodeToken","SyntaxCodeBlock","_CodeBlock","highlight","cachedHTML","Syntax","timer","code","hljs","highlightAuto","addButton","addControls","groups","controls","group","control","addSelect","option","Toolbar","_ret","handlers","addHandler","_this$quill$selection","_this$quill$selection2","selectedIndex","selected","_quill$selection$getR","_quill$selection$getR2","prompt","isActive","clean","direction","align","link","","center","justify","background","color","rtl","float","full","formula","header","1","2","+1","-1","ordered","script","sub","super","strike","video","_dropdown","_dropdown2","Picker","select","buildPicker","label","selectItem","buildItem","buildLabel","buildOptions","trigger","Event","dispatchEvent","createEvent","initEvent","close","ColorPicker","_Picker","backgroundColor","colorLabel","stroke","fill","IconPicker","icons","defaultItem","Tooltip","boundsContainer","TEMPLATE","checkBounds","hide","reference","offsetWidth","rootBounds","BubbleTooltip","_base","_base2","TOOLBAR_CONFIG","BubbleTheme","_BaseTheme","tooltip","buildButtons","buildPickers","edit","_BaseTooltip","show","lastLine","textbox","arrow","marginLeft","BaseTooltip","fillSelect","defaultValue","ALIGNS","COLORS","FONTS","HEADERS","SIZES","BaseTheme","_Theme","pickers","picker","removeEventListener","extendToolbar","buttons","button","selects","fileInput","files","reader","FileReader","onload","readAsDataURL","click","_Tooltip","save","cancel","mode","preview","linkRange","restoreFocus","SnowTheme","SnowTooltip","__webpack_module_template_argument_0__","__webpack_module_template_argument_1__","isUndefinedOrNull","objEquiv","opts","isArguments","pSlice","deepEqual","ka","objectKeys","kb","actual","expected"],"mappings":";;;;;;CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,KACCK,KAAA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C,EAAA4X,GAAA3X,EAAA2X,GAAAq8B,GAAA,QAEA,cAAAj0C,UAAAC,GA5FA,GAAAk0C,GAAA7gC,MAAA5T,UAAAI,MACAw0C,EAAAv1C,EAAA80C,GACAK,EAAAn1C,EAAA+0C,GAEAM,EAAA11C,EAAAD,QAAA,SAAA+1C,EAAAC,EAAAR,GAGA,MAFAA,WAEAO,IAAAC,IAGGD,YAAAja,OAAAka,YAAAla,MACHia,EAAAha,YAAAia,EAAAja,WAIGga,IAAAC,GAAA,gBAAAD,IAAA,gBAAAC,GACHR,EAAAx3B,OAAA+3B,IAAAC,EAAAD,GAAAC,EASAT,EAAAQ,EAAAC,EAAAR","file":"quill.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","/*!\n * Quill Editor v1.1.5\n * https://quilljs.com/\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ((function(modules) {\n\t// Check all modules for deduplicated modules\n\tfor(var i in modules) {\n\t\tif(Object.prototype.hasOwnProperty.call(modules, i)) {\n\t\t\tswitch(typeof modules[i]) {\n\t\t\tcase \"function\": break;\n\t\t\tcase \"object\":\n\t\t\t\t// Module can be created from a template\n\t\t\t\tmodules[i] = (function(_m) {\n\t\t\t\t\tvar args = _m.slice(1), fn = modules[_m[0]];\n\t\t\t\t\treturn function (a,b,c) {\n\t\t\t\t\t\tfn.apply(this, [a,b,c].concat(args));\n\t\t\t\t\t};\n\t\t\t\t}(modules[i]));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// Module is a copy of another module\n\t\t\t\tmodules[i] = modules[modules[i]];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn modules;\n}([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _core = __webpack_require__(1);\n\t\n\tvar _core2 = _interopRequireDefault(_core);\n\t\n\tvar _align = __webpack_require__(49);\n\t\n\tvar _direction = __webpack_require__(52);\n\t\n\tvar _indent = __webpack_require__(57);\n\t\n\tvar _blockquote = __webpack_require__(58);\n\t\n\tvar _blockquote2 = _interopRequireDefault(_blockquote);\n\t\n\tvar _header = __webpack_require__(59);\n\t\n\tvar _header2 = _interopRequireDefault(_header);\n\t\n\tvar _list = __webpack_require__(60);\n\t\n\tvar _list2 = _interopRequireDefault(_list);\n\t\n\tvar _background = __webpack_require__(50);\n\t\n\tvar _color = __webpack_require__(51);\n\t\n\tvar _font = __webpack_require__(53);\n\t\n\tvar _size = __webpack_require__(54);\n\t\n\tvar _bold = __webpack_require__(61);\n\t\n\tvar _bold2 = _interopRequireDefault(_bold);\n\t\n\tvar _italic = __webpack_require__(62);\n\t\n\tvar _italic2 = _interopRequireDefault(_italic);\n\t\n\tvar _link = __webpack_require__(63);\n\t\n\tvar _link2 = _interopRequireDefault(_link);\n\t\n\tvar _script = __webpack_require__(64);\n\t\n\tvar _script2 = _interopRequireDefault(_script);\n\t\n\tvar _strike = __webpack_require__(65);\n\t\n\tvar _strike2 = _interopRequireDefault(_strike);\n\t\n\tvar _underline = __webpack_require__(66);\n\t\n\tvar _underline2 = _interopRequireDefault(_underline);\n\t\n\tvar _image = __webpack_require__(67);\n\t\n\tvar _image2 = _interopRequireDefault(_image);\n\t\n\tvar _video = __webpack_require__(68);\n\t\n\tvar _video2 = _interopRequireDefault(_video);\n\t\n\tvar _code = __webpack_require__(28);\n\t\n\tvar _code2 = _interopRequireDefault(_code);\n\t\n\tvar _formula = __webpack_require__(69);\n\t\n\tvar _formula2 = _interopRequireDefault(_formula);\n\t\n\tvar _syntax = __webpack_require__(70);\n\t\n\tvar _syntax2 = _interopRequireDefault(_syntax);\n\t\n\tvar _toolbar = __webpack_require__(71);\n\t\n\tvar _toolbar2 = _interopRequireDefault(_toolbar);\n\t\n\tvar _icons = __webpack_require__(72);\n\t\n\tvar _icons2 = _interopRequireDefault(_icons);\n\t\n\tvar _picker = __webpack_require__(104);\n\t\n\tvar _picker2 = _interopRequireDefault(_picker);\n\t\n\tvar _colorPicker = __webpack_require__(106);\n\t\n\tvar _colorPicker2 = _interopRequireDefault(_colorPicker);\n\t\n\tvar _iconPicker = __webpack_require__(107);\n\t\n\tvar _iconPicker2 = _interopRequireDefault(_iconPicker);\n\t\n\tvar _tooltip = __webpack_require__(108);\n\t\n\tvar _tooltip2 = _interopRequireDefault(_tooltip);\n\t\n\tvar _bubble = __webpack_require__(109);\n\t\n\tvar _bubble2 = _interopRequireDefault(_bubble);\n\t\n\tvar _snow = __webpack_require__(111);\n\t\n\tvar _snow2 = _interopRequireDefault(_snow);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t_core2.default.register({\n\t 'attributors/attribute/direction': _direction.DirectionAttribute,\n\t\n\t 'attributors/class/align': _align.AlignClass,\n\t 'attributors/class/background': _background.BackgroundClass,\n\t 'attributors/class/color': _color.ColorClass,\n\t 'attributors/class/direction': _direction.DirectionClass,\n\t 'attributors/class/font': _font.FontClass,\n\t 'attributors/class/size': _size.SizeClass,\n\t\n\t 'attributors/style/align': _align.AlignStyle,\n\t 'attributors/style/background': _background.BackgroundStyle,\n\t 'attributors/style/color': _color.ColorStyle,\n\t 'attributors/style/direction': _direction.DirectionStyle,\n\t 'attributors/style/font': _font.FontStyle,\n\t 'attributors/style/size': _size.SizeStyle\n\t}, true);\n\t\n\t_core2.default.register({\n\t 'formats/align': _align.AlignClass,\n\t 'formats/direction': _direction.DirectionClass,\n\t 'formats/indent': _indent.IndentClass,\n\t\n\t 'formats/background': _background.BackgroundStyle,\n\t 'formats/color': _color.ColorStyle,\n\t 'formats/font': _font.FontClass,\n\t 'formats/size': _size.SizeClass,\n\t\n\t 'formats/blockquote': _blockquote2.default,\n\t 'formats/code-block': _code2.default,\n\t 'formats/header': _header2.default,\n\t 'formats/list': _list2.default,\n\t\n\t 'formats/bold': _bold2.default,\n\t 'formats/code': _code.Code,\n\t 'formats/italic': _italic2.default,\n\t 'formats/link': _link2.default,\n\t 'formats/script': _script2.default,\n\t 'formats/strike': _strike2.default,\n\t 'formats/underline': _underline2.default,\n\t\n\t 'formats/image': _image2.default,\n\t 'formats/video': _video2.default,\n\t\n\t 'formats/list/item': _list.ListItem,\n\t\n\t 'modules/formula': _formula2.default,\n\t 'modules/syntax': _syntax2.default,\n\t 'modules/toolbar': _toolbar2.default,\n\t\n\t 'themes/bubble': _bubble2.default,\n\t 'themes/snow': _snow2.default,\n\t\n\t 'ui/icons': _icons2.default,\n\t 'ui/picker': _picker2.default,\n\t 'ui/icon-picker': _iconPicker2.default,\n\t 'ui/color-picker': _colorPicker2.default,\n\t 'ui/tooltip': _tooltip2.default\n\t}, true);\n\t\n\tmodule.exports = _core2.default;\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tvar _break = __webpack_require__(31);\n\t\n\tvar _break2 = _interopRequireDefault(_break);\n\t\n\tvar _container = __webpack_require__(46);\n\t\n\tvar _container2 = _interopRequireDefault(_container);\n\t\n\tvar _cursor = __webpack_require__(35);\n\t\n\tvar _cursor2 = _interopRequireDefault(_cursor);\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tvar _scroll = __webpack_require__(47);\n\t\n\tvar _scroll2 = _interopRequireDefault(_scroll);\n\t\n\tvar _text = __webpack_require__(34);\n\t\n\tvar _text2 = _interopRequireDefault(_text);\n\t\n\tvar _clipboard = __webpack_require__(48);\n\t\n\tvar _clipboard2 = _interopRequireDefault(_clipboard);\n\t\n\tvar _history = __webpack_require__(55);\n\t\n\tvar _history2 = _interopRequireDefault(_history);\n\t\n\tvar _keyboard = __webpack_require__(56);\n\t\n\tvar _keyboard2 = _interopRequireDefault(_keyboard);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t_quill2.default.register({\n\t 'blots/block': _block2.default,\n\t 'blots/block/embed': _block.BlockEmbed,\n\t 'blots/break': _break2.default,\n\t 'blots/container': _container2.default,\n\t 'blots/cursor': _cursor2.default,\n\t 'blots/embed': _embed2.default,\n\t 'blots/inline': _inline2.default,\n\t 'blots/scroll': _scroll2.default,\n\t 'blots/text': _text2.default,\n\t\n\t 'modules/clipboard': _clipboard2.default,\n\t 'modules/history': _history2.default,\n\t 'modules/keyboard': _keyboard2.default\n\t});\n\t\n\t_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default);\n\t\n\tmodule.exports = _quill2.default;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar container_1 = __webpack_require__(3);\n\tvar format_1 = __webpack_require__(7);\n\tvar leaf_1 = __webpack_require__(12);\n\tvar scroll_1 = __webpack_require__(13);\n\tvar inline_1 = __webpack_require__(14);\n\tvar block_1 = __webpack_require__(15);\n\tvar embed_1 = __webpack_require__(16);\n\tvar text_1 = __webpack_require__(17);\n\tvar attributor_1 = __webpack_require__(8);\n\tvar class_1 = __webpack_require__(10);\n\tvar style_1 = __webpack_require__(11);\n\tvar store_1 = __webpack_require__(9);\n\tvar Registry = __webpack_require__(6);\n\tvar Parchment = {\n\t Scope: Registry.Scope,\n\t create: Registry.create,\n\t find: Registry.find,\n\t query: Registry.query,\n\t register: Registry.register,\n\t Container: container_1.default,\n\t Format: format_1.default,\n\t Leaf: leaf_1.default,\n\t Embed: embed_1.default,\n\t Scroll: scroll_1.default,\n\t Block: block_1.default,\n\t Inline: inline_1.default,\n\t Text: text_1.default,\n\t Attributor: {\n\t Attribute: attributor_1.default,\n\t Class: class_1.default,\n\t Style: style_1.default,\n\t Store: store_1.default\n\t }\n\t};\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = Parchment;\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar linked_list_1 = __webpack_require__(4);\n\tvar shadow_1 = __webpack_require__(5);\n\tvar Registry = __webpack_require__(6);\n\tvar ContainerBlot = (function (_super) {\n\t __extends(ContainerBlot, _super);\n\t function ContainerBlot() {\n\t _super.apply(this, arguments);\n\t }\n\t ContainerBlot.prototype.appendChild = function (other) {\n\t this.insertBefore(other);\n\t };\n\t ContainerBlot.prototype.attach = function () {\n\t var _this = this;\n\t _super.prototype.attach.call(this);\n\t this.children = new linked_list_1.default();\n\t // Need to be reversed for if DOM nodes already in order\n\t [].slice.call(this.domNode.childNodes).reverse().forEach(function (node) {\n\t try {\n\t var child = makeBlot(node);\n\t _this.insertBefore(child, _this.children.head);\n\t }\n\t catch (err) {\n\t if (err instanceof Registry.ParchmentError)\n\t return;\n\t else\n\t throw err;\n\t }\n\t });\n\t };\n\t ContainerBlot.prototype.deleteAt = function (index, length) {\n\t if (index === 0 && length === this.length()) {\n\t return this.remove();\n\t }\n\t this.children.forEachAt(index, length, function (child, offset, length) {\n\t child.deleteAt(offset, length);\n\t });\n\t };\n\t ContainerBlot.prototype.descendant = function (criteria, index) {\n\t var _a = this.children.find(index), child = _a[0], offset = _a[1];\n\t if ((criteria.blotName == null && criteria(child)) ||\n\t (criteria.blotName != null && child instanceof criteria)) {\n\t return [child, offset];\n\t }\n\t else if (child instanceof ContainerBlot) {\n\t return child.descendant(criteria, offset);\n\t }\n\t else {\n\t return [null, -1];\n\t }\n\t };\n\t ContainerBlot.prototype.descendants = function (criteria, index, length) {\n\t if (index === void 0) { index = 0; }\n\t if (length === void 0) { length = Number.MAX_VALUE; }\n\t var descendants = [], lengthLeft = length;\n\t this.children.forEachAt(index, length, function (child, index, length) {\n\t if ((criteria.blotName == null && criteria(child)) ||\n\t (criteria.blotName != null && child instanceof criteria)) {\n\t descendants.push(child);\n\t }\n\t if (child instanceof ContainerBlot) {\n\t descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n\t }\n\t lengthLeft -= length;\n\t });\n\t return descendants;\n\t };\n\t ContainerBlot.prototype.detach = function () {\n\t this.children.forEach(function (child) {\n\t child.detach();\n\t });\n\t _super.prototype.detach.call(this);\n\t };\n\t ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n\t this.children.forEachAt(index, length, function (child, offset, length) {\n\t child.formatAt(offset, length, name, value);\n\t });\n\t };\n\t ContainerBlot.prototype.insertAt = function (index, value, def) {\n\t var _a = this.children.find(index), child = _a[0], offset = _a[1];\n\t if (child) {\n\t child.insertAt(offset, value, def);\n\t }\n\t else {\n\t var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def);\n\t this.appendChild(blot);\n\t }\n\t };\n\t ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n\t if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function (child) {\n\t return childBlot instanceof child;\n\t })) {\n\t throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n\t }\n\t childBlot.insertInto(this, refBlot);\n\t };\n\t ContainerBlot.prototype.length = function () {\n\t return this.children.reduce(function (memo, child) {\n\t return memo + child.length();\n\t }, 0);\n\t };\n\t ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n\t this.children.forEach(function (child) {\n\t targetParent.insertBefore(child, refNode);\n\t });\n\t };\n\t ContainerBlot.prototype.optimize = function () {\n\t _super.prototype.optimize.call(this);\n\t if (this.children.length === 0) {\n\t if (this.statics.defaultChild != null) {\n\t var child = Registry.create(this.statics.defaultChild);\n\t this.appendChild(child);\n\t child.optimize();\n\t }\n\t else {\n\t this.remove();\n\t }\n\t }\n\t };\n\t ContainerBlot.prototype.path = function (index, inclusive) {\n\t if (inclusive === void 0) { inclusive = false; }\n\t var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n\t var position = [[this, index]];\n\t if (child instanceof ContainerBlot) {\n\t return position.concat(child.path(offset, inclusive));\n\t }\n\t else if (child != null) {\n\t position.push([child, offset]);\n\t }\n\t return position;\n\t };\n\t ContainerBlot.prototype.removeChild = function (child) {\n\t this.children.remove(child);\n\t };\n\t ContainerBlot.prototype.replace = function (target) {\n\t if (target instanceof ContainerBlot) {\n\t target.moveChildren(this);\n\t }\n\t _super.prototype.replace.call(this, target);\n\t };\n\t ContainerBlot.prototype.split = function (index, force) {\n\t if (force === void 0) { force = false; }\n\t if (!force) {\n\t if (index === 0)\n\t return this;\n\t if (index === this.length())\n\t return this.next;\n\t }\n\t var after = this.clone();\n\t this.parent.insertBefore(after, this.next);\n\t this.children.forEachAt(index, this.length(), function (child, offset, length) {\n\t child = child.split(offset, force);\n\t after.appendChild(child);\n\t });\n\t return after;\n\t };\n\t ContainerBlot.prototype.unwrap = function () {\n\t this.moveChildren(this.parent, this.next);\n\t this.remove();\n\t };\n\t ContainerBlot.prototype.update = function (mutations) {\n\t var _this = this;\n\t var addedNodes = [], removedNodes = [];\n\t mutations.forEach(function (mutation) {\n\t if (mutation.target === _this.domNode && mutation.type === 'childList') {\n\t addedNodes.push.apply(addedNodes, mutation.addedNodes);\n\t removedNodes.push.apply(removedNodes, mutation.removedNodes);\n\t }\n\t });\n\t removedNodes.forEach(function (node) {\n\t if (node.parentNode != null &&\n\t (document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY)) {\n\t // Node has not actually been removed\n\t return;\n\t }\n\t var blot = Registry.find(node);\n\t if (blot == null)\n\t return;\n\t if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n\t blot.detach();\n\t }\n\t });\n\t addedNodes.filter(function (node) {\n\t return node.parentNode == _this.domNode;\n\t }).sort(function (a, b) {\n\t if (a === b)\n\t return 0;\n\t if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n\t return 1;\n\t }\n\t return -1;\n\t }).forEach(function (node) {\n\t var refBlot = null;\n\t if (node.nextSibling != null) {\n\t refBlot = Registry.find(node.nextSibling);\n\t }\n\t var blot = makeBlot(node);\n\t if (blot.next != refBlot || blot.next == null) {\n\t if (blot.parent != null) {\n\t blot.parent.removeChild(_this);\n\t }\n\t _this.insertBefore(blot, refBlot);\n\t }\n\t });\n\t };\n\t return ContainerBlot;\n\t}(shadow_1.default));\n\tfunction makeBlot(node) {\n\t var blot = Registry.find(node);\n\t if (blot == null) {\n\t try {\n\t blot = Registry.create(node);\n\t }\n\t catch (e) {\n\t blot = Registry.create(Registry.Scope.INLINE);\n\t [].slice.call(node.childNodes).forEach(function (child) {\n\t blot.domNode.appendChild(child);\n\t });\n\t node.parentNode.replaceChild(blot.domNode, node);\n\t blot.attach();\n\t }\n\t }\n\t return blot;\n\t}\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = ContainerBlot;\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar LinkedList = (function () {\n\t function LinkedList() {\n\t this.head = this.tail = undefined;\n\t this.length = 0;\n\t }\n\t LinkedList.prototype.append = function () {\n\t var nodes = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t nodes[_i - 0] = arguments[_i];\n\t }\n\t this.insertBefore(nodes[0], undefined);\n\t if (nodes.length > 1) {\n\t this.append.apply(this, nodes.slice(1));\n\t }\n\t };\n\t LinkedList.prototype.contains = function (node) {\n\t var cur, next = this.iterator();\n\t while (cur = next()) {\n\t if (cur === node)\n\t return true;\n\t }\n\t return false;\n\t };\n\t LinkedList.prototype.insertBefore = function (node, refNode) {\n\t node.next = refNode;\n\t if (refNode != null) {\n\t node.prev = refNode.prev;\n\t if (refNode.prev != null) {\n\t refNode.prev.next = node;\n\t }\n\t refNode.prev = node;\n\t if (refNode === this.head) {\n\t this.head = node;\n\t }\n\t }\n\t else if (this.tail != null) {\n\t this.tail.next = node;\n\t node.prev = this.tail;\n\t this.tail = node;\n\t }\n\t else {\n\t node.prev = undefined;\n\t this.head = this.tail = node;\n\t }\n\t this.length += 1;\n\t };\n\t LinkedList.prototype.offset = function (target) {\n\t var index = 0, cur = this.head;\n\t while (cur != null) {\n\t if (cur === target)\n\t return index;\n\t index += cur.length();\n\t cur = cur.next;\n\t }\n\t return -1;\n\t };\n\t LinkedList.prototype.remove = function (node) {\n\t if (!this.contains(node))\n\t return;\n\t if (node.prev != null)\n\t node.prev.next = node.next;\n\t if (node.next != null)\n\t node.next.prev = node.prev;\n\t if (node === this.head)\n\t this.head = node.next;\n\t if (node === this.tail)\n\t this.tail = node.prev;\n\t this.length -= 1;\n\t };\n\t LinkedList.prototype.iterator = function (curNode) {\n\t if (curNode === void 0) { curNode = this.head; }\n\t // TODO use yield when we can\n\t return function () {\n\t var ret = curNode;\n\t if (curNode != null)\n\t curNode = curNode.next;\n\t return ret;\n\t };\n\t };\n\t LinkedList.prototype.find = function (index, inclusive) {\n\t if (inclusive === void 0) { inclusive = false; }\n\t var cur, next = this.iterator();\n\t while (cur = next()) {\n\t var length_1 = cur.length();\n\t if (index < length_1 || (inclusive && index === length_1 && (cur.next == null || cur.next.length() !== 0))) {\n\t return [cur, index];\n\t }\n\t index -= length_1;\n\t }\n\t return [null, 0];\n\t };\n\t LinkedList.prototype.forEach = function (callback) {\n\t var cur, next = this.iterator();\n\t while (cur = next()) {\n\t callback(cur);\n\t }\n\t };\n\t LinkedList.prototype.forEachAt = function (index, length, callback) {\n\t if (length <= 0)\n\t return;\n\t var _a = this.find(index), startNode = _a[0], offset = _a[1];\n\t var cur, curIndex = index - offset, next = this.iterator(startNode);\n\t while ((cur = next()) && curIndex < index + length) {\n\t var curLength = cur.length();\n\t if (index > curIndex) {\n\t callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n\t }\n\t else {\n\t callback(cur, 0, Math.min(curLength, index + length - curIndex));\n\t }\n\t curIndex += curLength;\n\t }\n\t };\n\t LinkedList.prototype.map = function (callback) {\n\t return this.reduce(function (memo, cur) {\n\t memo.push(callback(cur));\n\t return memo;\n\t }, []);\n\t };\n\t LinkedList.prototype.reduce = function (callback, memo) {\n\t var cur, next = this.iterator();\n\t while (cur = next()) {\n\t memo = callback(memo, cur);\n\t }\n\t return memo;\n\t };\n\t return LinkedList;\n\t}());\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = LinkedList;\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar Registry = __webpack_require__(6);\n\tvar ShadowBlot = (function () {\n\t function ShadowBlot(domNode) {\n\t this.domNode = domNode;\n\t this.attach();\n\t }\n\t Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n\t // Hack for accessing inherited static methods\n\t get: function () {\n\t return this.constructor;\n\t },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t ShadowBlot.create = function (value) {\n\t if (this.tagName == null) {\n\t throw new Registry.ParchmentError('Blot definition missing tagName');\n\t }\n\t var node;\n\t if (Array.isArray(this.tagName)) {\n\t if (typeof value === 'string') {\n\t value = value.toUpperCase();\n\t if (parseInt(value).toString() === value) {\n\t value = parseInt(value);\n\t }\n\t }\n\t if (typeof value === 'number') {\n\t node = document.createElement(this.tagName[value - 1]);\n\t }\n\t else if (this.tagName.indexOf(value) > -1) {\n\t node = document.createElement(value);\n\t }\n\t else {\n\t node = document.createElement(this.tagName[0]);\n\t }\n\t }\n\t else {\n\t node = document.createElement(this.tagName);\n\t }\n\t if (this.className) {\n\t node.classList.add(this.className);\n\t }\n\t return node;\n\t };\n\t ShadowBlot.prototype.attach = function () {\n\t this.domNode[Registry.DATA_KEY] = { blot: this };\n\t };\n\t ShadowBlot.prototype.clone = function () {\n\t var domNode = this.domNode.cloneNode();\n\t return Registry.create(domNode);\n\t };\n\t ShadowBlot.prototype.detach = function () {\n\t if (this.parent != null)\n\t this.parent.removeChild(this);\n\t delete this.domNode[Registry.DATA_KEY];\n\t };\n\t ShadowBlot.prototype.deleteAt = function (index, length) {\n\t var blot = this.isolate(index, length);\n\t blot.remove();\n\t };\n\t ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n\t var blot = this.isolate(index, length);\n\t if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n\t blot.wrap(name, value);\n\t }\n\t else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n\t var parent_1 = Registry.create(this.statics.scope);\n\t blot.wrap(parent_1);\n\t parent_1.format(name, value);\n\t }\n\t };\n\t ShadowBlot.prototype.insertAt = function (index, value, def) {\n\t var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def);\n\t var ref = this.split(index);\n\t this.parent.insertBefore(blot, ref);\n\t };\n\t ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n\t if (this.parent != null) {\n\t this.parent.children.remove(this);\n\t }\n\t parentBlot.children.insertBefore(this, refBlot);\n\t if (refBlot != null) {\n\t var refDomNode = refBlot.domNode;\n\t }\n\t if (this.next == null || this.domNode.nextSibling != refDomNode) {\n\t parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n\t }\n\t this.parent = parentBlot;\n\t };\n\t ShadowBlot.prototype.isolate = function (index, length) {\n\t var target = this.split(index);\n\t target.split(length);\n\t return target;\n\t };\n\t ShadowBlot.prototype.length = function () {\n\t return 1;\n\t };\n\t ;\n\t ShadowBlot.prototype.offset = function (root) {\n\t if (root === void 0) { root = this.parent; }\n\t if (this.parent == null || this == root)\n\t return 0;\n\t return this.parent.children.offset(this) + this.parent.offset(root);\n\t };\n\t ShadowBlot.prototype.optimize = function () {\n\t // TODO clean up once we use WeakMap\n\t if (this.domNode[Registry.DATA_KEY] != null) {\n\t delete this.domNode[Registry.DATA_KEY].mutations;\n\t }\n\t };\n\t ShadowBlot.prototype.remove = function () {\n\t if (this.domNode.parentNode != null) {\n\t this.domNode.parentNode.removeChild(this.domNode);\n\t }\n\t this.detach();\n\t };\n\t ShadowBlot.prototype.replace = function (target) {\n\t if (target.parent == null)\n\t return;\n\t target.parent.insertBefore(this, target.next);\n\t target.remove();\n\t };\n\t ShadowBlot.prototype.replaceWith = function (name, value) {\n\t var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n\t replacement.replace(this);\n\t return replacement;\n\t };\n\t ShadowBlot.prototype.split = function (index, force) {\n\t return index === 0 ? this : this.next;\n\t };\n\t ShadowBlot.prototype.update = function (mutations) {\n\t if (mutations === void 0) { mutations = []; }\n\t // Nothing to do by default\n\t };\n\t ShadowBlot.prototype.wrap = function (name, value) {\n\t var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n\t if (this.parent != null) {\n\t this.parent.insertBefore(wrapper, this.next);\n\t }\n\t wrapper.appendChild(this);\n\t return wrapper;\n\t };\n\t ShadowBlot.blotName = 'abstract';\n\t return ShadowBlot;\n\t}());\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = ShadowBlot;\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar ParchmentError = (function (_super) {\n\t __extends(ParchmentError, _super);\n\t function ParchmentError(message) {\n\t message = '[Parchment] ' + message;\n\t _super.call(this, message);\n\t this.message = message;\n\t this.name = this.constructor.name;\n\t }\n\t return ParchmentError;\n\t}(Error));\n\texports.ParchmentError = ParchmentError;\n\tvar attributes = {};\n\tvar classes = {};\n\tvar tags = {};\n\tvar types = {};\n\texports.DATA_KEY = '__blot';\n\t(function (Scope) {\n\t Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n\t Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n\t Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n\t Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n\t Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n\t Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n\t Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n\t Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n\t Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n\t Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n\t Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n\t})(exports.Scope || (exports.Scope = {}));\n\tvar Scope = exports.Scope;\n\t;\n\tfunction create(input, value) {\n\t var match = query(input);\n\t if (match == null) {\n\t throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n\t }\n\t var BlotClass = match;\n\t var node = input instanceof Node ? input : BlotClass.create(value);\n\t return new BlotClass(node, value);\n\t}\n\texports.create = create;\n\tfunction find(node, bubble) {\n\t if (bubble === void 0) { bubble = false; }\n\t if (node == null)\n\t return null;\n\t if (node[exports.DATA_KEY] != null)\n\t return node[exports.DATA_KEY].blot;\n\t if (bubble)\n\t return find(node.parentNode, bubble);\n\t return null;\n\t}\n\texports.find = find;\n\tfunction query(query, scope) {\n\t if (scope === void 0) { scope = Scope.ANY; }\n\t var match;\n\t if (typeof query === 'string') {\n\t match = types[query] || attributes[query];\n\t }\n\t else if (query instanceof Text) {\n\t match = types['text'];\n\t }\n\t else if (typeof query === 'number') {\n\t if (query & Scope.LEVEL & Scope.BLOCK) {\n\t match = types['block'];\n\t }\n\t else if (query & Scope.LEVEL & Scope.INLINE) {\n\t match = types['inline'];\n\t }\n\t }\n\t else if (query instanceof HTMLElement) {\n\t var names = (query.getAttribute('class') || '').split(/\\s+/);\n\t for (var i in names) {\n\t match = classes[names[i]];\n\t if (match)\n\t break;\n\t }\n\t match = match || tags[query.tagName];\n\t }\n\t if (match == null) {\n\t if (query instanceof Node) {\n\t console.log(query.nodeType);\n\t }\n\t }\n\t if (match == null)\n\t return null;\n\t if ((scope & Scope.LEVEL & match.scope) && (scope & Scope.TYPE & match.scope))\n\t return match;\n\t return null;\n\t}\n\texports.query = query;\n\tfunction register() {\n\t var Definitions = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t Definitions[_i - 0] = arguments[_i];\n\t }\n\t if (Definitions.length > 1) {\n\t return Definitions.map(function (d) {\n\t return register(d);\n\t });\n\t }\n\t var Definition = Definitions[0];\n\t if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n\t throw new ParchmentError('Invalid definition');\n\t }\n\t else if (Definition.blotName === 'abstract') {\n\t throw new ParchmentError('Cannot register abstract class');\n\t }\n\t types[Definition.blotName || Definition.attrName] = Definition;\n\t if (typeof Definition.keyName === 'string') {\n\t attributes[Definition.keyName] = Definition;\n\t }\n\t else {\n\t if (Definition.className != null) {\n\t classes[Definition.className] = Definition;\n\t }\n\t if (Definition.tagName != null) {\n\t if (Array.isArray(Definition.tagName)) {\n\t Definition.tagName = Definition.tagName.map(function (tagName) {\n\t return tagName.toUpperCase();\n\t });\n\t }\n\t else {\n\t Definition.tagName = Definition.tagName.toUpperCase();\n\t }\n\t var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n\t tagNames.forEach(function (tag) {\n\t if (tags[tag] == null || Definition.className == null) {\n\t tags[tag] = Definition;\n\t }\n\t });\n\t }\n\t }\n\t return Definition;\n\t}\n\texports.register = register;\n\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar attributor_1 = __webpack_require__(8);\n\tvar store_1 = __webpack_require__(9);\n\tvar container_1 = __webpack_require__(3);\n\tvar Registry = __webpack_require__(6);\n\tvar FormatBlot = (function (_super) {\n\t __extends(FormatBlot, _super);\n\t function FormatBlot() {\n\t _super.apply(this, arguments);\n\t }\n\t FormatBlot.formats = function (domNode) {\n\t if (typeof this.tagName === 'string') {\n\t return true;\n\t }\n\t else if (Array.isArray(this.tagName)) {\n\t return domNode.tagName.toLowerCase();\n\t }\n\t return undefined;\n\t };\n\t FormatBlot.prototype.attach = function () {\n\t _super.prototype.attach.call(this);\n\t this.attributes = new store_1.default(this.domNode);\n\t };\n\t FormatBlot.prototype.format = function (name, value) {\n\t var format = Registry.query(name);\n\t if (format instanceof attributor_1.default) {\n\t this.attributes.attribute(format, value);\n\t }\n\t else if (value) {\n\t if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n\t this.replaceWith(name, value);\n\t }\n\t }\n\t };\n\t FormatBlot.prototype.formats = function () {\n\t var formats = this.attributes.values();\n\t var format = this.statics.formats(this.domNode);\n\t if (format != null) {\n\t formats[this.statics.blotName] = format;\n\t }\n\t return formats;\n\t };\n\t FormatBlot.prototype.replaceWith = function (name, value) {\n\t var replacement = _super.prototype.replaceWith.call(this, name, value);\n\t this.attributes.copy(replacement);\n\t return replacement;\n\t };\n\t FormatBlot.prototype.update = function (mutations) {\n\t var _this = this;\n\t _super.prototype.update.call(this, mutations);\n\t if (mutations.some(function (mutation) {\n\t return mutation.target === _this.domNode && mutation.type === 'attributes';\n\t })) {\n\t this.attributes.build();\n\t }\n\t };\n\t FormatBlot.prototype.wrap = function (name, value) {\n\t var wrapper = _super.prototype.wrap.call(this, name, value);\n\t if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n\t this.attributes.move(wrapper);\n\t }\n\t return wrapper;\n\t };\n\t return FormatBlot;\n\t}(container_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = FormatBlot;\n\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar Registry = __webpack_require__(6);\n\tvar Attributor = (function () {\n\t function Attributor(attrName, keyName, options) {\n\t if (options === void 0) { options = {}; }\n\t this.attrName = attrName;\n\t this.keyName = keyName;\n\t var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n\t if (options.scope != null) {\n\t // Ignore type bits, force attribute bit\n\t this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n\t }\n\t else {\n\t this.scope = Registry.Scope.ATTRIBUTE;\n\t }\n\t if (options.whitelist != null)\n\t this.whitelist = options.whitelist;\n\t }\n\t Attributor.keys = function (node) {\n\t return [].map.call(node.attributes, function (item) {\n\t return item.name;\n\t });\n\t };\n\t Attributor.prototype.add = function (node, value) {\n\t if (!this.canAdd(node, value))\n\t return false;\n\t node.setAttribute(this.keyName, value);\n\t return true;\n\t };\n\t Attributor.prototype.canAdd = function (node, value) {\n\t var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n\t if (match != null && (this.whitelist == null || this.whitelist.indexOf(value) > -1)) {\n\t return true;\n\t }\n\t return false;\n\t };\n\t Attributor.prototype.remove = function (node) {\n\t node.removeAttribute(this.keyName);\n\t };\n\t Attributor.prototype.value = function (node) {\n\t return node.getAttribute(this.keyName);\n\t };\n\t return Attributor;\n\t}());\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = Attributor;\n\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar attributor_1 = __webpack_require__(8);\n\tvar class_1 = __webpack_require__(10);\n\tvar style_1 = __webpack_require__(11);\n\tvar Registry = __webpack_require__(6);\n\tvar AttributorStore = (function () {\n\t function AttributorStore(domNode) {\n\t this.attributes = {};\n\t this.domNode = domNode;\n\t this.build();\n\t }\n\t AttributorStore.prototype.attribute = function (attribute, value) {\n\t if (value) {\n\t if (attribute.add(this.domNode, value)) {\n\t if (attribute.value(this.domNode) != null) {\n\t this.attributes[attribute.attrName] = attribute;\n\t }\n\t else {\n\t delete this.attributes[attribute.attrName];\n\t }\n\t }\n\t }\n\t else {\n\t attribute.remove(this.domNode);\n\t delete this.attributes[attribute.attrName];\n\t }\n\t };\n\t AttributorStore.prototype.build = function () {\n\t var _this = this;\n\t this.attributes = {};\n\t var attributes = attributor_1.default.keys(this.domNode);\n\t var classes = class_1.default.keys(this.domNode);\n\t var styles = style_1.default.keys(this.domNode);\n\t attributes.concat(classes).concat(styles).forEach(function (name) {\n\t var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n\t if (attr instanceof attributor_1.default) {\n\t _this.attributes[attr.attrName] = attr;\n\t }\n\t });\n\t };\n\t AttributorStore.prototype.copy = function (target) {\n\t var _this = this;\n\t Object.keys(this.attributes).forEach(function (key) {\n\t var value = _this.attributes[key].value(_this.domNode);\n\t target.format(key, value);\n\t });\n\t };\n\t AttributorStore.prototype.move = function (target) {\n\t var _this = this;\n\t this.copy(target);\n\t Object.keys(this.attributes).forEach(function (key) {\n\t _this.attributes[key].remove(_this.domNode);\n\t });\n\t this.attributes = {};\n\t };\n\t AttributorStore.prototype.values = function () {\n\t var _this = this;\n\t return Object.keys(this.attributes).reduce(function (attributes, name) {\n\t attributes[name] = _this.attributes[name].value(_this.domNode);\n\t return attributes;\n\t }, {});\n\t };\n\t return AttributorStore;\n\t}());\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = AttributorStore;\n\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar attributor_1 = __webpack_require__(8);\n\tfunction match(node, prefix) {\n\t var className = node.getAttribute('class') || '';\n\t return className.split(/\\s+/).filter(function (name) {\n\t return name.indexOf(prefix + \"-\") === 0;\n\t });\n\t}\n\tvar ClassAttributor = (function (_super) {\n\t __extends(ClassAttributor, _super);\n\t function ClassAttributor() {\n\t _super.apply(this, arguments);\n\t }\n\t ClassAttributor.keys = function (node) {\n\t return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n\t return name.split('-').slice(0, -1).join('-');\n\t });\n\t };\n\t ClassAttributor.prototype.add = function (node, value) {\n\t if (!this.canAdd(node, value))\n\t return false;\n\t this.remove(node);\n\t node.classList.add(this.keyName + \"-\" + value);\n\t return true;\n\t };\n\t ClassAttributor.prototype.remove = function (node) {\n\t var matches = match(node, this.keyName);\n\t matches.forEach(function (name) {\n\t node.classList.remove(name);\n\t });\n\t if (node.classList.length === 0) {\n\t node.removeAttribute('class');\n\t }\n\t };\n\t ClassAttributor.prototype.value = function (node) {\n\t var result = match(node, this.keyName)[0] || '';\n\t return result.slice(this.keyName.length + 1); // +1 for hyphen\n\t };\n\t return ClassAttributor;\n\t}(attributor_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = ClassAttributor;\n\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar attributor_1 = __webpack_require__(8);\n\tfunction camelize(name) {\n\t var parts = name.split('-');\n\t var rest = parts.slice(1).map(function (part) {\n\t return part[0].toUpperCase() + part.slice(1);\n\t }).join('');\n\t return parts[0] + rest;\n\t}\n\tvar StyleAttributor = (function (_super) {\n\t __extends(StyleAttributor, _super);\n\t function StyleAttributor() {\n\t _super.apply(this, arguments);\n\t }\n\t StyleAttributor.keys = function (node) {\n\t return (node.getAttribute('style') || '').split(';').map(function (value) {\n\t var arr = value.split(':');\n\t return arr[0].trim();\n\t });\n\t };\n\t StyleAttributor.prototype.add = function (node, value) {\n\t if (!this.canAdd(node, value))\n\t return false;\n\t node.style[camelize(this.keyName)] = value;\n\t return true;\n\t };\n\t StyleAttributor.prototype.remove = function (node) {\n\t node.style[camelize(this.keyName)] = '';\n\t if (!node.getAttribute('style')) {\n\t node.removeAttribute('style');\n\t }\n\t };\n\t StyleAttributor.prototype.value = function (node) {\n\t return node.style[camelize(this.keyName)];\n\t };\n\t return StyleAttributor;\n\t}(attributor_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = StyleAttributor;\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar shadow_1 = __webpack_require__(5);\n\tvar Registry = __webpack_require__(6);\n\tvar LeafBlot = (function (_super) {\n\t __extends(LeafBlot, _super);\n\t function LeafBlot() {\n\t _super.apply(this, arguments);\n\t }\n\t LeafBlot.value = function (domNode) {\n\t return true;\n\t };\n\t LeafBlot.prototype.index = function (node, offset) {\n\t if (node !== this.domNode)\n\t return -1;\n\t return Math.min(offset, 1);\n\t };\n\t LeafBlot.prototype.position = function (index, inclusive) {\n\t var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n\t if (index > 0)\n\t offset += 1;\n\t return [this.parent.domNode, offset];\n\t };\n\t LeafBlot.prototype.value = function () {\n\t return (_a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a);\n\t var _a;\n\t };\n\t LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n\t return LeafBlot;\n\t}(shadow_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = LeafBlot;\n\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar container_1 = __webpack_require__(3);\n\tvar Registry = __webpack_require__(6);\n\tvar OBSERVER_CONFIG = {\n\t attributes: true,\n\t characterData: true,\n\t characterDataOldValue: true,\n\t childList: true,\n\t subtree: true\n\t};\n\tvar MAX_OPTIMIZE_ITERATIONS = 100;\n\tvar ScrollBlot = (function (_super) {\n\t __extends(ScrollBlot, _super);\n\t function ScrollBlot(node) {\n\t var _this = this;\n\t _super.call(this, node);\n\t this.parent = null;\n\t this.observer = new MutationObserver(function (mutations) {\n\t _this.update(mutations);\n\t });\n\t this.observer.observe(this.domNode, OBSERVER_CONFIG);\n\t }\n\t ScrollBlot.prototype.detach = function () {\n\t _super.prototype.detach.call(this);\n\t this.observer.disconnect();\n\t };\n\t ScrollBlot.prototype.deleteAt = function (index, length) {\n\t this.update();\n\t if (index === 0 && length === this.length()) {\n\t this.children.forEach(function (child) {\n\t child.remove();\n\t });\n\t }\n\t else {\n\t _super.prototype.deleteAt.call(this, index, length);\n\t }\n\t };\n\t ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n\t this.update();\n\t _super.prototype.formatAt.call(this, index, length, name, value);\n\t };\n\t ScrollBlot.prototype.insertAt = function (index, value, def) {\n\t this.update();\n\t _super.prototype.insertAt.call(this, index, value, def);\n\t };\n\t ScrollBlot.prototype.optimize = function (mutations) {\n\t var _this = this;\n\t if (mutations === void 0) { mutations = []; }\n\t _super.prototype.optimize.call(this);\n\t mutations.push.apply(mutations, this.observer.takeRecords());\n\t // TODO use WeakMap\n\t var mark = function (blot, markParent) {\n\t if (markParent === void 0) { markParent = true; }\n\t if (blot == null || blot === _this)\n\t return;\n\t if (blot.domNode.parentNode == null)\n\t return;\n\t if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n\t blot.domNode[Registry.DATA_KEY].mutations = [];\n\t }\n\t if (markParent)\n\t mark(blot.parent);\n\t };\n\t var optimize = function (blot) {\n\t if (blot.domNode[Registry.DATA_KEY] == null || blot.domNode[Registry.DATA_KEY].mutations == null) {\n\t return;\n\t }\n\t if (blot instanceof container_1.default) {\n\t blot.children.forEach(optimize);\n\t }\n\t blot.optimize();\n\t };\n\t var remaining = mutations;\n\t for (var i = 0; remaining.length > 0; i += 1) {\n\t if (i >= MAX_OPTIMIZE_ITERATIONS) {\n\t throw new Error('[Parchment] Maximum optimize iterations reached');\n\t }\n\t remaining.forEach(function (mutation) {\n\t var blot = Registry.find(mutation.target, true);\n\t if (blot == null)\n\t return;\n\t if (blot.domNode === mutation.target) {\n\t if (mutation.type === 'childList') {\n\t mark(Registry.find(mutation.previousSibling, false));\n\t [].forEach.call(mutation.addedNodes, function (node) {\n\t var child = Registry.find(node, false);\n\t mark(child, false);\n\t if (child instanceof container_1.default) {\n\t child.children.forEach(function (grandChild) {\n\t mark(grandChild, false);\n\t });\n\t }\n\t });\n\t }\n\t else if (mutation.type === 'attributes') {\n\t mark(blot.prev);\n\t }\n\t }\n\t mark(blot);\n\t });\n\t this.children.forEach(optimize);\n\t remaining = this.observer.takeRecords();\n\t mutations.push.apply(mutations, remaining);\n\t }\n\t };\n\t ScrollBlot.prototype.update = function (mutations) {\n\t var _this = this;\n\t mutations = mutations || this.observer.takeRecords();\n\t // TODO use WeakMap\n\t mutations.map(function (mutation) {\n\t var blot = Registry.find(mutation.target, true);\n\t if (blot == null)\n\t return;\n\t if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n\t blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n\t return blot;\n\t }\n\t else {\n\t blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n\t return null;\n\t }\n\t }).forEach(function (blot) {\n\t if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null)\n\t return;\n\t blot.update(blot.domNode[Registry.DATA_KEY].mutations || []);\n\t });\n\t if (this.domNode[Registry.DATA_KEY].mutations != null) {\n\t _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations);\n\t }\n\t this.optimize(mutations);\n\t };\n\t ScrollBlot.blotName = 'scroll';\n\t ScrollBlot.defaultChild = 'block';\n\t ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n\t ScrollBlot.tagName = 'DIV';\n\t return ScrollBlot;\n\t}(container_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = ScrollBlot;\n\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar format_1 = __webpack_require__(7);\n\tvar Registry = __webpack_require__(6);\n\t// Shallow object comparison\n\tfunction isEqual(obj1, obj2) {\n\t if (Object.keys(obj1).length !== Object.keys(obj2).length)\n\t return false;\n\t for (var prop in obj1) {\n\t if (obj1[prop] !== obj2[prop])\n\t return false;\n\t }\n\t return true;\n\t}\n\tvar InlineBlot = (function (_super) {\n\t __extends(InlineBlot, _super);\n\t function InlineBlot() {\n\t _super.apply(this, arguments);\n\t }\n\t InlineBlot.formats = function (domNode) {\n\t if (domNode.tagName === InlineBlot.tagName)\n\t return undefined;\n\t return _super.formats.call(this, domNode);\n\t };\n\t InlineBlot.prototype.format = function (name, value) {\n\t var _this = this;\n\t if (name === this.statics.blotName && !value) {\n\t this.children.forEach(function (child) {\n\t if (!(child instanceof format_1.default)) {\n\t child = child.wrap(InlineBlot.blotName, true);\n\t }\n\t _this.attributes.copy(child);\n\t });\n\t this.unwrap();\n\t }\n\t else {\n\t _super.prototype.format.call(this, name, value);\n\t }\n\t };\n\t InlineBlot.prototype.formatAt = function (index, length, name, value) {\n\t if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n\t var blot = this.isolate(index, length);\n\t blot.format(name, value);\n\t }\n\t else {\n\t _super.prototype.formatAt.call(this, index, length, name, value);\n\t }\n\t };\n\t InlineBlot.prototype.optimize = function () {\n\t _super.prototype.optimize.call(this);\n\t var formats = this.formats();\n\t if (Object.keys(formats).length === 0) {\n\t return this.unwrap(); // unformatted span\n\t }\n\t var next = this.next;\n\t if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n\t next.moveChildren(this);\n\t next.remove();\n\t }\n\t };\n\t InlineBlot.blotName = 'inline';\n\t InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n\t InlineBlot.tagName = 'SPAN';\n\t return InlineBlot;\n\t}(format_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = InlineBlot;\n\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar format_1 = __webpack_require__(7);\n\tvar Registry = __webpack_require__(6);\n\tvar BlockBlot = (function (_super) {\n\t __extends(BlockBlot, _super);\n\t function BlockBlot() {\n\t _super.apply(this, arguments);\n\t }\n\t BlockBlot.formats = function (domNode) {\n\t var tagName = Registry.query(BlockBlot.blotName).tagName;\n\t if (domNode.tagName === tagName)\n\t return undefined;\n\t return _super.formats.call(this, domNode);\n\t };\n\t BlockBlot.prototype.format = function (name, value) {\n\t if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n\t return;\n\t }\n\t else if (name === this.statics.blotName && !value) {\n\t this.replaceWith(BlockBlot.blotName);\n\t }\n\t else {\n\t _super.prototype.format.call(this, name, value);\n\t }\n\t };\n\t BlockBlot.prototype.formatAt = function (index, length, name, value) {\n\t if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n\t this.format(name, value);\n\t }\n\t else {\n\t _super.prototype.formatAt.call(this, index, length, name, value);\n\t }\n\t };\n\t BlockBlot.prototype.insertAt = function (index, value, def) {\n\t if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n\t // Insert text or inline\n\t _super.prototype.insertAt.call(this, index, value, def);\n\t }\n\t else {\n\t var after = this.split(index);\n\t var blot = Registry.create(value, def);\n\t after.parent.insertBefore(blot, after);\n\t }\n\t };\n\t BlockBlot.blotName = 'block';\n\t BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n\t BlockBlot.tagName = 'P';\n\t return BlockBlot;\n\t}(format_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = BlockBlot;\n\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar leaf_1 = __webpack_require__(12);\n\tvar EmbedBlot = (function (_super) {\n\t __extends(EmbedBlot, _super);\n\t function EmbedBlot() {\n\t _super.apply(this, arguments);\n\t }\n\t EmbedBlot.formats = function (domNode) {\n\t return undefined;\n\t };\n\t EmbedBlot.prototype.format = function (name, value) {\n\t // super.formatAt wraps, which is what we want in general,\n\t // but this allows subclasses to overwrite for formats\n\t // that just apply to particular embeds\n\t _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n\t };\n\t EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n\t if (index === 0 && length === this.length()) {\n\t this.format(name, value);\n\t }\n\t else {\n\t _super.prototype.formatAt.call(this, index, length, name, value);\n\t }\n\t };\n\t EmbedBlot.prototype.formats = function () {\n\t return this.statics.formats(this.domNode);\n\t };\n\t return EmbedBlot;\n\t}(leaf_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = EmbedBlot;\n\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar leaf_1 = __webpack_require__(12);\n\tvar Registry = __webpack_require__(6);\n\tvar TextBlot = (function (_super) {\n\t __extends(TextBlot, _super);\n\t function TextBlot(node) {\n\t _super.call(this, node);\n\t this.text = this.statics.value(this.domNode);\n\t }\n\t TextBlot.create = function (value) {\n\t return document.createTextNode(value);\n\t };\n\t TextBlot.value = function (domNode) {\n\t return domNode.data;\n\t };\n\t TextBlot.prototype.deleteAt = function (index, length) {\n\t this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n\t };\n\t TextBlot.prototype.index = function (node, offset) {\n\t if (this.domNode === node) {\n\t return offset;\n\t }\n\t return -1;\n\t };\n\t TextBlot.prototype.insertAt = function (index, value, def) {\n\t if (def == null) {\n\t this.text = this.text.slice(0, index) + value + this.text.slice(index);\n\t this.domNode.data = this.text;\n\t }\n\t else {\n\t _super.prototype.insertAt.call(this, index, value, def);\n\t }\n\t };\n\t TextBlot.prototype.length = function () {\n\t return this.text.length;\n\t };\n\t TextBlot.prototype.optimize = function () {\n\t _super.prototype.optimize.call(this);\n\t this.text = this.statics.value(this.domNode);\n\t if (this.text.length === 0) {\n\t this.remove();\n\t }\n\t else if (this.next instanceof TextBlot && this.next.prev === this) {\n\t this.insertAt(this.length(), this.next.value());\n\t this.next.remove();\n\t }\n\t };\n\t TextBlot.prototype.position = function (index, inclusive) {\n\t if (inclusive === void 0) { inclusive = false; }\n\t return [this.domNode, index];\n\t };\n\t TextBlot.prototype.split = function (index, force) {\n\t if (force === void 0) { force = false; }\n\t if (!force) {\n\t if (index === 0)\n\t return this;\n\t if (index === this.length())\n\t return this.next;\n\t }\n\t var after = Registry.create(this.domNode.splitText(index));\n\t this.parent.insertBefore(after, this.next);\n\t this.text = this.statics.value(this.domNode);\n\t return after;\n\t };\n\t TextBlot.prototype.update = function (mutations) {\n\t var _this = this;\n\t if (mutations.some(function (mutation) {\n\t return mutation.type === 'characterData' && mutation.target === _this.domNode;\n\t })) {\n\t this.text = this.statics.value(this.domNode);\n\t }\n\t };\n\t TextBlot.prototype.value = function () {\n\t return this.text;\n\t };\n\t TextBlot.blotName = 'text';\n\t TextBlot.scope = Registry.Scope.INLINE_BLOT;\n\t return TextBlot;\n\t}(leaf_1.default));\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = TextBlot;\n\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.overload = exports.expandConfig = undefined;\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\t__webpack_require__(19);\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _editor = __webpack_require__(27);\n\t\n\tvar _editor2 = _interopRequireDefault(_editor);\n\t\n\tvar _emitter3 = __webpack_require__(36);\n\t\n\tvar _emitter4 = _interopRequireDefault(_emitter3);\n\t\n\tvar _module = __webpack_require__(43);\n\t\n\tvar _module2 = _interopRequireDefault(_module);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _selection = __webpack_require__(44);\n\t\n\tvar _selection2 = _interopRequireDefault(_selection);\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _logger = __webpack_require__(38);\n\t\n\tvar _logger2 = _interopRequireDefault(_logger);\n\t\n\tvar _theme = __webpack_require__(45);\n\t\n\tvar _theme2 = _interopRequireDefault(_theme);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar debug = (0, _logger2.default)('quill');\n\t\n\tvar Quill = function () {\n\t _createClass(Quill, null, [{\n\t key: 'debug',\n\t value: function debug(limit) {\n\t if (limit === true) {\n\t limit = 'log';\n\t }\n\t _logger2.default.level(limit);\n\t }\n\t }, {\n\t key: 'import',\n\t value: function _import(name) {\n\t if (this.imports[name] == null) {\n\t debug.error('Cannot import ' + name + '. Are you sure it was registered?');\n\t }\n\t return this.imports[name];\n\t }\n\t }, {\n\t key: 'register',\n\t value: function register(path, target) {\n\t var _this = this;\n\t\n\t var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\t\n\t if (typeof path !== 'string') {\n\t var name = path.attrName || path.blotName;\n\t if (typeof name === 'string') {\n\t // register(Blot | Attributor, overwrite)\n\t this.register('formats/' + name, path, target);\n\t } else {\n\t Object.keys(path).forEach(function (key) {\n\t _this.register(key, path[key], target);\n\t });\n\t }\n\t } else {\n\t if (this.imports[path] != null && !overwrite) {\n\t debug.warn('Overwriting ' + path + ' with', target);\n\t }\n\t this.imports[path] = target;\n\t if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') {\n\t _parchment2.default.register(target);\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t function Quill(container) {\n\t var _this2 = this;\n\t\n\t var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t\n\t _classCallCheck(this, Quill);\n\t\n\t this.options = expandConfig(container, options);\n\t this.container = this.options.container;\n\t if (this.container == null) {\n\t return debug.error('Invalid Quill container', container);\n\t }\n\t if (this.options.debug) {\n\t Quill.debug(this.options.debug);\n\t }\n\t var html = this.container.innerHTML.trim();\n\t this.container.classList.add('ql-container');\n\t this.container.innerHTML = '';\n\t this.root = this.addContainer('ql-editor');\n\t this.root.classList.add('ql-blank');\n\t this.emitter = new _emitter4.default();\n\t this.scroll = _parchment2.default.create(this.root, {\n\t emitter: this.emitter,\n\t whitelist: this.options.formats\n\t });\n\t this.editor = new _editor2.default(this.scroll);\n\t this.selection = new _selection2.default(this.scroll, this.emitter);\n\t this.theme = new this.options.theme(this, this.options);\n\t this.keyboard = this.theme.addModule('keyboard');\n\t this.clipboard = this.theme.addModule('clipboard');\n\t this.history = this.theme.addModule('history');\n\t this.theme.init();\n\t this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) {\n\t if (type === _emitter4.default.events.TEXT_CHANGE) {\n\t _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank());\n\t }\n\t });\n\t this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) {\n\t var range = _this2.selection.lastRange;\n\t var index = range && range.length === 0 ? range.index : undefined;\n\t modify.call(_this2, function () {\n\t return _this2.editor.update(null, mutations, index);\n\t }, source);\n\t });\n\t var contents = this.clipboard.convert('
    ' + html + '


    ');\n\t this.setContents(contents);\n\t this.history.clear();\n\t if (this.options.placeholder) {\n\t this.root.setAttribute('data-placeholder', this.options.placeholder);\n\t }\n\t if (this.options.readOnly) {\n\t this.disable();\n\t }\n\t }\n\t\n\t _createClass(Quill, [{\n\t key: 'addContainer',\n\t value: function addContainer(container) {\n\t var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\t\n\t if (typeof container === 'string') {\n\t var className = container;\n\t container = document.createElement('div');\n\t container.classList.add(className);\n\t }\n\t this.container.insertBefore(container, refNode);\n\t return container;\n\t }\n\t }, {\n\t key: 'blur',\n\t value: function blur() {\n\t this.selection.setRange(null);\n\t }\n\t }, {\n\t key: 'deleteText',\n\t value: function deleteText(index, length, source) {\n\t var _this3 = this;\n\t\n\t var _overload = overload(index, length, source);\n\t\n\t var _overload2 = _slicedToArray(_overload, 4);\n\t\n\t index = _overload2[0];\n\t length = _overload2[1];\n\t source = _overload2[3];\n\t\n\t return modify.call(this, function () {\n\t return _this3.editor.deleteText(index, length);\n\t }, source, index, -1 * length);\n\t }\n\t }, {\n\t key: 'disable',\n\t value: function disable() {\n\t this.enable(false);\n\t }\n\t }, {\n\t key: 'enable',\n\t value: function enable() {\n\t var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\t\n\t this.scroll.enable(enabled);\n\t this.container.classList.toggle('ql-disabled', !enabled);\n\t if (!enabled) {\n\t this.blur();\n\t }\n\t }\n\t }, {\n\t key: 'focus',\n\t value: function focus() {\n\t this.selection.focus();\n\t this.selection.scrollIntoView();\n\t }\n\t }, {\n\t key: 'format',\n\t value: function format(name, value) {\n\t var _this4 = this;\n\t\n\t var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;\n\t\n\t return modify.call(this, function () {\n\t var range = _this4.getSelection(true);\n\t var change = new _quillDelta2.default();\n\t if (range == null) {\n\t return change;\n\t } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {\n\t change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value));\n\t } else if (range.length === 0) {\n\t _this4.selection.format(name, value);\n\t return change;\n\t } else {\n\t change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value));\n\t }\n\t _this4.setSelection(range, _emitter4.default.sources.SILENT);\n\t return change;\n\t }, source);\n\t }\n\t }, {\n\t key: 'formatLine',\n\t value: function formatLine(index, length, name, value, source) {\n\t var _this5 = this;\n\t\n\t var formats = void 0;\n\t\n\t var _overload3 = overload(index, length, name, value, source);\n\t\n\t var _overload4 = _slicedToArray(_overload3, 4);\n\t\n\t index = _overload4[0];\n\t length = _overload4[1];\n\t formats = _overload4[2];\n\t source = _overload4[3];\n\t\n\t return modify.call(this, function () {\n\t return _this5.editor.formatLine(index, length, formats);\n\t }, source, index, 0);\n\t }\n\t }, {\n\t key: 'formatText',\n\t value: function formatText(index, length, name, value, source) {\n\t var _this6 = this;\n\t\n\t var formats = void 0;\n\t\n\t var _overload5 = overload(index, length, name, value, source);\n\t\n\t var _overload6 = _slicedToArray(_overload5, 4);\n\t\n\t index = _overload6[0];\n\t length = _overload6[1];\n\t formats = _overload6[2];\n\t source = _overload6[3];\n\t\n\t return modify.call(this, function () {\n\t return _this6.editor.formatText(index, length, formats);\n\t }, source, index, 0);\n\t }\n\t }, {\n\t key: 'getBounds',\n\t value: function getBounds(index) {\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\t\n\t if (typeof index === 'number') {\n\t return this.selection.getBounds(index, length);\n\t } else {\n\t return this.selection.getBounds(index.index, index.length);\n\t }\n\t }\n\t }, {\n\t key: 'getContents',\n\t value: function getContents() {\n\t var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\t\n\t var _overload7 = overload(index, length);\n\t\n\t var _overload8 = _slicedToArray(_overload7, 2);\n\t\n\t index = _overload8[0];\n\t length = _overload8[1];\n\t\n\t return this.editor.getContents(index, length);\n\t }\n\t }, {\n\t key: 'getFormat',\n\t value: function getFormat() {\n\t var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection();\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\t\n\t if (typeof index === 'number') {\n\t return this.editor.getFormat(index, length);\n\t } else {\n\t return this.editor.getFormat(index.index, index.length);\n\t }\n\t }\n\t }, {\n\t key: 'getLength',\n\t value: function getLength() {\n\t return this.scroll.length();\n\t }\n\t }, {\n\t key: 'getModule',\n\t value: function getModule(name) {\n\t return this.theme.modules[name];\n\t }\n\t }, {\n\t key: 'getSelection',\n\t value: function getSelection() {\n\t var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\t\n\t if (focus) this.focus();\n\t this.update(); // Make sure we access getRange with editor in consistent state\n\t return this.selection.getRange()[0];\n\t }\n\t }, {\n\t key: 'getText',\n\t value: function getText() {\n\t var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\t\n\t var _overload9 = overload(index, length);\n\t\n\t var _overload10 = _slicedToArray(_overload9, 2);\n\t\n\t index = _overload10[0];\n\t length = _overload10[1];\n\t\n\t return this.editor.getText(index, length);\n\t }\n\t }, {\n\t key: 'hasFocus',\n\t value: function hasFocus() {\n\t return this.selection.hasFocus();\n\t }\n\t }, {\n\t key: 'insertEmbed',\n\t value: function insertEmbed(index, embed, value) {\n\t var _this7 = this;\n\t\n\t var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n\t\n\t return modify.call(this, function () {\n\t return _this7.editor.insertEmbed(index, embed, value);\n\t }, source, index);\n\t }\n\t }, {\n\t key: 'insertText',\n\t value: function insertText(index, text, name, value, source) {\n\t var _this8 = this;\n\t\n\t var formats = void 0;\n\t\n\t var _overload11 = overload(index, 0, name, value, source);\n\t\n\t var _overload12 = _slicedToArray(_overload11, 4);\n\t\n\t index = _overload12[0];\n\t formats = _overload12[2];\n\t source = _overload12[3];\n\t\n\t return modify.call(this, function () {\n\t return _this8.editor.insertText(index, text, formats);\n\t }, source, index, text.length);\n\t }\n\t }, {\n\t key: 'isEnabled',\n\t value: function isEnabled() {\n\t return !this.container.classList.contains('ql-disabled');\n\t }\n\t }, {\n\t key: 'off',\n\t value: function off() {\n\t return this.emitter.off.apply(this.emitter, arguments);\n\t }\n\t }, {\n\t key: 'on',\n\t value: function on() {\n\t return this.emitter.on.apply(this.emitter, arguments);\n\t }\n\t }, {\n\t key: 'once',\n\t value: function once() {\n\t return this.emitter.once.apply(this.emitter, arguments);\n\t }\n\t }, {\n\t key: 'pasteHTML',\n\t value: function pasteHTML(index, html, source) {\n\t this.clipboard.dangerouslyPasteHTML(index, html, source);\n\t }\n\t }, {\n\t key: 'removeFormat',\n\t value: function removeFormat(index, length, source) {\n\t var _this9 = this;\n\t\n\t var _overload13 = overload(index, length, source);\n\t\n\t var _overload14 = _slicedToArray(_overload13, 4);\n\t\n\t index = _overload14[0];\n\t length = _overload14[1];\n\t source = _overload14[3];\n\t\n\t return modify.call(this, function () {\n\t return _this9.editor.removeFormat(index, length);\n\t }, source, index);\n\t }\n\t }, {\n\t key: 'setContents',\n\t value: function setContents(delta) {\n\t var _this10 = this;\n\t\n\t var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\t\n\t return modify.call(this, function () {\n\t delta = new _quillDelta2.default(delta);\n\t var length = _this10.getLength();\n\t var deleted = _this10.editor.deleteText(0, length);\n\t var applied = _this10.editor.applyDelta(delta);\n\t var lastOp = applied.ops[applied.ops.length - 1];\n\t if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\\n') {\n\t _this10.editor.deleteText(_this10.getLength() - 1, 1);\n\t applied.delete(1);\n\t }\n\t var ret = deleted.compose(applied);\n\t return ret;\n\t }, source);\n\t }\n\t }, {\n\t key: 'setSelection',\n\t value: function setSelection(index, length, source) {\n\t if (index == null) {\n\t this.selection.setRange(null, length || Quill.sources.API);\n\t } else {\n\t var _overload15 = overload(index, length, source);\n\t\n\t var _overload16 = _slicedToArray(_overload15, 4);\n\t\n\t index = _overload16[0];\n\t length = _overload16[1];\n\t source = _overload16[3];\n\t\n\t this.selection.setRange(new _selection.Range(index, length), source);\n\t }\n\t this.selection.scrollIntoView();\n\t }\n\t }, {\n\t key: 'setText',\n\t value: function setText(text) {\n\t var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\t\n\t var delta = new _quillDelta2.default().insert(text);\n\t return this.setContents(delta, source);\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update() {\n\t var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;\n\t\n\t var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n\t this.selection.update(source);\n\t return change;\n\t }\n\t }, {\n\t key: 'updateContents',\n\t value: function updateContents(delta) {\n\t var _this11 = this;\n\t\n\t var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\t\n\t return modify.call(this, function () {\n\t delta = new _quillDelta2.default(delta);\n\t return _this11.editor.applyDelta(delta, source);\n\t }, source, true);\n\t }\n\t }]);\n\t\n\t return Quill;\n\t}();\n\t\n\tQuill.DEFAULTS = {\n\t bounds: null,\n\t formats: null,\n\t modules: {},\n\t placeholder: '',\n\t readOnly: false,\n\t strict: true,\n\t theme: 'default'\n\t};\n\tQuill.events = _emitter4.default.events;\n\tQuill.sources = _emitter4.default.sources;\n\t// eslint-disable-next-line no-undef\n\tQuill.version = false ? 'dev' : (\"1.1.5\");\n\t\n\tQuill.imports = {\n\t 'delta': _quillDelta2.default,\n\t 'parchment': _parchment2.default,\n\t 'core/module': _module2.default,\n\t 'core/theme': _theme2.default\n\t};\n\t\n\tfunction expandConfig(container, userConfig) {\n\t userConfig = (0, _extend2.default)(true, {\n\t container: container,\n\t modules: {\n\t clipboard: true,\n\t keyboard: true,\n\t history: true\n\t }\n\t }, userConfig);\n\t if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n\t userConfig.theme = _theme2.default;\n\t } else {\n\t userConfig.theme = Quill.import('themes/' + userConfig.theme);\n\t if (userConfig.theme == null) {\n\t throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?');\n\t }\n\t }\n\t var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS);\n\t [themeConfig, userConfig].forEach(function (config) {\n\t config.modules = config.modules || {};\n\t Object.keys(config.modules).forEach(function (module) {\n\t if (config.modules[module] === true) {\n\t config.modules[module] = {};\n\t }\n\t });\n\t });\n\t var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n\t var moduleConfig = moduleNames.reduce(function (config, name) {\n\t var moduleClass = Quill.import('modules/' + name);\n\t if (moduleClass == null) {\n\t debug.error('Cannot load ' + name + ' module. Are you sure you registered it?');\n\t } else {\n\t config[name] = moduleClass.DEFAULTS || {};\n\t }\n\t return config;\n\t }, {});\n\t // Special case toolbar shorthand\n\t if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {\n\t userConfig.modules.toolbar = {\n\t container: userConfig.modules.toolbar\n\t };\n\t }\n\t userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n\t ['bounds', 'container'].forEach(function (key) {\n\t if (typeof userConfig[key] === 'string') {\n\t userConfig[key] = document.querySelector(userConfig[key]);\n\t }\n\t });\n\t userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) {\n\t if (userConfig.modules[name]) {\n\t config[name] = userConfig.modules[name];\n\t }\n\t return config;\n\t }, {});\n\t return userConfig;\n\t}\n\t\n\t// Handle selection preservation and TEXT_CHANGE emission\n\t// common to modification APIs\n\tfunction modify(modifier, source, index, shift) {\n\t if (!this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n\t return new _quillDelta2.default();\n\t }\n\t var range = index == null ? null : this.getSelection();\n\t var oldDelta = this.editor.delta;\n\t var change = modifier();\n\t if (range != null) {\n\t if (index === true) index = range.index;\n\t if (shift == null) {\n\t range = shiftRange(range, change, source);\n\t } else if (shift !== 0) {\n\t range = shiftRange(range, index, shift, source);\n\t }\n\t this.setSelection(range, _emitter4.default.sources.SILENT);\n\t }\n\t if (change.length() > 0) {\n\t var _emitter;\n\t\n\t var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n\t (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n\t if (source !== _emitter4.default.sources.SILENT) {\n\t var _emitter2;\n\t\n\t (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n\t }\n\t }\n\t return change;\n\t}\n\t\n\tfunction overload(index, length, name, value, source) {\n\t var formats = {};\n\t if (typeof index.index === 'number' && typeof index.length === 'number') {\n\t // Allow for throwaway end (used by insertText/insertEmbed)\n\t if (typeof length !== 'number') {\n\t source = value, value = name, name = length, length = index.length, index = index.index;\n\t } else {\n\t length = index.length, index = index.index;\n\t }\n\t } else if (typeof length !== 'number') {\n\t source = value, value = name, name = length, length = 0;\n\t }\n\t // Handle format being object, two format name/value strings or excluded\n\t if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n\t formats = name;\n\t source = value;\n\t } else if (typeof name === 'string') {\n\t if (value != null) {\n\t formats[name] = value;\n\t } else {\n\t source = name;\n\t }\n\t }\n\t // Handle optional source\n\t source = source || _emitter4.default.sources.API;\n\t return [index, length, formats, source];\n\t}\n\t\n\tfunction shiftRange(range, index, length, source) {\n\t if (range == null) return null;\n\t var start = void 0,\n\t end = void 0;\n\t if (index instanceof _quillDelta2.default) {\n\t var _map = [range.index, range.index + range.length].map(function (pos) {\n\t return index.transformPosition(pos, source === _emitter4.default.sources.USER);\n\t });\n\t\n\t var _map2 = _slicedToArray(_map, 2);\n\t\n\t start = _map2[0];\n\t end = _map2[1];\n\t } else {\n\t var _map3 = [range.index, range.index + range.length].map(function (pos) {\n\t if (pos < index || pos === index && source !== _emitter4.default.sources.USER) return pos;\n\t if (length >= 0) {\n\t return pos + length;\n\t } else {\n\t return Math.max(index, pos + length);\n\t }\n\t });\n\t\n\t var _map4 = _slicedToArray(_map3, 2);\n\t\n\t start = _map4[0];\n\t end = _map4[1];\n\t }\n\t return new _selection.Range(start, end - start);\n\t}\n\t\n\texports.expandConfig = expandConfig;\n\texports.overload = overload;\n\texports.default = Quill;\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar elem = document.createElement('div');\n\telem.classList.toggle('test-class', false);\n\tif (elem.classList.contains('test-class')) {\n\t (function () {\n\t var _toggle = DOMTokenList.prototype.toggle;\n\t DOMTokenList.prototype.toggle = function (token, force) {\n\t if (arguments.length > 1 && !this.contains(token) === !force) {\n\t return force;\n\t } else {\n\t return _toggle.call(this, token);\n\t }\n\t };\n\t })();\n\t}\n\t\n\tif (!String.prototype.startsWith) {\n\t String.prototype.startsWith = function (searchString, position) {\n\t position = position || 0;\n\t return this.substr(position, searchString.length) === searchString;\n\t };\n\t}\n\t\n\tif (!String.prototype.endsWith) {\n\t String.prototype.endsWith = function (searchString, position) {\n\t var subjectString = this.toString();\n\t if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n\t position = subjectString.length;\n\t }\n\t position -= searchString.length;\n\t var lastIndex = subjectString.indexOf(searchString, position);\n\t return lastIndex !== -1 && lastIndex === position;\n\t };\n\t}\n\t\n\tif (!Array.prototype.find) {\n\t Object.defineProperty(Array.prototype, \"find\", {\n\t value: function value(predicate) {\n\t if (this === null) {\n\t throw new TypeError('Array.prototype.find called on null or undefined');\n\t }\n\t if (typeof predicate !== 'function') {\n\t throw new TypeError('predicate must be a function');\n\t }\n\t var list = Object(this);\n\t var length = list.length >>> 0;\n\t var thisArg = arguments[1];\n\t var value;\n\t\n\t for (var i = 0; i < length; i++) {\n\t value = list[i];\n\t if (predicate.call(thisArg, value, i, list)) {\n\t return value;\n\t }\n\t }\n\t return undefined;\n\t }\n\t });\n\t}\n\t\n\t// Disable resizing in Firefox\n\tdocument.addEventListener(\"DOMContentLoaded\", function () {\n\t document.execCommand(\"enableObjectResizing\", false, false);\n\t});\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar diff = __webpack_require__(21);\n\tvar equal = __webpack_require__(22);\n\tvar extend = __webpack_require__(25);\n\tvar op = __webpack_require__(26);\n\t\n\t\n\tvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\t\n\t\n\tvar Delta = function (ops) {\n\t // Assume we are given a well formed ops\n\t if (Array.isArray(ops)) {\n\t this.ops = ops;\n\t } else if (ops != null && Array.isArray(ops.ops)) {\n\t this.ops = ops.ops;\n\t } else {\n\t this.ops = [];\n\t }\n\t};\n\t\n\t\n\tDelta.prototype.insert = function (text, attributes) {\n\t var newOp = {};\n\t if (text.length === 0) return this;\n\t newOp.insert = text;\n\t if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n\t newOp.attributes = attributes;\n\t }\n\t return this.push(newOp);\n\t};\n\t\n\tDelta.prototype['delete'] = function (length) {\n\t if (length <= 0) return this;\n\t return this.push({ 'delete': length });\n\t};\n\t\n\tDelta.prototype.retain = function (length, attributes) {\n\t if (length <= 0) return this;\n\t var newOp = { retain: length };\n\t if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n\t newOp.attributes = attributes;\n\t }\n\t return this.push(newOp);\n\t};\n\t\n\tDelta.prototype.push = function (newOp) {\n\t var index = this.ops.length;\n\t var lastOp = this.ops[index - 1];\n\t newOp = extend(true, {}, newOp);\n\t if (typeof lastOp === 'object') {\n\t if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {\n\t this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };\n\t return this;\n\t }\n\t // Since it does not matter if we insert before or after deleting at the same index,\n\t // always prefer to insert first\n\t if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {\n\t index -= 1;\n\t lastOp = this.ops[index - 1];\n\t if (typeof lastOp !== 'object') {\n\t this.ops.unshift(newOp);\n\t return this;\n\t }\n\t }\n\t if (equal(newOp.attributes, lastOp.attributes)) {\n\t if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {\n\t this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n\t if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n\t return this;\n\t } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {\n\t this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n\t if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n\t return this;\n\t }\n\t }\n\t }\n\t if (index === this.ops.length) {\n\t this.ops.push(newOp);\n\t } else {\n\t this.ops.splice(index, 0, newOp);\n\t }\n\t return this;\n\t};\n\t\n\tDelta.prototype.filter = function (predicate) {\n\t return this.ops.filter(predicate);\n\t};\n\t\n\tDelta.prototype.forEach = function (predicate) {\n\t this.ops.forEach(predicate);\n\t};\n\t\n\tDelta.prototype.map = function (predicate) {\n\t return this.ops.map(predicate);\n\t};\n\t\n\tDelta.prototype.partition = function (predicate) {\n\t var passed = [], failed = [];\n\t this.forEach(function(op) {\n\t var target = predicate(op) ? passed : failed;\n\t target.push(op);\n\t });\n\t return [passed, failed];\n\t};\n\t\n\tDelta.prototype.reduce = function (predicate, initial) {\n\t return this.ops.reduce(predicate, initial);\n\t};\n\t\n\tDelta.prototype.chop = function () {\n\t var lastOp = this.ops[this.ops.length - 1];\n\t if (lastOp && lastOp.retain && !lastOp.attributes) {\n\t this.ops.pop();\n\t }\n\t return this;\n\t};\n\t\n\tDelta.prototype.length = function () {\n\t return this.reduce(function (length, elem) {\n\t return length + op.length(elem);\n\t }, 0);\n\t};\n\t\n\tDelta.prototype.slice = function (start, end) {\n\t start = start || 0;\n\t if (typeof end !== 'number') end = Infinity;\n\t var ops = [];\n\t var iter = op.iterator(this.ops);\n\t var index = 0;\n\t while (index < end && iter.hasNext()) {\n\t var nextOp;\n\t if (index < start) {\n\t nextOp = iter.next(start - index);\n\t } else {\n\t nextOp = iter.next(end - index);\n\t ops.push(nextOp);\n\t }\n\t index += op.length(nextOp);\n\t }\n\t return new Delta(ops);\n\t};\n\t\n\t\n\tDelta.prototype.compose = function (other) {\n\t var thisIter = op.iterator(this.ops);\n\t var otherIter = op.iterator(other.ops);\n\t var delta = new Delta();\n\t while (thisIter.hasNext() || otherIter.hasNext()) {\n\t if (otherIter.peekType() === 'insert') {\n\t delta.push(otherIter.next());\n\t } else if (thisIter.peekType() === 'delete') {\n\t delta.push(thisIter.next());\n\t } else {\n\t var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n\t var thisOp = thisIter.next(length);\n\t var otherOp = otherIter.next(length);\n\t if (typeof otherOp.retain === 'number') {\n\t var newOp = {};\n\t if (typeof thisOp.retain === 'number') {\n\t newOp.retain = length;\n\t } else {\n\t newOp.insert = thisOp.insert;\n\t }\n\t // Preserve null when composing with a retain, otherwise remove it for inserts\n\t var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n\t if (attributes) newOp.attributes = attributes;\n\t delta.push(newOp);\n\t // Other op should be delete, we could be an insert or retain\n\t // Insert + delete cancels out\n\t } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {\n\t delta.push(otherOp);\n\t }\n\t }\n\t }\n\t return delta.chop();\n\t};\n\t\n\tDelta.prototype.concat = function (other) {\n\t var delta = new Delta(this.ops.slice());\n\t if (other.ops.length > 0) {\n\t delta.push(other.ops[0]);\n\t delta.ops = delta.ops.concat(other.ops.slice(1));\n\t }\n\t return delta;\n\t};\n\t\n\tDelta.prototype.diff = function (other, index) {\n\t if (this.ops === other.ops) {\n\t return new Delta();\n\t }\n\t var strings = [this, other].map(function (delta) {\n\t return delta.map(function (op) {\n\t if (op.insert != null) {\n\t return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n\t }\n\t var prep = (delta === other) ? 'on' : 'with';\n\t throw new Error('diff() called ' + prep + ' non-document');\n\t }).join('');\n\t });\n\t var delta = new Delta();\n\t var diffResult = diff(strings[0], strings[1], index);\n\t var thisIter = op.iterator(this.ops);\n\t var otherIter = op.iterator(other.ops);\n\t diffResult.forEach(function (component) {\n\t var length = component[1].length;\n\t while (length > 0) {\n\t var opLength = 0;\n\t switch (component[0]) {\n\t case diff.INSERT:\n\t opLength = Math.min(otherIter.peekLength(), length);\n\t delta.push(otherIter.next(opLength));\n\t break;\n\t case diff.DELETE:\n\t opLength = Math.min(length, thisIter.peekLength());\n\t thisIter.next(opLength);\n\t delta['delete'](opLength);\n\t break;\n\t case diff.EQUAL:\n\t opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n\t var thisOp = thisIter.next(opLength);\n\t var otherOp = otherIter.next(opLength);\n\t if (equal(thisOp.insert, otherOp.insert)) {\n\t delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));\n\t } else {\n\t delta.push(otherOp)['delete'](opLength);\n\t }\n\t break;\n\t }\n\t length -= opLength;\n\t }\n\t });\n\t return delta.chop();\n\t};\n\t\n\tDelta.prototype.eachLine = function (predicate, newline) {\n\t newline = newline || '\\n';\n\t var iter = op.iterator(this.ops);\n\t var line = new Delta();\n\t while (iter.hasNext()) {\n\t if (iter.peekType() !== 'insert') return;\n\t var thisOp = iter.peek();\n\t var start = op.length(thisOp) - iter.peekLength();\n\t var index = typeof thisOp.insert === 'string' ?\n\t thisOp.insert.indexOf(newline, start) - start : -1;\n\t if (index < 0) {\n\t line.push(iter.next());\n\t } else if (index > 0) {\n\t line.push(iter.next(index));\n\t } else {\n\t predicate(line, iter.next(1).attributes || {});\n\t line = new Delta();\n\t }\n\t }\n\t if (line.length() > 0) {\n\t predicate(line, {});\n\t }\n\t};\n\t\n\tDelta.prototype.transform = function (other, priority) {\n\t priority = !!priority;\n\t if (typeof other === 'number') {\n\t return this.transformPosition(other, priority);\n\t }\n\t var thisIter = op.iterator(this.ops);\n\t var otherIter = op.iterator(other.ops);\n\t var delta = new Delta();\n\t while (thisIter.hasNext() || otherIter.hasNext()) {\n\t if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {\n\t delta.retain(op.length(thisIter.next()));\n\t } else if (otherIter.peekType() === 'insert') {\n\t delta.push(otherIter.next());\n\t } else {\n\t var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n\t var thisOp = thisIter.next(length);\n\t var otherOp = otherIter.next(length);\n\t if (thisOp['delete']) {\n\t // Our delete either makes their delete redundant or removes their retain\n\t continue;\n\t } else if (otherOp['delete']) {\n\t delta.push(otherOp);\n\t } else {\n\t // We retain either their retain or insert\n\t delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));\n\t }\n\t }\n\t }\n\t return delta.chop();\n\t};\n\t\n\tDelta.prototype.transformPosition = function (index, priority) {\n\t priority = !!priority;\n\t var thisIter = op.iterator(this.ops);\n\t var offset = 0;\n\t while (thisIter.hasNext() && offset <= index) {\n\t var length = thisIter.peekLength();\n\t var nextType = thisIter.peekType();\n\t thisIter.next();\n\t if (nextType === 'delete') {\n\t index -= Math.min(length, index - offset);\n\t continue;\n\t } else if (nextType === 'insert' && (offset < index || !priority)) {\n\t index += length;\n\t }\n\t offset += length;\n\t }\n\t return index;\n\t};\n\t\n\t\n\tmodule.exports = Delta;\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t/**\n\t * This library modifies the diff-patch-match library by Neil Fraser\n\t * by removing the patch and match functionality and certain advanced\n\t * options in the diff function. The original license is as follows:\n\t *\n\t * ===\n\t *\n\t * Diff Match and Patch\n\t *\n\t * Copyright 2006 Google Inc.\n\t * http://code.google.com/p/google-diff-match-patch/\n\t *\n\t * Licensed under the Apache License, Version 2.0 (the \"License\");\n\t * you may not use this file except in compliance with the License.\n\t * You may obtain a copy of the License at\n\t *\n\t * http://www.apache.org/licenses/LICENSE-2.0\n\t *\n\t * Unless required by applicable law or agreed to in writing, software\n\t * distributed under the License is distributed on an \"AS IS\" BASIS,\n\t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\t * See the License for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t\n\t/**\n\t * The data structure representing a diff is an array of tuples:\n\t * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n\t * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n\t */\n\tvar DIFF_DELETE = -1;\n\tvar DIFF_INSERT = 1;\n\tvar DIFF_EQUAL = 0;\n\t\n\t\n\t/**\n\t * Find the differences between two texts. Simplifies the problem by stripping\n\t * any common prefix or suffix off the texts before diffing.\n\t * @param {string} text1 Old string to be diffed.\n\t * @param {string} text2 New string to be diffed.\n\t * @param {Int} cursor_pos Expected edit position in text1 (optional)\n\t * @return {Array} Array of diff tuples.\n\t */\n\tfunction diff_main(text1, text2, cursor_pos) {\n\t // Check for equality (speedup).\n\t if (text1 == text2) {\n\t if (text1) {\n\t return [[DIFF_EQUAL, text1]];\n\t }\n\t return [];\n\t }\n\t\n\t // Check cursor_pos within bounds\n\t if (cursor_pos < 0 || text1.length < cursor_pos) {\n\t cursor_pos = null;\n\t }\n\t\n\t // Trim off common prefix (speedup).\n\t var commonlength = diff_commonPrefix(text1, text2);\n\t var commonprefix = text1.substring(0, commonlength);\n\t text1 = text1.substring(commonlength);\n\t text2 = text2.substring(commonlength);\n\t\n\t // Trim off common suffix (speedup).\n\t commonlength = diff_commonSuffix(text1, text2);\n\t var commonsuffix = text1.substring(text1.length - commonlength);\n\t text1 = text1.substring(0, text1.length - commonlength);\n\t text2 = text2.substring(0, text2.length - commonlength);\n\t\n\t // Compute the diff on the middle block.\n\t var diffs = diff_compute_(text1, text2);\n\t\n\t // Restore the prefix and suffix.\n\t if (commonprefix) {\n\t diffs.unshift([DIFF_EQUAL, commonprefix]);\n\t }\n\t if (commonsuffix) {\n\t diffs.push([DIFF_EQUAL, commonsuffix]);\n\t }\n\t diff_cleanupMerge(diffs);\n\t if (cursor_pos != null) {\n\t diffs = fix_cursor(diffs, cursor_pos);\n\t }\n\t return diffs;\n\t};\n\t\n\t\n\t/**\n\t * Find the differences between two texts. Assumes that the texts do not\n\t * have any common prefix or suffix.\n\t * @param {string} text1 Old string to be diffed.\n\t * @param {string} text2 New string to be diffed.\n\t * @return {Array} Array of diff tuples.\n\t */\n\tfunction diff_compute_(text1, text2) {\n\t var diffs;\n\t\n\t if (!text1) {\n\t // Just add some text (speedup).\n\t return [[DIFF_INSERT, text2]];\n\t }\n\t\n\t if (!text2) {\n\t // Just delete some text (speedup).\n\t return [[DIFF_DELETE, text1]];\n\t }\n\t\n\t var longtext = text1.length > text2.length ? text1 : text2;\n\t var shorttext = text1.length > text2.length ? text2 : text1;\n\t var i = longtext.indexOf(shorttext);\n\t if (i != -1) {\n\t // Shorter text is inside the longer text (speedup).\n\t diffs = [[DIFF_INSERT, longtext.substring(0, i)],\n\t [DIFF_EQUAL, shorttext],\n\t [DIFF_INSERT, longtext.substring(i + shorttext.length)]];\n\t // Swap insertions for deletions if diff is reversed.\n\t if (text1.length > text2.length) {\n\t diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n\t }\n\t return diffs;\n\t }\n\t\n\t if (shorttext.length == 1) {\n\t // Single character string.\n\t // After the previous speedup, the character can't be an equality.\n\t return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n\t }\n\t\n\t // Check to see if the problem can be split in two.\n\t var hm = diff_halfMatch_(text1, text2);\n\t if (hm) {\n\t // A half-match was found, sort out the return data.\n\t var text1_a = hm[0];\n\t var text1_b = hm[1];\n\t var text2_a = hm[2];\n\t var text2_b = hm[3];\n\t var mid_common = hm[4];\n\t // Send both pairs off for separate processing.\n\t var diffs_a = diff_main(text1_a, text2_a);\n\t var diffs_b = diff_main(text1_b, text2_b);\n\t // Merge the results.\n\t return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n\t }\n\t\n\t return diff_bisect_(text1, text2);\n\t};\n\t\n\t\n\t/**\n\t * Find the 'middle snake' of a diff, split the problem in two\n\t * and return the recursively constructed diff.\n\t * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n\t * @param {string} text1 Old string to be diffed.\n\t * @param {string} text2 New string to be diffed.\n\t * @return {Array} Array of diff tuples.\n\t * @private\n\t */\n\tfunction diff_bisect_(text1, text2) {\n\t // Cache the text lengths to prevent multiple calls.\n\t var text1_length = text1.length;\n\t var text2_length = text2.length;\n\t var max_d = Math.ceil((text1_length + text2_length) / 2);\n\t var v_offset = max_d;\n\t var v_length = 2 * max_d;\n\t var v1 = new Array(v_length);\n\t var v2 = new Array(v_length);\n\t // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n\t // integers and undefined.\n\t for (var x = 0; x < v_length; x++) {\n\t v1[x] = -1;\n\t v2[x] = -1;\n\t }\n\t v1[v_offset + 1] = 0;\n\t v2[v_offset + 1] = 0;\n\t var delta = text1_length - text2_length;\n\t // If the total number of characters is odd, then the front path will collide\n\t // with the reverse path.\n\t var front = (delta % 2 != 0);\n\t // Offsets for start and end of k loop.\n\t // Prevents mapping of space beyond the grid.\n\t var k1start = 0;\n\t var k1end = 0;\n\t var k2start = 0;\n\t var k2end = 0;\n\t for (var d = 0; d < max_d; d++) {\n\t // Walk the front path one step.\n\t for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n\t var k1_offset = v_offset + k1;\n\t var x1;\n\t if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n\t x1 = v1[k1_offset + 1];\n\t } else {\n\t x1 = v1[k1_offset - 1] + 1;\n\t }\n\t var y1 = x1 - k1;\n\t while (x1 < text1_length && y1 < text2_length &&\n\t text1.charAt(x1) == text2.charAt(y1)) {\n\t x1++;\n\t y1++;\n\t }\n\t v1[k1_offset] = x1;\n\t if (x1 > text1_length) {\n\t // Ran off the right of the graph.\n\t k1end += 2;\n\t } else if (y1 > text2_length) {\n\t // Ran off the bottom of the graph.\n\t k1start += 2;\n\t } else if (front) {\n\t var k2_offset = v_offset + delta - k1;\n\t if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n\t // Mirror x2 onto top-left coordinate system.\n\t var x2 = text1_length - v2[k2_offset];\n\t if (x1 >= x2) {\n\t // Overlap detected.\n\t return diff_bisectSplit_(text1, text2, x1, y1);\n\t }\n\t }\n\t }\n\t }\n\t\n\t // Walk the reverse path one step.\n\t for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n\t var k2_offset = v_offset + k2;\n\t var x2;\n\t if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n\t x2 = v2[k2_offset + 1];\n\t } else {\n\t x2 = v2[k2_offset - 1] + 1;\n\t }\n\t var y2 = x2 - k2;\n\t while (x2 < text1_length && y2 < text2_length &&\n\t text1.charAt(text1_length - x2 - 1) ==\n\t text2.charAt(text2_length - y2 - 1)) {\n\t x2++;\n\t y2++;\n\t }\n\t v2[k2_offset] = x2;\n\t if (x2 > text1_length) {\n\t // Ran off the left of the graph.\n\t k2end += 2;\n\t } else if (y2 > text2_length) {\n\t // Ran off the top of the graph.\n\t k2start += 2;\n\t } else if (!front) {\n\t var k1_offset = v_offset + delta - k2;\n\t if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n\t var x1 = v1[k1_offset];\n\t var y1 = v_offset + x1 - k1_offset;\n\t // Mirror x2 onto top-left coordinate system.\n\t x2 = text1_length - x2;\n\t if (x1 >= x2) {\n\t // Overlap detected.\n\t return diff_bisectSplit_(text1, text2, x1, y1);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t // Diff took too long and hit the deadline or\n\t // number of diffs equals number of characters, no commonality at all.\n\t return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n\t};\n\t\n\t\n\t/**\n\t * Given the location of the 'middle snake', split the diff in two parts\n\t * and recurse.\n\t * @param {string} text1 Old string to be diffed.\n\t * @param {string} text2 New string to be diffed.\n\t * @param {number} x Index of split point in text1.\n\t * @param {number} y Index of split point in text2.\n\t * @return {Array} Array of diff tuples.\n\t */\n\tfunction diff_bisectSplit_(text1, text2, x, y) {\n\t var text1a = text1.substring(0, x);\n\t var text2a = text2.substring(0, y);\n\t var text1b = text1.substring(x);\n\t var text2b = text2.substring(y);\n\t\n\t // Compute both diffs serially.\n\t var diffs = diff_main(text1a, text2a);\n\t var diffsb = diff_main(text1b, text2b);\n\t\n\t return diffs.concat(diffsb);\n\t};\n\t\n\t\n\t/**\n\t * Determine the common prefix of two strings.\n\t * @param {string} text1 First string.\n\t * @param {string} text2 Second string.\n\t * @return {number} The number of characters common to the start of each\n\t * string.\n\t */\n\tfunction diff_commonPrefix(text1, text2) {\n\t // Quick check for common null cases.\n\t if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n\t return 0;\n\t }\n\t // Binary search.\n\t // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n\t var pointermin = 0;\n\t var pointermax = Math.min(text1.length, text2.length);\n\t var pointermid = pointermax;\n\t var pointerstart = 0;\n\t while (pointermin < pointermid) {\n\t if (text1.substring(pointerstart, pointermid) ==\n\t text2.substring(pointerstart, pointermid)) {\n\t pointermin = pointermid;\n\t pointerstart = pointermin;\n\t } else {\n\t pointermax = pointermid;\n\t }\n\t pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n\t }\n\t return pointermid;\n\t};\n\t\n\t\n\t/**\n\t * Determine the common suffix of two strings.\n\t * @param {string} text1 First string.\n\t * @param {string} text2 Second string.\n\t * @return {number} The number of characters common to the end of each string.\n\t */\n\tfunction diff_commonSuffix(text1, text2) {\n\t // Quick check for common null cases.\n\t if (!text1 || !text2 ||\n\t text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n\t return 0;\n\t }\n\t // Binary search.\n\t // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n\t var pointermin = 0;\n\t var pointermax = Math.min(text1.length, text2.length);\n\t var pointermid = pointermax;\n\t var pointerend = 0;\n\t while (pointermin < pointermid) {\n\t if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n\t text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n\t pointermin = pointermid;\n\t pointerend = pointermin;\n\t } else {\n\t pointermax = pointermid;\n\t }\n\t pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n\t }\n\t return pointermid;\n\t};\n\t\n\t\n\t/**\n\t * Do the two texts share a substring which is at least half the length of the\n\t * longer text?\n\t * This speedup can produce non-minimal diffs.\n\t * @param {string} text1 First string.\n\t * @param {string} text2 Second string.\n\t * @return {Array.} Five element Array, containing the prefix of\n\t * text1, the suffix of text1, the prefix of text2, the suffix of\n\t * text2 and the common middle. Or null if there was no match.\n\t */\n\tfunction diff_halfMatch_(text1, text2) {\n\t var longtext = text1.length > text2.length ? text1 : text2;\n\t var shorttext = text1.length > text2.length ? text2 : text1;\n\t if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n\t return null; // Pointless.\n\t }\n\t\n\t /**\n\t * Does a substring of shorttext exist within longtext such that the substring\n\t * is at least half the length of longtext?\n\t * Closure, but does not reference any external variables.\n\t * @param {string} longtext Longer string.\n\t * @param {string} shorttext Shorter string.\n\t * @param {number} i Start index of quarter length substring within longtext.\n\t * @return {Array.} Five element Array, containing the prefix of\n\t * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n\t * of shorttext and the common middle. Or null if there was no match.\n\t * @private\n\t */\n\t function diff_halfMatchI_(longtext, shorttext, i) {\n\t // Start with a 1/4 length substring at position i as a seed.\n\t var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n\t var j = -1;\n\t var best_common = '';\n\t var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n\t while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n\t var prefixLength = diff_commonPrefix(longtext.substring(i),\n\t shorttext.substring(j));\n\t var suffixLength = diff_commonSuffix(longtext.substring(0, i),\n\t shorttext.substring(0, j));\n\t if (best_common.length < suffixLength + prefixLength) {\n\t best_common = shorttext.substring(j - suffixLength, j) +\n\t shorttext.substring(j, j + prefixLength);\n\t best_longtext_a = longtext.substring(0, i - suffixLength);\n\t best_longtext_b = longtext.substring(i + prefixLength);\n\t best_shorttext_a = shorttext.substring(0, j - suffixLength);\n\t best_shorttext_b = shorttext.substring(j + prefixLength);\n\t }\n\t }\n\t if (best_common.length * 2 >= longtext.length) {\n\t return [best_longtext_a, best_longtext_b,\n\t best_shorttext_a, best_shorttext_b, best_common];\n\t } else {\n\t return null;\n\t }\n\t }\n\t\n\t // First check if the second quarter is the seed for a half-match.\n\t var hm1 = diff_halfMatchI_(longtext, shorttext,\n\t Math.ceil(longtext.length / 4));\n\t // Check again based on the third quarter.\n\t var hm2 = diff_halfMatchI_(longtext, shorttext,\n\t Math.ceil(longtext.length / 2));\n\t var hm;\n\t if (!hm1 && !hm2) {\n\t return null;\n\t } else if (!hm2) {\n\t hm = hm1;\n\t } else if (!hm1) {\n\t hm = hm2;\n\t } else {\n\t // Both matched. Select the longest.\n\t hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n\t }\n\t\n\t // A half-match was found, sort out the return data.\n\t var text1_a, text1_b, text2_a, text2_b;\n\t if (text1.length > text2.length) {\n\t text1_a = hm[0];\n\t text1_b = hm[1];\n\t text2_a = hm[2];\n\t text2_b = hm[3];\n\t } else {\n\t text2_a = hm[0];\n\t text2_b = hm[1];\n\t text1_a = hm[2];\n\t text1_b = hm[3];\n\t }\n\t var mid_common = hm[4];\n\t return [text1_a, text1_b, text2_a, text2_b, mid_common];\n\t};\n\t\n\t\n\t/**\n\t * Reorder and merge like edit sections. Merge equalities.\n\t * Any edit section can move as long as it doesn't cross an equality.\n\t * @param {Array} diffs Array of diff tuples.\n\t */\n\tfunction diff_cleanupMerge(diffs) {\n\t diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n\t var pointer = 0;\n\t var count_delete = 0;\n\t var count_insert = 0;\n\t var text_delete = '';\n\t var text_insert = '';\n\t var commonlength;\n\t while (pointer < diffs.length) {\n\t switch (diffs[pointer][0]) {\n\t case DIFF_INSERT:\n\t count_insert++;\n\t text_insert += diffs[pointer][1];\n\t pointer++;\n\t break;\n\t case DIFF_DELETE:\n\t count_delete++;\n\t text_delete += diffs[pointer][1];\n\t pointer++;\n\t break;\n\t case DIFF_EQUAL:\n\t // Upon reaching an equality, check for prior redundancies.\n\t if (count_delete + count_insert > 1) {\n\t if (count_delete !== 0 && count_insert !== 0) {\n\t // Factor out any common prefixies.\n\t commonlength = diff_commonPrefix(text_insert, text_delete);\n\t if (commonlength !== 0) {\n\t if ((pointer - count_delete - count_insert) > 0 &&\n\t diffs[pointer - count_delete - count_insert - 1][0] ==\n\t DIFF_EQUAL) {\n\t diffs[pointer - count_delete - count_insert - 1][1] +=\n\t text_insert.substring(0, commonlength);\n\t } else {\n\t diffs.splice(0, 0, [DIFF_EQUAL,\n\t text_insert.substring(0, commonlength)]);\n\t pointer++;\n\t }\n\t text_insert = text_insert.substring(commonlength);\n\t text_delete = text_delete.substring(commonlength);\n\t }\n\t // Factor out any common suffixies.\n\t commonlength = diff_commonSuffix(text_insert, text_delete);\n\t if (commonlength !== 0) {\n\t diffs[pointer][1] = text_insert.substring(text_insert.length -\n\t commonlength) + diffs[pointer][1];\n\t text_insert = text_insert.substring(0, text_insert.length -\n\t commonlength);\n\t text_delete = text_delete.substring(0, text_delete.length -\n\t commonlength);\n\t }\n\t }\n\t // Delete the offending records and add the merged ones.\n\t if (count_delete === 0) {\n\t diffs.splice(pointer - count_insert,\n\t count_delete + count_insert, [DIFF_INSERT, text_insert]);\n\t } else if (count_insert === 0) {\n\t diffs.splice(pointer - count_delete,\n\t count_delete + count_insert, [DIFF_DELETE, text_delete]);\n\t } else {\n\t diffs.splice(pointer - count_delete - count_insert,\n\t count_delete + count_insert, [DIFF_DELETE, text_delete],\n\t [DIFF_INSERT, text_insert]);\n\t }\n\t pointer = pointer - count_delete - count_insert +\n\t (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;\n\t } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n\t // Merge this equality with the previous one.\n\t diffs[pointer - 1][1] += diffs[pointer][1];\n\t diffs.splice(pointer, 1);\n\t } else {\n\t pointer++;\n\t }\n\t count_insert = 0;\n\t count_delete = 0;\n\t text_delete = '';\n\t text_insert = '';\n\t break;\n\t }\n\t }\n\t if (diffs[diffs.length - 1][1] === '') {\n\t diffs.pop(); // Remove the dummy entry at the end.\n\t }\n\t\n\t // Second pass: look for single edits surrounded on both sides by equalities\n\t // which can be shifted sideways to eliminate an equality.\n\t // e.g: ABAC -> ABAC\n\t var changes = false;\n\t pointer = 1;\n\t // Intentionally ignore the first and last element (don't need checking).\n\t while (pointer < diffs.length - 1) {\n\t if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n\t diffs[pointer + 1][0] == DIFF_EQUAL) {\n\t // This is a single edit surrounded by equalities.\n\t if (diffs[pointer][1].substring(diffs[pointer][1].length -\n\t diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n\t // Shift the edit over the previous equality.\n\t diffs[pointer][1] = diffs[pointer - 1][1] +\n\t diffs[pointer][1].substring(0, diffs[pointer][1].length -\n\t diffs[pointer - 1][1].length);\n\t diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n\t diffs.splice(pointer - 1, 1);\n\t changes = true;\n\t } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n\t diffs[pointer + 1][1]) {\n\t // Shift the edit over the next equality.\n\t diffs[pointer - 1][1] += diffs[pointer + 1][1];\n\t diffs[pointer][1] =\n\t diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n\t diffs[pointer + 1][1];\n\t diffs.splice(pointer + 1, 1);\n\t changes = true;\n\t }\n\t }\n\t pointer++;\n\t }\n\t // If shifts were made, the diff needs reordering and another shift sweep.\n\t if (changes) {\n\t diff_cleanupMerge(diffs);\n\t }\n\t};\n\t\n\t\n\tvar diff = diff_main;\n\tdiff.INSERT = DIFF_INSERT;\n\tdiff.DELETE = DIFF_DELETE;\n\tdiff.EQUAL = DIFF_EQUAL;\n\t\n\tmodule.exports = diff;\n\t\n\t/*\n\t * Modify a diff such that the cursor position points to the start of a change:\n\t * E.g.\n\t * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)\n\t * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]\n\t * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)\n\t * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]\n\t *\n\t * @param {Array} diffs Array of diff tuples\n\t * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n\t * @return {Array} A tuple [cursor location in the modified diff, modified diff]\n\t */\n\tfunction cursor_normalize_diff (diffs, cursor_pos) {\n\t if (cursor_pos === 0) {\n\t return [DIFF_EQUAL, diffs];\n\t }\n\t for (var current_pos = 0, i = 0; i < diffs.length; i++) {\n\t var d = diffs[i];\n\t if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {\n\t var next_pos = current_pos + d[1].length;\n\t if (cursor_pos === next_pos) {\n\t return [i + 1, diffs];\n\t } else if (cursor_pos < next_pos) {\n\t // copy to prevent side effects\n\t diffs = diffs.slice();\n\t // split d into two diff changes\n\t var split_pos = cursor_pos - current_pos;\n\t var d_left = [d[0], d[1].slice(0, split_pos)];\n\t var d_right = [d[0], d[1].slice(split_pos)];\n\t diffs.splice(i, 1, d_left, d_right);\n\t return [i + 1, diffs];\n\t } else {\n\t current_pos = next_pos;\n\t }\n\t }\n\t }\n\t throw new Error('cursor_pos is out of bounds!')\n\t}\n\t\n\t/*\n\t * Modify a diff such that the edit position is \"shifted\" to the proposed edit location (cursor_position).\n\t *\n\t * Case 1)\n\t * Check if a naive shift is possible:\n\t * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)\n\t * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result\n\t * Case 2)\n\t * Check if the following shifts are possible:\n\t * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']\n\t * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']\n\t * ^ ^\n\t * d d_next\n\t *\n\t * @param {Array} diffs Array of diff tuples\n\t * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n\t * @return {Array} Array of diff tuples\n\t */\n\tfunction fix_cursor (diffs, cursor_pos) {\n\t var norm = cursor_normalize_diff(diffs, cursor_pos);\n\t var ndiffs = norm[1];\n\t var cursor_pointer = norm[0];\n\t var d = ndiffs[cursor_pointer];\n\t var d_next = ndiffs[cursor_pointer + 1];\n\t\n\t if (d == null) {\n\t // Text was deleted from end of original string,\n\t // cursor is now out of bounds in new string\n\t return diffs;\n\t } else if (d[0] !== DIFF_EQUAL) {\n\t // A modification happened at the cursor location.\n\t // This is the expected outcome, so we can return the original diff.\n\t return diffs;\n\t } else {\n\t if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {\n\t // Case 1)\n\t // It is possible to perform a naive shift\n\t ndiffs.splice(cursor_pointer, 2, d_next, d)\n\t return merge_tuples(ndiffs, cursor_pointer, 2)\n\t } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {\n\t // Case 2)\n\t // d[1] is a prefix of d_next[1]\n\t // We can assume that d_next[0] !== 0, since d[0] === 0\n\t // Shift edit locations..\n\t ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);\n\t var suffix = d_next[1].slice(d[1].length);\n\t if (suffix.length > 0) {\n\t ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);\n\t }\n\t return merge_tuples(ndiffs, cursor_pointer, 3)\n\t } else {\n\t // Not possible to perform any modification\n\t return diffs;\n\t }\n\t }\n\t\n\t}\n\t\n\t/*\n\t * Try to merge tuples with their neigbors in a given range.\n\t * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']\n\t *\n\t * @param {Array} diffs Array of diff tuples.\n\t * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).\n\t * @param {Int} length Number of consecutive elements to check.\n\t * @return {Array} Array of merged diff tuples.\n\t */\n\tfunction merge_tuples (diffs, start, length) {\n\t // Check from (start-1) to (start+length).\n\t for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {\n\t if (i + 1 < diffs.length) {\n\t var left_d = diffs[i];\n\t var right_d = diffs[i+1];\n\t if (left_d[0] === right_d[1]) {\n\t diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);\n\t }\n\t }\n\t }\n\t return diffs;\n\t}\n\n\n/***/ },\n/* 22 */\n[112, 23, 24],\n/* 23 */\n/***/ function(module, exports) {\n\n\texports = module.exports = typeof Object.keys === 'function'\n\t ? Object.keys : shim;\n\t\n\texports.shim = shim;\n\tfunction shim (obj) {\n\t var keys = [];\n\t for (var key in obj) keys.push(key);\n\t return keys;\n\t}\n\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\tvar supportsArgumentsClass = (function(){\n\t return Object.prototype.toString.call(arguments)\n\t})() == '[object Arguments]';\n\t\n\texports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\t\n\texports.supported = supported;\n\tfunction supported(object) {\n\t return Object.prototype.toString.call(object) == '[object Arguments]';\n\t};\n\t\n\texports.unsupported = unsupported;\n\tfunction unsupported(object){\n\t return object &&\n\t typeof object == 'object' &&\n\t typeof object.length == 'number' &&\n\t Object.prototype.hasOwnProperty.call(object, 'callee') &&\n\t !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n\t false;\n\t};\n\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar hasOwn = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\t\n\tvar isArray = function isArray(arr) {\n\t\tif (typeof Array.isArray === 'function') {\n\t\t\treturn Array.isArray(arr);\n\t\t}\n\t\n\t\treturn toStr.call(arr) === '[object Array]';\n\t};\n\t\n\tvar isPlainObject = function isPlainObject(obj) {\n\t\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\t\treturn false;\n\t\t}\n\t\n\t\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\t\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t\t// Not own constructor property must be Object\n\t\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\t\treturn false;\n\t\t}\n\t\n\t\t// Own properties are enumerated firstly, so to speed up,\n\t\t// if last one is own, then all properties are own.\n\t\tvar key;\n\t\tfor (key in obj) {/**/}\n\t\n\t\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n\t};\n\t\n\tmodule.exports = function extend() {\n\t\tvar options, name, src, copy, copyIsArray, clone,\n\t\t\ttarget = arguments[0],\n\t\t\ti = 1,\n\t\t\tlength = arguments.length,\n\t\t\tdeep = false;\n\t\n\t\t// Handle a deep copy situation\n\t\tif (typeof target === 'boolean') {\n\t\t\tdeep = target;\n\t\t\ttarget = arguments[1] || {};\n\t\t\t// skip the boolean and the target\n\t\t\ti = 2;\n\t\t} else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) {\n\t\t\ttarget = {};\n\t\t}\n\t\n\t\tfor (; i < length; ++i) {\n\t\t\toptions = arguments[i];\n\t\t\t// Only deal with non-null/undefined values\n\t\t\tif (options != null) {\n\t\t\t\t// Extend the base object\n\t\t\t\tfor (name in options) {\n\t\t\t\t\tsrc = target[name];\n\t\t\t\t\tcopy = options[name];\n\t\n\t\t\t\t\t// Prevent never-ending loop\n\t\t\t\t\tif (target !== copy) {\n\t\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\t\ttarget[name] = extend(deep, clone, copy);\n\t\n\t\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Return the modified object\n\t\treturn target;\n\t};\n\t\n\n\n/***/ },\n/* 26 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar equal = __webpack_require__(22);\n\tvar extend = __webpack_require__(25);\n\t\n\t\n\tvar lib = {\n\t attributes: {\n\t compose: function (a, b, keepNull) {\n\t if (typeof a !== 'object') a = {};\n\t if (typeof b !== 'object') b = {};\n\t var attributes = extend(true, {}, b);\n\t if (!keepNull) {\n\t attributes = Object.keys(attributes).reduce(function (copy, key) {\n\t if (attributes[key] != null) {\n\t copy[key] = attributes[key];\n\t }\n\t return copy;\n\t }, {});\n\t }\n\t for (var key in a) {\n\t if (a[key] !== undefined && b[key] === undefined) {\n\t attributes[key] = a[key];\n\t }\n\t }\n\t return Object.keys(attributes).length > 0 ? attributes : undefined;\n\t },\n\t\n\t diff: function(a, b) {\n\t if (typeof a !== 'object') a = {};\n\t if (typeof b !== 'object') b = {};\n\t var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {\n\t if (!equal(a[key], b[key])) {\n\t attributes[key] = b[key] === undefined ? null : b[key];\n\t }\n\t return attributes;\n\t }, {});\n\t return Object.keys(attributes).length > 0 ? attributes : undefined;\n\t },\n\t\n\t transform: function (a, b, priority) {\n\t if (typeof a !== 'object') return b;\n\t if (typeof b !== 'object') return undefined;\n\t if (!priority) return b; // b simply overwrites us without priority\n\t var attributes = Object.keys(b).reduce(function (attributes, key) {\n\t if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value\n\t return attributes;\n\t }, {});\n\t return Object.keys(attributes).length > 0 ? attributes : undefined;\n\t }\n\t },\n\t\n\t iterator: function (ops) {\n\t return new Iterator(ops);\n\t },\n\t\n\t length: function (op) {\n\t if (typeof op['delete'] === 'number') {\n\t return op['delete'];\n\t } else if (typeof op.retain === 'number') {\n\t return op.retain;\n\t } else {\n\t return typeof op.insert === 'string' ? op.insert.length : 1;\n\t }\n\t }\n\t};\n\t\n\t\n\tfunction Iterator(ops) {\n\t this.ops = ops;\n\t this.index = 0;\n\t this.offset = 0;\n\t};\n\t\n\tIterator.prototype.hasNext = function () {\n\t return this.peekLength() < Infinity;\n\t};\n\t\n\tIterator.prototype.next = function (length) {\n\t if (!length) length = Infinity;\n\t var nextOp = this.ops[this.index];\n\t if (nextOp) {\n\t var offset = this.offset;\n\t var opLength = lib.length(nextOp)\n\t if (length >= opLength - offset) {\n\t length = opLength - offset;\n\t this.index += 1;\n\t this.offset = 0;\n\t } else {\n\t this.offset += length;\n\t }\n\t if (typeof nextOp['delete'] === 'number') {\n\t return { 'delete': length };\n\t } else {\n\t var retOp = {};\n\t if (nextOp.attributes) {\n\t retOp.attributes = nextOp.attributes;\n\t }\n\t if (typeof nextOp.retain === 'number') {\n\t retOp.retain = length;\n\t } else if (typeof nextOp.insert === 'string') {\n\t retOp.insert = nextOp.insert.substr(offset, length);\n\t } else {\n\t // offset should === 0, length should === 1\n\t retOp.insert = nextOp.insert;\n\t }\n\t return retOp;\n\t }\n\t } else {\n\t return { retain: Infinity };\n\t }\n\t};\n\t\n\tIterator.prototype.peek = function () {\n\t return this.ops[this.index];\n\t};\n\t\n\tIterator.prototype.peekLength = function () {\n\t if (this.ops[this.index]) {\n\t // Should never return 0 if our index is being managed correctly\n\t return lib.length(this.ops[this.index]) - this.offset;\n\t } else {\n\t return Infinity;\n\t }\n\t};\n\t\n\tIterator.prototype.peekType = function () {\n\t if (this.ops[this.index]) {\n\t if (typeof this.ops[this.index]['delete'] === 'number') {\n\t return 'delete';\n\t } else if (typeof this.ops[this.index].retain === 'number') {\n\t return 'retain';\n\t } else {\n\t return 'insert';\n\t }\n\t }\n\t return 'retain';\n\t};\n\t\n\t\n\tmodule.exports = lib;\n\n\n/***/ },\n/* 27 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _op = __webpack_require__(26);\n\t\n\tvar _op2 = _interopRequireDefault(_op);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _code = __webpack_require__(28);\n\t\n\tvar _code2 = _interopRequireDefault(_code);\n\t\n\tvar _cursor = __webpack_require__(35);\n\t\n\tvar _cursor2 = _interopRequireDefault(_cursor);\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tvar _clone = __webpack_require__(39);\n\t\n\tvar _clone2 = _interopRequireDefault(_clone);\n\t\n\tvar _deepEqual = __webpack_require__(40);\n\t\n\tvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Editor = function () {\n\t function Editor(scroll) {\n\t _classCallCheck(this, Editor);\n\t\n\t this.scroll = scroll;\n\t this.delta = this.getDelta();\n\t }\n\t\n\t _createClass(Editor, [{\n\t key: 'applyDelta',\n\t value: function applyDelta(delta) {\n\t var _this = this;\n\t\n\t var consumeNextNewline = false;\n\t this.scroll.update();\n\t var scrollLength = this.scroll.length();\n\t this.scroll.batch = true;\n\t delta = normalizeDelta(delta);\n\t delta.reduce(function (index, op) {\n\t var length = op.retain || op.delete || op.insert.length || 1;\n\t var attributes = op.attributes || {};\n\t if (op.insert != null) {\n\t if (typeof op.insert === 'string') {\n\t var text = op.insert;\n\t if (text.endsWith('\\n') && consumeNextNewline) {\n\t consumeNextNewline = false;\n\t text = text.slice(0, -1);\n\t }\n\t if (index >= scrollLength && !text.endsWith('\\n')) {\n\t consumeNextNewline = true;\n\t }\n\t _this.scroll.insertAt(index, text);\n\t\n\t var _scroll$line = _this.scroll.line(index),\n\t _scroll$line2 = _slicedToArray(_scroll$line, 2),\n\t line = _scroll$line2[0],\n\t offset = _scroll$line2[1];\n\t\n\t var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line));\n\t if (line instanceof _block2.default) {\n\t var _line$descendant = line.descendant(_parchment2.default.Leaf, offset),\n\t _line$descendant2 = _slicedToArray(_line$descendant, 1),\n\t leaf = _line$descendant2[0];\n\t\n\t formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf));\n\t }\n\t attributes = _op2.default.attributes.diff(formats, attributes) || {};\n\t } else if (_typeof(op.insert) === 'object') {\n\t var key = Object.keys(op.insert)[0]; // There should only be one key\n\t if (key == null) return index;\n\t _this.scroll.insertAt(index, key, op.insert[key]);\n\t }\n\t scrollLength += length;\n\t }\n\t Object.keys(attributes).forEach(function (name) {\n\t _this.scroll.formatAt(index, length, name, attributes[name]);\n\t });\n\t return index + length;\n\t }, 0);\n\t delta.reduce(function (index, op) {\n\t if (typeof op.delete === 'number') {\n\t _this.scroll.deleteAt(index, op.delete);\n\t return index;\n\t }\n\t return index + (op.retain || op.insert.length || 1);\n\t }, 0);\n\t this.scroll.batch = false;\n\t this.scroll.optimize();\n\t return this.update(delta);\n\t }\n\t }, {\n\t key: 'deleteText',\n\t value: function deleteText(index, length) {\n\t this.scroll.deleteAt(index, length);\n\t return this.update(new _quillDelta2.default().retain(index).delete(length));\n\t }\n\t }, {\n\t key: 'formatLine',\n\t value: function formatLine(index, length) {\n\t var _this2 = this;\n\t\n\t var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t\n\t this.scroll.update();\n\t Object.keys(formats).forEach(function (format) {\n\t var lines = _this2.scroll.lines(index, Math.max(length, 1));\n\t var lengthRemaining = length;\n\t lines.forEach(function (line) {\n\t var lineLength = line.length();\n\t if (!(line instanceof _code2.default)) {\n\t line.format(format, formats[format]);\n\t } else {\n\t var codeIndex = index - line.offset(_this2.scroll);\n\t var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n\t line.formatAt(codeIndex, codeLength, format, formats[format]);\n\t }\n\t lengthRemaining -= lineLength;\n\t });\n\t });\n\t this.scroll.optimize();\n\t return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));\n\t }\n\t }, {\n\t key: 'formatText',\n\t value: function formatText(index, length) {\n\t var _this3 = this;\n\t\n\t var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t\n\t Object.keys(formats).forEach(function (format) {\n\t _this3.scroll.formatAt(index, length, format, formats[format]);\n\t });\n\t return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));\n\t }\n\t }, {\n\t key: 'getContents',\n\t value: function getContents(index, length) {\n\t return this.delta.slice(index, index + length);\n\t }\n\t }, {\n\t key: 'getDelta',\n\t value: function getDelta() {\n\t return this.scroll.lines().reduce(function (delta, line) {\n\t return delta.concat(line.delta());\n\t }, new _quillDelta2.default());\n\t }\n\t }, {\n\t key: 'getFormat',\n\t value: function getFormat(index) {\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\t\n\t var lines = [],\n\t leaves = [];\n\t if (length === 0) {\n\t this.scroll.path(index).forEach(function (path) {\n\t var _path = _slicedToArray(path, 1),\n\t blot = _path[0];\n\t\n\t if (blot instanceof _block2.default) {\n\t lines.push(blot);\n\t } else if (blot instanceof _parchment2.default.Leaf) {\n\t leaves.push(blot);\n\t }\n\t });\n\t } else {\n\t lines = this.scroll.lines(index, length);\n\t leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length);\n\t }\n\t var formatsArr = [lines, leaves].map(function (blots) {\n\t if (blots.length === 0) return {};\n\t var formats = (0, _block.bubbleFormats)(blots.shift());\n\t while (Object.keys(formats).length > 0) {\n\t var blot = blots.shift();\n\t if (blot == null) return formats;\n\t formats = combineFormats((0, _block.bubbleFormats)(blot), formats);\n\t }\n\t return formats;\n\t });\n\t return _extend2.default.apply(_extend2.default, formatsArr);\n\t }\n\t }, {\n\t key: 'getText',\n\t value: function getText(index, length) {\n\t return this.getContents(index, length).filter(function (op) {\n\t return typeof op.insert === 'string';\n\t }).map(function (op) {\n\t return op.insert;\n\t }).join('');\n\t }\n\t }, {\n\t key: 'insertEmbed',\n\t value: function insertEmbed(index, embed, value) {\n\t this.scroll.insertAt(index, embed, value);\n\t return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value)));\n\t }\n\t }, {\n\t key: 'insertText',\n\t value: function insertText(index, text) {\n\t var _this4 = this;\n\t\n\t var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t\n\t text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n\t this.scroll.insertAt(index, text);\n\t Object.keys(formats).forEach(function (format) {\n\t _this4.scroll.formatAt(index, text.length, format, formats[format]);\n\t });\n\t return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats)));\n\t }\n\t }, {\n\t key: 'isBlank',\n\t value: function isBlank() {\n\t if (this.scroll.children.length == 0) return true;\n\t if (this.scroll.children.length > 1) return false;\n\t var child = this.scroll.children.head;\n\t return child.length() <= 1 && Object.keys(child.formats()).length == 0;\n\t }\n\t }, {\n\t key: 'removeFormat',\n\t value: function removeFormat(index, length) {\n\t var text = this.getText(index, length);\n\t\n\t var _scroll$line3 = this.scroll.line(index + length),\n\t _scroll$line4 = _slicedToArray(_scroll$line3, 2),\n\t line = _scroll$line4[0],\n\t offset = _scroll$line4[1];\n\t\n\t var suffixLength = 0,\n\t suffix = new _quillDelta2.default();\n\t if (line != null) {\n\t if (!(line instanceof _code2.default)) {\n\t suffixLength = line.length() - offset;\n\t } else {\n\t suffixLength = line.newlineIndex(offset) - offset + 1;\n\t }\n\t suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n\t }\n\t var contents = this.getContents(index, length + suffixLength);\n\t var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix));\n\t var delta = new _quillDelta2.default().retain(index).concat(diff);\n\t return this.applyDelta(delta);\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update(change) {\n\t var _this5 = this;\n\t\n\t var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\t var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n\t\n\t var oldDelta = this.delta;\n\t if (mutations.length === 1 && mutations[0].type === 'characterData' && _parchment2.default.find(mutations[0].target)) {\n\t (function () {\n\t // Optimization for character changes\n\t var textBlot = _parchment2.default.find(mutations[0].target);\n\t var formats = (0, _block.bubbleFormats)(textBlot);\n\t var index = textBlot.offset(_this5.scroll);\n\t var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, '');\n\t var oldText = new _quillDelta2.default().insert(oldValue);\n\t var newText = new _quillDelta2.default().insert(textBlot.value());\n\t var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex));\n\t change = diffDelta.reduce(function (delta, op) {\n\t if (op.insert) {\n\t return delta.insert(op.insert, formats);\n\t } else {\n\t return delta.push(op);\n\t }\n\t }, new _quillDelta2.default());\n\t _this5.delta = oldDelta.compose(change);\n\t })();\n\t } else {\n\t this.delta = this.getDelta();\n\t if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) {\n\t change = oldDelta.diff(this.delta, cursorIndex);\n\t }\n\t }\n\t return change;\n\t }\n\t }]);\n\t\n\t return Editor;\n\t}();\n\t\n\tfunction combineFormats(formats, combined) {\n\t return Object.keys(combined).reduce(function (merged, name) {\n\t if (formats[name] == null) return merged;\n\t if (combined[name] === formats[name]) {\n\t merged[name] = combined[name];\n\t } else if (Array.isArray(combined[name])) {\n\t if (combined[name].indexOf(formats[name]) < 0) {\n\t merged[name] = combined[name].concat([formats[name]]);\n\t }\n\t } else {\n\t merged[name] = [combined[name], formats[name]];\n\t }\n\t return merged;\n\t }, {});\n\t}\n\t\n\tfunction normalizeDelta(delta) {\n\t return delta.reduce(function (delta, op) {\n\t if (op.insert === 1) {\n\t var attributes = (0, _clone2.default)(op.attributes);\n\t delete attributes['image'];\n\t return delta.insert({ image: op.attributes.image }, attributes);\n\t }\n\t if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n\t op = (0, _clone2.default)(op);\n\t if (op.attributes.list) {\n\t op.attributes.list = 'ordered';\n\t } else {\n\t op.attributes.list = 'bullet';\n\t delete op.attributes.bullet;\n\t }\n\t }\n\t if (typeof op.insert === 'string') {\n\t var text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n\t return delta.insert(text, op.attributes);\n\t }\n\t return delta.push(op);\n\t }, new _quillDelta2.default());\n\t}\n\t\n\texports.default = Editor;\n\n/***/ },\n/* 28 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.Code = undefined;\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tvar _text = __webpack_require__(34);\n\t\n\tvar _text2 = _interopRequireDefault(_text);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Code = function (_Inline) {\n\t _inherits(Code, _Inline);\n\t\n\t function Code() {\n\t _classCallCheck(this, Code);\n\t\n\t return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments));\n\t }\n\t\n\t return Code;\n\t}(_inline2.default);\n\t\n\tCode.blotName = 'code';\n\tCode.tagName = 'CODE';\n\t\n\tvar CodeBlock = function (_Block) {\n\t _inherits(CodeBlock, _Block);\n\t\n\t function CodeBlock() {\n\t _classCallCheck(this, CodeBlock);\n\t\n\t return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments));\n\t }\n\t\n\t _createClass(CodeBlock, [{\n\t key: 'delta',\n\t value: function delta() {\n\t var _this3 = this;\n\t\n\t var text = this.domNode.textContent;\n\t if (text.endsWith('\\n')) {\n\t // Should always be true\n\t text = text.slice(0, -1);\n\t }\n\t return text.split('\\n').reduce(function (delta, frag) {\n\t return delta.insert(frag).insert('\\n', _this3.formats());\n\t }, new _quillDelta2.default());\n\t }\n\t }, {\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (name === this.statics.blotName && value) return;\n\t\n\t var _descendant = this.descendant(_text2.default, this.length() - 1),\n\t _descendant2 = _slicedToArray(_descendant, 1),\n\t text = _descendant2[0];\n\t\n\t if (text != null) {\n\t text.deleteAt(text.length() - 1, 1);\n\t }\n\t _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value);\n\t }\n\t }, {\n\t key: 'formatAt',\n\t value: function formatAt(index, length, name, value) {\n\t if (length === 0) return;\n\t if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) {\n\t return;\n\t }\n\t var nextNewline = this.newlineIndex(index);\n\t if (nextNewline < 0 || nextNewline >= index + length) return;\n\t var prevNewline = this.newlineIndex(index, true) + 1;\n\t var isolateLength = nextNewline - prevNewline + 1;\n\t var blot = this.isolate(prevNewline, isolateLength);\n\t var next = blot.next;\n\t blot.format(name, value);\n\t if (next instanceof CodeBlock) {\n\t next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n\t }\n\t }\n\t }, {\n\t key: 'insertAt',\n\t value: function insertAt(index, value, def) {\n\t if (def != null) return;\n\t\n\t var _descendant3 = this.descendant(_text2.default, index),\n\t _descendant4 = _slicedToArray(_descendant3, 2),\n\t text = _descendant4[0],\n\t offset = _descendant4[1];\n\t\n\t text.insertAt(offset, value);\n\t }\n\t }, {\n\t key: 'length',\n\t value: function length() {\n\t var length = this.domNode.textContent.length;\n\t if (!this.domNode.textContent.endsWith('\\n')) {\n\t return length + 1;\n\t }\n\t return length;\n\t }\n\t }, {\n\t key: 'newlineIndex',\n\t value: function newlineIndex(searchIndex) {\n\t var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\t\n\t if (!reverse) {\n\t var offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n\t return offset > -1 ? searchIndex + offset : -1;\n\t } else {\n\t return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n\t }\n\t }\n\t }, {\n\t key: 'optimize',\n\t value: function optimize() {\n\t if (!this.domNode.textContent.endsWith('\\n')) {\n\t this.appendChild(_parchment2.default.create('text', '\\n'));\n\t }\n\t _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this);\n\t var next = this.next;\n\t if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n\t next.optimize();\n\t next.moveChildren(this);\n\t next.remove();\n\t }\n\t }\n\t }, {\n\t key: 'replace',\n\t value: function replace(target) {\n\t _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target);\n\t [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) {\n\t var blot = _parchment2.default.find(node);\n\t if (blot == null) {\n\t node.parentNode.removeChild(node);\n\t } else if (blot instanceof _parchment2.default.Embed) {\n\t blot.remove();\n\t } else {\n\t blot.unwrap();\n\t }\n\t });\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create(value) {\n\t var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value);\n\t domNode.setAttribute('spellcheck', false);\n\t return domNode;\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats() {\n\t return true;\n\t }\n\t }]);\n\t\n\t return CodeBlock;\n\t}(_block2.default);\n\t\n\tCodeBlock.blotName = 'code-block';\n\tCodeBlock.tagName = 'PRE';\n\tCodeBlock.TAB = ' ';\n\t\n\texports.Code = Code;\n\texports.default = CodeBlock;\n\n/***/ },\n/* 29 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.BlockEmbed = exports.bubbleFormats = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _break = __webpack_require__(31);\n\t\n\tvar _break2 = _interopRequireDefault(_break);\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tvar _text = __webpack_require__(34);\n\t\n\tvar _text2 = _interopRequireDefault(_text);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar NEWLINE_LENGTH = 1;\n\t\n\tvar BlockEmbed = function (_Embed) {\n\t _inherits(BlockEmbed, _Embed);\n\t\n\t function BlockEmbed() {\n\t _classCallCheck(this, BlockEmbed);\n\t\n\t return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments));\n\t }\n\t\n\t _createClass(BlockEmbed, [{\n\t key: 'attach',\n\t value: function attach() {\n\t _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this);\n\t this.attributes = new _parchment2.default.Attributor.Store(this.domNode);\n\t }\n\t }, {\n\t key: 'delta',\n\t value: function delta() {\n\t return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values()));\n\t }\n\t }, {\n\t key: 'format',\n\t value: function format(name, value) {\n\t var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE);\n\t if (attribute != null) {\n\t this.attributes.attribute(attribute, value);\n\t }\n\t }\n\t }, {\n\t key: 'formatAt',\n\t value: function formatAt(index, length, name, value) {\n\t this.format(name, value);\n\t }\n\t }, {\n\t key: 'insertAt',\n\t value: function insertAt(index, value, def) {\n\t if (typeof value === 'string' && value.endsWith('\\n')) {\n\t var block = _parchment2.default.create(Block.blotName);\n\t this.parent.insertBefore(block, index === 0 ? this : this.next);\n\t block.insertAt(0, value.slice(0, -1));\n\t } else {\n\t _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def);\n\t }\n\t }\n\t }]);\n\t\n\t return BlockEmbed;\n\t}(_embed2.default);\n\t\n\tBlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT;\n\t// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\t\n\t\n\tvar Block = function (_Parchment$Block) {\n\t _inherits(Block, _Parchment$Block);\n\t\n\t function Block(domNode) {\n\t _classCallCheck(this, Block);\n\t\n\t var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode));\n\t\n\t _this2.cache = {};\n\t return _this2;\n\t }\n\t\n\t _createClass(Block, [{\n\t key: 'delta',\n\t value: function delta() {\n\t if (this.cache.delta == null) {\n\t this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) {\n\t if (leaf.length() === 0) {\n\t return delta;\n\t } else {\n\t return delta.insert(leaf.value(), bubbleFormats(leaf));\n\t }\n\t }, new _quillDelta2.default()).insert('\\n', bubbleFormats(this));\n\t }\n\t return this.cache.delta;\n\t }\n\t }, {\n\t key: 'deleteAt',\n\t value: function deleteAt(index, length) {\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length);\n\t this.cache = {};\n\t }\n\t }, {\n\t key: 'formatAt',\n\t value: function formatAt(index, length, name, value) {\n\t if (length <= 0) return;\n\t if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {\n\t if (index + length === this.length()) {\n\t this.format(name, value);\n\t }\n\t } else {\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value);\n\t }\n\t this.cache = {};\n\t }\n\t }, {\n\t key: 'insertAt',\n\t value: function insertAt(index, value, def) {\n\t if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def);\n\t if (value.length === 0) return;\n\t var lines = value.split('\\n');\n\t var text = lines.shift();\n\t if (text.length > 0) {\n\t if (index < this.length() - 1 || this.children.tail == null) {\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text);\n\t } else {\n\t this.children.tail.insertAt(this.children.tail.length(), text);\n\t }\n\t this.cache = {};\n\t }\n\t var block = this;\n\t lines.reduce(function (index, line) {\n\t block = block.split(index, true);\n\t block.insertAt(0, line);\n\t return line.length;\n\t }, index + text.length);\n\t }\n\t }, {\n\t key: 'insertBefore',\n\t value: function insertBefore(blot, ref) {\n\t var head = this.children.head;\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref);\n\t if (head instanceof _break2.default) {\n\t head.remove();\n\t }\n\t this.cache = {};\n\t }\n\t }, {\n\t key: 'length',\n\t value: function length() {\n\t if (this.cache.length == null) {\n\t this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH;\n\t }\n\t return this.cache.length;\n\t }\n\t }, {\n\t key: 'moveChildren',\n\t value: function moveChildren(target, ref) {\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref);\n\t this.cache = {};\n\t }\n\t }, {\n\t key: 'optimize',\n\t value: function optimize() {\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this);\n\t this.cache = {};\n\t }\n\t }, {\n\t key: 'path',\n\t value: function path(index) {\n\t return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true);\n\t }\n\t }, {\n\t key: 'removeChild',\n\t value: function removeChild(child) {\n\t _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child);\n\t this.cache = {};\n\t }\n\t }, {\n\t key: 'split',\n\t value: function split(index) {\n\t var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\t\n\t if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n\t var clone = this.clone();\n\t if (index === 0) {\n\t this.parent.insertBefore(clone, this);\n\t return this;\n\t } else {\n\t this.parent.insertBefore(clone, this.next);\n\t return clone;\n\t }\n\t } else {\n\t var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force);\n\t this.cache = {};\n\t return next;\n\t }\n\t }\n\t }]);\n\t\n\t return Block;\n\t}(_parchment2.default.Block);\n\t\n\tBlock.blotName = 'block';\n\tBlock.tagName = 'P';\n\tBlock.defaultChild = 'break';\n\tBlock.allowedChildren = [_inline2.default, _embed2.default, _text2.default];\n\t\n\tfunction bubbleFormats(blot) {\n\t var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t\n\t if (blot == null) return formats;\n\t if (typeof blot.formats === 'function') {\n\t formats = (0, _extend2.default)(formats, blot.formats());\n\t }\n\t if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n\t return formats;\n\t }\n\t return bubbleFormats(blot.parent, formats);\n\t}\n\t\n\texports.bubbleFormats = bubbleFormats;\n\texports.BlockEmbed = BlockEmbed;\n\texports.default = Block;\n\n/***/ },\n/* 30 */\n25,\n/* 31 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Break = function (_Embed) {\n\t _inherits(Break, _Embed);\n\t\n\t function Break() {\n\t _classCallCheck(this, Break);\n\t\n\t return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Break, [{\n\t key: 'insertInto',\n\t value: function insertInto(parent, ref) {\n\t if (parent.children.length === 0) {\n\t _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref);\n\t } else {\n\t this.remove();\n\t }\n\t }\n\t }, {\n\t key: 'length',\n\t value: function length() {\n\t return 0;\n\t }\n\t }, {\n\t key: 'value',\n\t value: function value() {\n\t return '';\n\t }\n\t }], [{\n\t key: 'value',\n\t value: function value() {\n\t return undefined;\n\t }\n\t }]);\n\t\n\t return Break;\n\t}(_embed2.default);\n\t\n\tBreak.blotName = 'break';\n\tBreak.tagName = 'BR';\n\t\n\texports.default = Break;\n\n/***/ },\n/* 32 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Embed = function (_Parchment$Embed) {\n\t _inherits(Embed, _Parchment$Embed);\n\t\n\t function Embed() {\n\t _classCallCheck(this, Embed);\n\t\n\t return _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).apply(this, arguments));\n\t }\n\t\n\t return Embed;\n\t}(_parchment2.default.Embed);\n\t\n\texports.default = Embed;\n\n/***/ },\n/* 33 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tvar _text = __webpack_require__(34);\n\t\n\tvar _text2 = _interopRequireDefault(_text);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Inline = function (_Parchment$Inline) {\n\t _inherits(Inline, _Parchment$Inline);\n\t\n\t function Inline() {\n\t _classCallCheck(this, Inline);\n\t\n\t return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Inline, [{\n\t key: 'formatAt',\n\t value: function formatAt(index, length, name, value) {\n\t if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) {\n\t var blot = this.isolate(index, length);\n\t if (value) {\n\t blot.wrap(name, value);\n\t }\n\t } else {\n\t _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value);\n\t }\n\t }\n\t }, {\n\t key: 'optimize',\n\t value: function optimize() {\n\t _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this);\n\t if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n\t var parent = this.parent.isolate(this.offset(), this.length());\n\t this.moveChildren(parent);\n\t parent.wrap(this);\n\t }\n\t }\n\t }], [{\n\t key: 'compare',\n\t value: function compare(self, other) {\n\t var selfIndex = Inline.order.indexOf(self);\n\t var otherIndex = Inline.order.indexOf(other);\n\t if (selfIndex >= 0 || otherIndex >= 0) {\n\t return selfIndex - otherIndex;\n\t } else if (self === other) {\n\t return 0;\n\t } else if (self < other) {\n\t return -1;\n\t } else {\n\t return 1;\n\t }\n\t }\n\t }]);\n\t\n\t return Inline;\n\t}(_parchment2.default.Inline);\n\t\n\tInline.allowedChildren = [Inline, _embed2.default, _text2.default];\n\t// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\n\tInline.order = ['cursor', 'inline', // Must be lower\n\t'code', 'underline', 'strike', 'italic', 'bold', 'script', 'link' // Must be higher\n\t];\n\t\n\texports.default = Inline;\n\n/***/ },\n/* 34 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar TextBlot = function (_Parchment$Text) {\n\t _inherits(TextBlot, _Parchment$Text);\n\t\n\t function TextBlot() {\n\t _classCallCheck(this, TextBlot);\n\t\n\t return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments));\n\t }\n\t\n\t return TextBlot;\n\t}(_parchment2.default.Text);\n\t\n\texports.default = TextBlot;\n\n/***/ },\n/* 35 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tvar _text = __webpack_require__(34);\n\t\n\tvar _text2 = _interopRequireDefault(_text);\n\t\n\tvar _emitter = __webpack_require__(36);\n\t\n\tvar _emitter2 = _interopRequireDefault(_emitter);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Cursor = function (_Embed) {\n\t _inherits(Cursor, _Embed);\n\t\n\t _createClass(Cursor, null, [{\n\t key: 'value',\n\t value: function value() {\n\t return undefined;\n\t }\n\t }]);\n\t\n\t function Cursor(domNode, selection) {\n\t _classCallCheck(this, Cursor);\n\t\n\t var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode));\n\t\n\t _this.selection = selection;\n\t _this.textNode = document.createTextNode(Cursor.CONTENTS);\n\t _this.domNode.appendChild(_this.textNode);\n\t _this._length = 0;\n\t return _this;\n\t }\n\t\n\t _createClass(Cursor, [{\n\t key: 'detach',\n\t value: function detach() {\n\t // super.detach() will also clear domNode.__blot\n\t if (this.parent != null) this.parent.removeChild(this);\n\t }\n\t }, {\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (this._length !== 0) {\n\t return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value);\n\t }\n\t var target = this,\n\t index = 0;\n\t while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) {\n\t index += target.offset(target.parent);\n\t target = target.parent;\n\t }\n\t if (target != null) {\n\t this._length = Cursor.CONTENTS.length;\n\t target.optimize();\n\t target.formatAt(index, Cursor.CONTENTS.length, name, value);\n\t this._length = 0;\n\t }\n\t }\n\t }, {\n\t key: 'index',\n\t value: function index(node, offset) {\n\t if (node === this.textNode) return 0;\n\t return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset);\n\t }\n\t }, {\n\t key: 'length',\n\t value: function length() {\n\t return this._length;\n\t }\n\t }, {\n\t key: 'position',\n\t value: function position() {\n\t return [this.textNode, this.textNode.data.length];\n\t }\n\t }, {\n\t key: 'remove',\n\t value: function remove() {\n\t _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this);\n\t this.parent = null;\n\t }\n\t }, {\n\t key: 'restore',\n\t value: function restore() {\n\t var _this2 = this;\n\t\n\t if (this.selection.composing) return;\n\t if (this.parent == null) return;\n\t var textNode = this.textNode;\n\t var range = this.selection.getNativeRange();\n\t var restoreText = void 0,\n\t start = void 0,\n\t end = void 0;\n\t if (range != null && range.start.node === textNode && range.end.node === textNode) {\n\t var _ref = [textNode, range.start.offset, range.end.offset];\n\t restoreText = _ref[0];\n\t start = _ref[1];\n\t end = _ref[2];\n\t }\n\t // Link format will insert text outside of anchor tag\n\t while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n\t this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n\t }\n\t if (this.textNode.data !== Cursor.CONTENTS) {\n\t var text = this.textNode.data.split(Cursor.CONTENTS).join('');\n\t if (this.next instanceof _text2.default) {\n\t restoreText = this.next.domNode;\n\t this.next.insertAt(0, text);\n\t this.textNode.data = Cursor.CONTENTS;\n\t } else {\n\t this.textNode.data = text;\n\t this.parent.insertBefore(_parchment2.default.create(this.textNode), this);\n\t this.textNode = document.createTextNode(Cursor.CONTENTS);\n\t this.domNode.appendChild(this.textNode);\n\t }\n\t }\n\t this.remove();\n\t if (start == null) return;\n\t this.selection.emitter.once(_emitter2.default.events.SCROLL_OPTIMIZE, function () {\n\t var _map = [start, end].map(function (offset) {\n\t return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n\t });\n\t\n\t var _map2 = _slicedToArray(_map, 2);\n\t\n\t start = _map2[0];\n\t end = _map2[1];\n\t\n\t _this2.selection.setNativeRange(restoreText, start, restoreText, end);\n\t });\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update(mutations) {\n\t var _this3 = this;\n\t\n\t mutations.forEach(function (mutation) {\n\t if (mutation.type === 'characterData' && mutation.target === _this3.textNode) {\n\t _this3.restore();\n\t }\n\t });\n\t }\n\t }, {\n\t key: 'value',\n\t value: function value() {\n\t return '';\n\t }\n\t }]);\n\t\n\t return Cursor;\n\t}(_embed2.default);\n\t\n\tCursor.blotName = 'cursor';\n\tCursor.className = 'ql-cursor';\n\tCursor.tagName = 'span';\n\tCursor.CONTENTS = '\\uFEFF'; // Zero width no break space\n\t\n\t\n\texports.default = Cursor;\n\n/***/ },\n/* 36 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _eventemitter = __webpack_require__(37);\n\t\n\tvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\t\n\tvar _logger = __webpack_require__(38);\n\t\n\tvar _logger2 = _interopRequireDefault(_logger);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar debug = (0, _logger2.default)('quill:events');\n\t\n\tvar Emitter = function (_EventEmitter) {\n\t _inherits(Emitter, _EventEmitter);\n\t\n\t function Emitter() {\n\t _classCallCheck(this, Emitter);\n\t\n\t var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this));\n\t\n\t _this.on('error', debug.error);\n\t return _this;\n\t }\n\t\n\t _createClass(Emitter, [{\n\t key: 'emit',\n\t value: function emit() {\n\t debug.log.apply(debug, arguments);\n\t _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments);\n\t }\n\t }]);\n\t\n\t return Emitter;\n\t}(_eventemitter2.default);\n\t\n\tEmitter.events = {\n\t EDITOR_CHANGE: 'editor-change',\n\t SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n\t SCROLL_OPTIMIZE: 'scroll-optimize',\n\t SCROLL_UPDATE: 'scroll-update',\n\t SELECTION_CHANGE: 'selection-change',\n\t TEXT_CHANGE: 'text-change'\n\t};\n\tEmitter.sources = {\n\t API: 'api',\n\t SILENT: 'silent',\n\t USER: 'user'\n\t};\n\t\n\texports.default = Emitter;\n\n/***/ },\n/* 37 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar has = Object.prototype.hasOwnProperty\n\t , prefix = '~';\n\t\n\t/**\n\t * Constructor to create a storage for our `EE` objects.\n\t * An `Events` instance is a plain object whose properties are event names.\n\t *\n\t * @constructor\n\t * @api private\n\t */\n\tfunction Events() {}\n\t\n\t//\n\t// We try to not inherit from `Object.prototype`. In some engines creating an\n\t// instance in this way is faster than calling `Object.create(null)` directly.\n\t// If `Object.create(null)` is not supported we prefix the event names with a\n\t// character to make sure that the built-in object properties are not\n\t// overridden or used as an attack vector.\n\t//\n\tif (Object.create) {\n\t Events.prototype = Object.create(null);\n\t\n\t //\n\t // This hack is needed because the `__proto__` property is still inherited in\n\t // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n\t //\n\t if (!new Events().__proto__) prefix = false;\n\t}\n\t\n\t/**\n\t * Representation of a single event listener.\n\t *\n\t * @param {Function} fn The listener function.\n\t * @param {Mixed} context The context to invoke the listener with.\n\t * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n\t * @constructor\n\t * @api private\n\t */\n\tfunction EE(fn, context, once) {\n\t this.fn = fn;\n\t this.context = context;\n\t this.once = once || false;\n\t}\n\t\n\t/**\n\t * Minimal `EventEmitter` interface that is molded against the Node.js\n\t * `EventEmitter` interface.\n\t *\n\t * @constructor\n\t * @api public\n\t */\n\tfunction EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}\n\t\n\t/**\n\t * Return an array listing the events for which the emitter has registered\n\t * listeners.\n\t *\n\t * @returns {Array}\n\t * @api public\n\t */\n\tEventEmitter.prototype.eventNames = function eventNames() {\n\t var names = []\n\t , events\n\t , name;\n\t\n\t if (this._eventsCount === 0) return names;\n\t\n\t for (name in (events = this._events)) {\n\t if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n\t }\n\t\n\t if (Object.getOwnPropertySymbols) {\n\t return names.concat(Object.getOwnPropertySymbols(events));\n\t }\n\t\n\t return names;\n\t};\n\t\n\t/**\n\t * Return the listeners registered for a given event.\n\t *\n\t * @param {String|Symbol} event The event name.\n\t * @param {Boolean} exists Only check if there are listeners.\n\t * @returns {Array|Boolean}\n\t * @api public\n\t */\n\tEventEmitter.prototype.listeners = function listeners(event, exists) {\n\t var evt = prefix ? prefix + event : event\n\t , available = this._events[evt];\n\t\n\t if (exists) return !!available;\n\t if (!available) return [];\n\t if (available.fn) return [available.fn];\n\t\n\t for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n\t ee[i] = available[i].fn;\n\t }\n\t\n\t return ee;\n\t};\n\t\n\t/**\n\t * Calls each of the listeners registered for a given event.\n\t *\n\t * @param {String|Symbol} event The event name.\n\t * @returns {Boolean} `true` if the event had listeners, else `false`.\n\t * @api public\n\t */\n\tEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n\t var evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events[evt]) return false;\n\t\n\t var listeners = this._events[evt]\n\t , len = arguments.length\n\t , args\n\t , i;\n\t\n\t if (listeners.fn) {\n\t if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\t\n\t switch (len) {\n\t case 1: return listeners.fn.call(listeners.context), true;\n\t case 2: return listeners.fn.call(listeners.context, a1), true;\n\t case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n\t case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n\t case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n\t case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n\t }\n\t\n\t for (i = 1, args = new Array(len -1); i < len; i++) {\n\t args[i - 1] = arguments[i];\n\t }\n\t\n\t listeners.fn.apply(listeners.context, args);\n\t } else {\n\t var length = listeners.length\n\t , j;\n\t\n\t for (i = 0; i < length; i++) {\n\t if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\t\n\t switch (len) {\n\t case 1: listeners[i].fn.call(listeners[i].context); break;\n\t case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n\t case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n\t case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n\t default:\n\t if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n\t args[j - 1] = arguments[j];\n\t }\n\t\n\t listeners[i].fn.apply(listeners[i].context, args);\n\t }\n\t }\n\t }\n\t\n\t return true;\n\t};\n\t\n\t/**\n\t * Add a listener for a given event.\n\t *\n\t * @param {String|Symbol} event The event name.\n\t * @param {Function} fn The listener function.\n\t * @param {Mixed} [context=this] The context to invoke the listener with.\n\t * @returns {EventEmitter} `this`.\n\t * @api public\n\t */\n\tEventEmitter.prototype.on = function on(event, fn, context) {\n\t var listener = new EE(fn, context || this)\n\t , evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n\t else if (!this._events[evt].fn) this._events[evt].push(listener);\n\t else this._events[evt] = [this._events[evt], listener];\n\t\n\t return this;\n\t};\n\t\n\t/**\n\t * Add a one-time listener for a given event.\n\t *\n\t * @param {String|Symbol} event The event name.\n\t * @param {Function} fn The listener function.\n\t * @param {Mixed} [context=this] The context to invoke the listener with.\n\t * @returns {EventEmitter} `this`.\n\t * @api public\n\t */\n\tEventEmitter.prototype.once = function once(event, fn, context) {\n\t var listener = new EE(fn, context || this, true)\n\t , evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n\t else if (!this._events[evt].fn) this._events[evt].push(listener);\n\t else this._events[evt] = [this._events[evt], listener];\n\t\n\t return this;\n\t};\n\t\n\t/**\n\t * Remove the listeners of a given event.\n\t *\n\t * @param {String|Symbol} event The event name.\n\t * @param {Function} fn Only remove the listeners that match this function.\n\t * @param {Mixed} context Only remove the listeners that have this context.\n\t * @param {Boolean} once Only remove one-time listeners.\n\t * @returns {EventEmitter} `this`.\n\t * @api public\n\t */\n\tEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n\t var evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events[evt]) return this;\n\t if (!fn) {\n\t if (--this._eventsCount === 0) this._events = new Events();\n\t else delete this._events[evt];\n\t return this;\n\t }\n\t\n\t var listeners = this._events[evt];\n\t\n\t if (listeners.fn) {\n\t if (\n\t listeners.fn === fn\n\t && (!once || listeners.once)\n\t && (!context || listeners.context === context)\n\t ) {\n\t if (--this._eventsCount === 0) this._events = new Events();\n\t else delete this._events[evt];\n\t }\n\t } else {\n\t for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n\t if (\n\t listeners[i].fn !== fn\n\t || (once && !listeners[i].once)\n\t || (context && listeners[i].context !== context)\n\t ) {\n\t events.push(listeners[i]);\n\t }\n\t }\n\t\n\t //\n\t // Reset the array, or remove it completely if we have no more listeners.\n\t //\n\t if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n\t else if (--this._eventsCount === 0) this._events = new Events();\n\t else delete this._events[evt];\n\t }\n\t\n\t return this;\n\t};\n\t\n\t/**\n\t * Remove all listeners, or those of the specified event.\n\t *\n\t * @param {String|Symbol} [event] The event name.\n\t * @returns {EventEmitter} `this`.\n\t * @api public\n\t */\n\tEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n\t var evt;\n\t\n\t if (event) {\n\t evt = prefix ? prefix + event : event;\n\t if (this._events[evt]) {\n\t if (--this._eventsCount === 0) this._events = new Events();\n\t else delete this._events[evt];\n\t }\n\t } else {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t }\n\t\n\t return this;\n\t};\n\t\n\t//\n\t// Alias methods names because people roll like that.\n\t//\n\tEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\tEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\t\n\t//\n\t// This function doesn't apply anymore.\n\t//\n\tEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n\t return this;\n\t};\n\t\n\t//\n\t// Expose the prefix.\n\t//\n\tEventEmitter.prefixed = prefix;\n\t\n\t//\n\t// Allow `EventEmitter` to be imported as module namespace.\n\t//\n\tEventEmitter.EventEmitter = EventEmitter;\n\t\n\t//\n\t// Expose the module.\n\t//\n\tif ('undefined' !== typeof module) {\n\t module.exports = EventEmitter;\n\t}\n\n\n/***/ },\n/* 38 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar levels = ['error', 'warn', 'log', 'info'];\n\tvar level = 'warn';\n\t\n\tfunction debug(method) {\n\t if (levels.indexOf(method) <= levels.indexOf(level)) {\n\t for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t args[_key - 1] = arguments[_key];\n\t }\n\t\n\t console[method].apply(console, args); // eslint-disable-line no-console\n\t }\n\t}\n\t\n\tfunction namespace(ns) {\n\t return levels.reduce(function (logger, method) {\n\t logger[method] = debug.bind(console, method, ns);\n\t return logger;\n\t }, {});\n\t}\n\t\n\tdebug.level = namespace.level = function (newLevel) {\n\t level = newLevel;\n\t};\n\t\n\texports.default = namespace;\n\n/***/ },\n/* 39 */\n/***/ function(module, exports) {\n\n\tvar clone = (function() {\n\t'use strict';\n\t\n\tvar nativeMap;\n\ttry {\n\t nativeMap = Map;\n\t} catch(_) {\n\t // maybe a reference error because no `Map`. Give it a dummy value that no\n\t // value will ever be an instanceof.\n\t nativeMap = function() {};\n\t}\n\t\n\tvar nativeSet;\n\ttry {\n\t nativeSet = Set;\n\t} catch(_) {\n\t nativeSet = function() {};\n\t}\n\t\n\tvar nativePromise;\n\ttry {\n\t nativePromise = Promise;\n\t} catch(_) {\n\t nativePromise = function() {};\n\t}\n\t\n\t/**\n\t * Clones (copies) an Object using deep copying.\n\t *\n\t * This function supports circular references by default, but if you are certain\n\t * there are no circular references in your object, you can save some CPU time\n\t * by calling clone(obj, false).\n\t *\n\t * Caution: if `circular` is false and `parent` contains circular references,\n\t * your program may enter an infinite loop and crash.\n\t *\n\t * @param `parent` - the object to be cloned\n\t * @param `circular` - set to true if the object to be cloned may contain\n\t * circular references. (optional - true by default)\n\t * @param `depth` - set to a number if the object is only to be cloned to\n\t * a particular depth. (optional - defaults to Infinity)\n\t * @param `prototype` - sets the prototype to be used when cloning an object.\n\t * (optional - defaults to parent prototype).\n\t*/\n\tfunction clone(parent, circular, depth, prototype) {\n\t var filter;\n\t if (typeof circular === 'object') {\n\t depth = circular.depth;\n\t prototype = circular.prototype;\n\t filter = circular.filter;\n\t circular = circular.circular;\n\t }\n\t // maintain two arrays for circular references, where corresponding parents\n\t // and children have the same index\n\t var allParents = [];\n\t var allChildren = [];\n\t\n\t var useBuffer = typeof Buffer != 'undefined';\n\t\n\t if (typeof circular == 'undefined')\n\t circular = true;\n\t\n\t if (typeof depth == 'undefined')\n\t depth = Infinity;\n\t\n\t // recurse this function so we don't reset allParents and allChildren\n\t function _clone(parent, depth) {\n\t // cloning null always returns null\n\t if (parent === null)\n\t return null;\n\t\n\t if (depth === 0)\n\t return parent;\n\t\n\t var child;\n\t var proto;\n\t if (typeof parent != 'object') {\n\t return parent;\n\t }\n\t\n\t if (parent instanceof nativeMap) {\n\t child = new nativeMap();\n\t } else if (parent instanceof nativeSet) {\n\t child = new nativeSet();\n\t } else if (parent instanceof nativePromise) {\n\t child = new nativePromise(function (resolve, reject) {\n\t parent.then(function(value) {\n\t resolve(_clone(value, depth - 1));\n\t }, function(err) {\n\t reject(_clone(err, depth - 1));\n\t });\n\t });\n\t } else if (clone.__isArray(parent)) {\n\t child = [];\n\t } else if (clone.__isRegExp(parent)) {\n\t child = new RegExp(parent.source, __getRegExpFlags(parent));\n\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t } else if (clone.__isDate(parent)) {\n\t child = new Date(parent.getTime());\n\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t child = new Buffer(parent.length);\n\t parent.copy(child);\n\t return child;\n\t } else {\n\t if (typeof prototype == 'undefined') {\n\t proto = Object.getPrototypeOf(parent);\n\t child = Object.create(proto);\n\t }\n\t else {\n\t child = Object.create(prototype);\n\t proto = prototype;\n\t }\n\t }\n\t\n\t if (circular) {\n\t var index = allParents.indexOf(parent);\n\t\n\t if (index != -1) {\n\t return allChildren[index];\n\t }\n\t allParents.push(parent);\n\t allChildren.push(child);\n\t }\n\t\n\t if (parent instanceof nativeMap) {\n\t var keyIterator = parent.keys();\n\t while(true) {\n\t var next = keyIterator.next();\n\t if (next.done) {\n\t break;\n\t }\n\t var keyChild = _clone(next.value, depth - 1);\n\t var valueChild = _clone(parent.get(next.value), depth - 1);\n\t child.set(keyChild, valueChild);\n\t }\n\t }\n\t if (parent instanceof nativeSet) {\n\t var iterator = parent.keys();\n\t while(true) {\n\t var next = iterator.next();\n\t if (next.done) {\n\t break;\n\t }\n\t var entryChild = _clone(next.value, depth - 1);\n\t child.add(entryChild);\n\t }\n\t }\n\t\n\t for (var i in parent) {\n\t var attrs;\n\t if (proto) {\n\t attrs = Object.getOwnPropertyDescriptor(proto, i);\n\t }\n\t\n\t if (attrs && attrs.set == null) {\n\t continue;\n\t }\n\t child[i] = _clone(parent[i], depth - 1);\n\t }\n\t\n\t if (Object.getOwnPropertySymbols) {\n\t var symbols = Object.getOwnPropertySymbols(parent);\n\t for (var i = 0; i < symbols.length; i++) {\n\t // Don't need to worry about cloning a symbol because it is a primitive,\n\t // like a number or string.\n\t var symbol = symbols[i];\n\t child[symbol] = _clone(parent[symbol], depth - 1);\n\t }\n\t }\n\t\n\t return child;\n\t }\n\t\n\t return _clone(parent, depth);\n\t}\n\t\n\t/**\n\t * Simple flat clone using prototype, accepts only objects, usefull for property\n\t * override on FLAT configuration object (no nested props).\n\t *\n\t * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n\t * works.\n\t */\n\tclone.clonePrototype = function clonePrototype(parent) {\n\t if (parent === null)\n\t return null;\n\t\n\t var c = function () {};\n\t c.prototype = parent;\n\t return new c();\n\t};\n\t\n\t// private utility functions\n\t\n\tfunction __objToStr(o) {\n\t return Object.prototype.toString.call(o);\n\t}\n\tclone.__objToStr = __objToStr;\n\t\n\tfunction __isDate(o) {\n\t return typeof o === 'object' && __objToStr(o) === '[object Date]';\n\t}\n\tclone.__isDate = __isDate;\n\t\n\tfunction __isArray(o) {\n\t return typeof o === 'object' && __objToStr(o) === '[object Array]';\n\t}\n\tclone.__isArray = __isArray;\n\t\n\tfunction __isRegExp(o) {\n\t return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n\t}\n\tclone.__isRegExp = __isRegExp;\n\t\n\tfunction __getRegExpFlags(re) {\n\t var flags = '';\n\t if (re.global) flags += 'g';\n\t if (re.ignoreCase) flags += 'i';\n\t if (re.multiline) flags += 'm';\n\t return flags;\n\t}\n\tclone.__getRegExpFlags = __getRegExpFlags;\n\t\n\treturn clone;\n\t})();\n\t\n\tif (typeof module === 'object' && module.exports) {\n\t module.exports = clone;\n\t}\n\n\n/***/ },\n/* 40 */\n[112, 41, 42],\n/* 41 */\n23,\n/* 42 */\n24,\n/* 43 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Module = function Module(quill) {\n\t var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t\n\t _classCallCheck(this, Module);\n\t\n\t this.quill = quill;\n\t this.options = options;\n\t};\n\t\n\tModule.DEFAULTS = {};\n\t\n\texports.default = Module;\n\n/***/ },\n/* 44 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.Range = undefined;\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _clone = __webpack_require__(39);\n\t\n\tvar _clone2 = _interopRequireDefault(_clone);\n\t\n\tvar _deepEqual = __webpack_require__(40);\n\t\n\tvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\t\n\tvar _emitter3 = __webpack_require__(36);\n\t\n\tvar _emitter4 = _interopRequireDefault(_emitter3);\n\t\n\tvar _logger = __webpack_require__(38);\n\t\n\tvar _logger2 = _interopRequireDefault(_logger);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar debug = (0, _logger2.default)('quill:selection');\n\t\n\tvar Range = function Range(index) {\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\t\n\t _classCallCheck(this, Range);\n\t\n\t this.index = index;\n\t this.length = length;\n\t};\n\t\n\tvar Selection = function () {\n\t function Selection(scroll, emitter) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Selection);\n\t\n\t this.emitter = emitter;\n\t this.scroll = scroll;\n\t this.composing = false;\n\t this.root = this.scroll.domNode;\n\t this.root.addEventListener('compositionstart', function () {\n\t _this.composing = true;\n\t });\n\t this.root.addEventListener('compositionend', function () {\n\t _this.composing = false;\n\t });\n\t this.cursor = _parchment2.default.create('cursor', this);\n\t // savedRange is last non-null range\n\t this.lastRange = this.savedRange = new Range(0, 0);\n\t ['keyup', 'mouseup', 'mouseleave', 'touchend', 'touchleave', 'focus', 'blur'].forEach(function (eventName) {\n\t _this.root.addEventListener(eventName, function () {\n\t // When range used to be a selection and user click within the selection,\n\t // the range now being a cursor has not updated yet without setTimeout\n\t setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 100);\n\t });\n\t });\n\t this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) {\n\t if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) {\n\t _this.update(_emitter4.default.sources.SILENT);\n\t }\n\t });\n\t this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () {\n\t var native = _this.getNativeRange();\n\t if (native == null) return;\n\t if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle\n\t // TODO unclear if this has negative side effects\n\t _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () {\n\t try {\n\t _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);\n\t } catch (ignored) {}\n\t });\n\t });\n\t this.update(_emitter4.default.sources.SILENT);\n\t }\n\t\n\t _createClass(Selection, [{\n\t key: 'focus',\n\t value: function focus() {\n\t if (this.hasFocus()) return;\n\t var bodyTop = document.body.scrollTop;\n\t this.root.focus();\n\t document.body.scrollTop = bodyTop;\n\t this.setRange(this.savedRange);\n\t }\n\t }, {\n\t key: 'format',\n\t value: function format(_format, value) {\n\t this.scroll.update();\n\t var nativeRange = this.getNativeRange();\n\t if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return;\n\t if (nativeRange.start.node !== this.cursor.textNode) {\n\t var blot = _parchment2.default.find(nativeRange.start.node, false);\n\t if (blot == null) return;\n\t // TODO Give blot ability to not split\n\t if (blot instanceof _parchment2.default.Leaf) {\n\t var after = blot.split(nativeRange.start.offset);\n\t blot.parent.insertBefore(this.cursor, after);\n\t } else {\n\t blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n\t }\n\t this.cursor.attach();\n\t }\n\t this.cursor.format(_format, value);\n\t this.scroll.optimize();\n\t this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n\t this.update();\n\t }\n\t }, {\n\t key: 'getBounds',\n\t value: function getBounds(index) {\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\t\n\t var scrollLength = this.scroll.length();\n\t index = Math.min(index, scrollLength - 1);\n\t length = Math.min(index + length, scrollLength - 1) - index;\n\t var bounds = void 0,\n\t node = void 0,\n\t _scroll$leaf = this.scroll.leaf(index),\n\t _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2),\n\t leaf = _scroll$leaf2[0],\n\t offset = _scroll$leaf2[1];\n\t if (leaf == null) return null;\n\t\n\t var _leaf$position = leaf.position(offset, true);\n\t\n\t var _leaf$position2 = _slicedToArray(_leaf$position, 2);\n\t\n\t node = _leaf$position2[0];\n\t offset = _leaf$position2[1];\n\t\n\t var range = document.createRange();\n\t if (length > 0) {\n\t range.setStart(node, offset);\n\t\n\t var _scroll$leaf3 = this.scroll.leaf(index + length);\n\t\n\t var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2);\n\t\n\t leaf = _scroll$leaf4[0];\n\t offset = _scroll$leaf4[1];\n\t\n\t if (leaf == null) return null;\n\t\n\t var _leaf$position3 = leaf.position(offset, true);\n\t\n\t var _leaf$position4 = _slicedToArray(_leaf$position3, 2);\n\t\n\t node = _leaf$position4[0];\n\t offset = _leaf$position4[1];\n\t\n\t range.setEnd(node, offset);\n\t bounds = range.getBoundingClientRect();\n\t } else {\n\t var side = 'left';\n\t var rect = void 0;\n\t if (node instanceof Text) {\n\t if (offset < node.data.length) {\n\t range.setStart(node, offset);\n\t range.setEnd(node, offset + 1);\n\t } else {\n\t range.setStart(node, offset - 1);\n\t range.setEnd(node, offset);\n\t side = 'right';\n\t }\n\t rect = range.getBoundingClientRect();\n\t } else {\n\t rect = leaf.domNode.getBoundingClientRect();\n\t if (offset > 0) side = 'right';\n\t }\n\t bounds = {\n\t height: rect.height,\n\t left: rect[side],\n\t width: 0,\n\t top: rect.top\n\t };\n\t }\n\t var containerBounds = this.root.parentNode.getBoundingClientRect();\n\t return {\n\t left: bounds.left - containerBounds.left,\n\t right: bounds.left + bounds.width - containerBounds.left,\n\t top: bounds.top - containerBounds.top,\n\t bottom: bounds.top + bounds.height - containerBounds.top,\n\t height: bounds.height,\n\t width: bounds.width\n\t };\n\t }\n\t }, {\n\t key: 'getNativeRange',\n\t value: function getNativeRange() {\n\t var selection = document.getSelection();\n\t if (selection == null || selection.rangeCount <= 0) return null;\n\t var nativeRange = selection.getRangeAt(0);\n\t if (nativeRange == null) return null;\n\t if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) {\n\t return null;\n\t }\n\t var range = {\n\t start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n\t end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n\t native: nativeRange\n\t };\n\t [range.start, range.end].forEach(function (position) {\n\t var node = position.node,\n\t offset = position.offset;\n\t while (!(node instanceof Text) && node.childNodes.length > 0) {\n\t if (node.childNodes.length > offset) {\n\t node = node.childNodes[offset];\n\t offset = 0;\n\t } else if (node.childNodes.length === offset) {\n\t node = node.lastChild;\n\t offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n\t } else {\n\t break;\n\t }\n\t }\n\t position.node = node, position.offset = offset;\n\t });\n\t debug.info('getNativeRange', range);\n\t return range;\n\t }\n\t }, {\n\t key: 'getRange',\n\t value: function getRange() {\n\t var _this2 = this;\n\t\n\t var range = this.getNativeRange();\n\t if (range == null) return [null, null];\n\t var positions = [[range.start.node, range.start.offset]];\n\t if (!range.native.collapsed) {\n\t positions.push([range.end.node, range.end.offset]);\n\t }\n\t var indexes = positions.map(function (position) {\n\t var _position = _slicedToArray(position, 2),\n\t node = _position[0],\n\t offset = _position[1];\n\t\n\t var blot = _parchment2.default.find(node, true);\n\t var index = blot.offset(_this2.scroll);\n\t if (offset === 0) {\n\t return index;\n\t } else if (blot instanceof _parchment2.default.Container) {\n\t return index + blot.length();\n\t } else {\n\t return index + blot.index(node, offset);\n\t }\n\t });\n\t var start = Math.min.apply(Math, _toConsumableArray(indexes)),\n\t end = Math.max.apply(Math, _toConsumableArray(indexes));\n\t return [new Range(start, end - start), range];\n\t }\n\t }, {\n\t key: 'hasFocus',\n\t value: function hasFocus() {\n\t return document.activeElement === this.root;\n\t }\n\t }, {\n\t key: 'scrollIntoView',\n\t value: function scrollIntoView() {\n\t var range = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.lastRange;\n\t\n\t if (range == null) return;\n\t var bounds = this.getBounds(range.index, range.length);\n\t if (bounds == null) return;\n\t if (this.root.offsetHeight < bounds.bottom) {\n\t var _scroll$line = this.scroll.line(Math.min(range.index + range.length, this.scroll.length() - 1)),\n\t _scroll$line2 = _slicedToArray(_scroll$line, 1),\n\t line = _scroll$line2[0];\n\t\n\t this.root.scrollTop = line.domNode.offsetTop + line.domNode.offsetHeight - this.root.offsetHeight;\n\t } else if (bounds.top < 0) {\n\t var _scroll$line3 = this.scroll.line(Math.min(range.index, this.scroll.length() - 1)),\n\t _scroll$line4 = _slicedToArray(_scroll$line3, 1),\n\t _line = _scroll$line4[0];\n\t\n\t this.root.scrollTop = _line.domNode.offsetTop;\n\t }\n\t }\n\t }, {\n\t key: 'setNativeRange',\n\t value: function setNativeRange(startNode, startOffset) {\n\t var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode;\n\t var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset;\n\t var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\t\n\t debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n\t if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n\t return;\n\t }\n\t var selection = document.getSelection();\n\t if (selection == null) return;\n\t if (startNode != null) {\n\t if (!this.hasFocus()) this.root.focus();\n\t var nativeRange = this.getNativeRange();\n\t if (nativeRange == null || force || startNode !== nativeRange.start.node || startOffset !== nativeRange.start.offset || endNode !== nativeRange.end.node || endOffset !== nativeRange.end.offset) {\n\t var range = document.createRange();\n\t range.setStart(startNode, startOffset);\n\t range.setEnd(endNode, endOffset);\n\t selection.removeAllRanges();\n\t selection.addRange(range);\n\t }\n\t } else {\n\t selection.removeAllRanges();\n\t this.root.blur();\n\t document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n\t }\n\t }\n\t }, {\n\t key: 'setRange',\n\t value: function setRange(range) {\n\t var _this3 = this;\n\t\n\t var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\t var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;\n\t\n\t if (typeof force === 'string') {\n\t source = force;\n\t force = false;\n\t }\n\t debug.info('setRange', range);\n\t if (range != null) {\n\t (function () {\n\t var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n\t var args = [];\n\t var scrollLength = _this3.scroll.length();\n\t indexes.forEach(function (index, i) {\n\t index = Math.min(scrollLength - 1, index);\n\t var node = void 0,\n\t _scroll$leaf5 = _this3.scroll.leaf(index),\n\t _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2),\n\t leaf = _scroll$leaf6[0],\n\t offset = _scroll$leaf6[1];\n\t var _leaf$position5 = leaf.position(offset, i !== 0);\n\t\n\t var _leaf$position6 = _slicedToArray(_leaf$position5, 2);\n\t\n\t node = _leaf$position6[0];\n\t offset = _leaf$position6[1];\n\t\n\t args.push(node, offset);\n\t });\n\t if (args.length < 2) {\n\t args = args.concat(args);\n\t }\n\t _this3.setNativeRange.apply(_this3, _toConsumableArray(args).concat([force]));\n\t })();\n\t } else {\n\t this.setNativeRange(null);\n\t }\n\t this.update(source);\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update() {\n\t var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;\n\t\n\t var nativeRange = void 0,\n\t oldRange = this.lastRange;\n\t\n\t var _getRange = this.getRange();\n\t\n\t var _getRange2 = _slicedToArray(_getRange, 2);\n\t\n\t this.lastRange = _getRange2[0];\n\t nativeRange = _getRange2[1];\n\t\n\t if (this.lastRange != null) {\n\t this.savedRange = this.lastRange;\n\t }\n\t if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) {\n\t var _emitter;\n\t\n\t if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n\t this.cursor.restore();\n\t }\n\t var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source];\n\t (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n\t if (source !== _emitter4.default.sources.SILENT) {\n\t var _emitter2;\n\t\n\t (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return Selection;\n\t}();\n\t\n\tfunction contains(parent, descendant) {\n\t try {\n\t // Firefox inserts inaccessible nodes around video elements\n\t descendant.parentNode;\n\t } catch (e) {\n\t return false;\n\t }\n\t // IE11 has bug with Text nodes\n\t // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n\t if (descendant instanceof Text) {\n\t descendant = descendant.parentNode;\n\t }\n\t return parent.contains(descendant);\n\t}\n\t\n\texports.Range = Range;\n\texports.default = Selection;\n\n/***/ },\n/* 45 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Theme = function () {\n\t function Theme(quill, options) {\n\t _classCallCheck(this, Theme);\n\t\n\t this.quill = quill;\n\t this.options = options;\n\t this.modules = {};\n\t }\n\t\n\t _createClass(Theme, [{\n\t key: 'init',\n\t value: function init() {\n\t var _this = this;\n\t\n\t Object.keys(this.options.modules).forEach(function (name) {\n\t if (_this.modules[name] == null) {\n\t _this.addModule(name);\n\t }\n\t });\n\t }\n\t }, {\n\t key: 'addModule',\n\t value: function addModule(name) {\n\t var moduleClass = this.quill.constructor.import('modules/' + name);\n\t this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n\t return this.modules[name];\n\t }\n\t }]);\n\t\n\t return Theme;\n\t}();\n\t\n\tTheme.DEFAULTS = {\n\t modules: {}\n\t};\n\tTheme.themes = {\n\t 'default': Theme\n\t};\n\t\n\texports.default = Theme;\n\n/***/ },\n/* 46 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Container = function (_Parchment$Container) {\n\t _inherits(Container, _Parchment$Container);\n\t\n\t function Container() {\n\t _classCallCheck(this, Container);\n\t\n\t return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments));\n\t }\n\t\n\t return Container;\n\t}(_parchment2.default.Container);\n\t\n\tContainer.allowedChildren = [_block2.default, _block.BlockEmbed, Container];\n\t\n\texports.default = Container;\n\n/***/ },\n/* 47 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _emitter = __webpack_require__(36);\n\t\n\tvar _emitter2 = _interopRequireDefault(_emitter);\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tvar _break = __webpack_require__(31);\n\t\n\tvar _break2 = _interopRequireDefault(_break);\n\t\n\tvar _container = __webpack_require__(46);\n\t\n\tvar _container2 = _interopRequireDefault(_container);\n\t\n\tvar _code = __webpack_require__(28);\n\t\n\tvar _code2 = _interopRequireDefault(_code);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tfunction isLine(blot) {\n\t return blot instanceof _block2.default || blot instanceof _block.BlockEmbed;\n\t}\n\t\n\tvar Scroll = function (_Parchment$Scroll) {\n\t _inherits(Scroll, _Parchment$Scroll);\n\t\n\t function Scroll(domNode, config) {\n\t _classCallCheck(this, Scroll);\n\t\n\t var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode));\n\t\n\t _this.emitter = config.emitter;\n\t if (Array.isArray(config.whitelist)) {\n\t _this.whitelist = config.whitelist.reduce(function (whitelist, format) {\n\t whitelist[format] = true;\n\t return whitelist;\n\t }, {});\n\t }\n\t _this.optimize();\n\t _this.enable();\n\t return _this;\n\t }\n\t\n\t _createClass(Scroll, [{\n\t key: 'deleteAt',\n\t value: function deleteAt(index, length) {\n\t var _line = this.line(index),\n\t _line2 = _slicedToArray(_line, 2),\n\t first = _line2[0],\n\t offset = _line2[1];\n\t\n\t var _line3 = this.line(index + length),\n\t _line4 = _slicedToArray(_line3, 1),\n\t last = _line4[0];\n\t\n\t _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length);\n\t if (last != null && first !== last && offset > 0 && !(first instanceof _block.BlockEmbed) && !(last instanceof _block.BlockEmbed)) {\n\t if (last instanceof _code2.default) {\n\t last.deleteAt(last.length() - 1, 1);\n\t }\n\t var ref = last.children.head instanceof _break2.default ? null : last.children.head;\n\t first.moveChildren(last, ref);\n\t first.remove();\n\t }\n\t this.optimize();\n\t }\n\t }, {\n\t key: 'enable',\n\t value: function enable() {\n\t var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\t\n\t this.domNode.setAttribute('contenteditable', enabled);\n\t }\n\t }, {\n\t key: 'formatAt',\n\t value: function formatAt(index, length, format, value) {\n\t if (this.whitelist != null && !this.whitelist[format]) return;\n\t _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value);\n\t this.optimize();\n\t }\n\t }, {\n\t key: 'insertAt',\n\t value: function insertAt(index, value, def) {\n\t if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n\t if (index >= this.length()) {\n\t if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) {\n\t var blot = _parchment2.default.create(this.statics.defaultChild);\n\t this.appendChild(blot);\n\t if (def == null && value.endsWith('\\n')) {\n\t value = value.slice(0, -1);\n\t }\n\t blot.insertAt(0, value, def);\n\t } else {\n\t var embed = _parchment2.default.create(value, def);\n\t this.appendChild(embed);\n\t }\n\t } else {\n\t _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def);\n\t }\n\t this.optimize();\n\t }\n\t }, {\n\t key: 'insertBefore',\n\t value: function insertBefore(blot, ref) {\n\t if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) {\n\t var wrapper = _parchment2.default.create(this.statics.defaultChild);\n\t wrapper.appendChild(blot);\n\t blot = wrapper;\n\t }\n\t _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref);\n\t }\n\t }, {\n\t key: 'leaf',\n\t value: function leaf(index) {\n\t return this.path(index).pop() || [null, -1];\n\t }\n\t }, {\n\t key: 'line',\n\t value: function line(index) {\n\t if (index === this.length()) {\n\t return this.line(index - 1);\n\t }\n\t return this.descendant(isLine, index);\n\t }\n\t }, {\n\t key: 'lines',\n\t value: function lines() {\n\t var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\t var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\t\n\t var getLines = function getLines(blot, index, length) {\n\t var lines = [],\n\t lengthLeft = length;\n\t blot.children.forEachAt(index, length, function (child, index, length) {\n\t if (isLine(child)) {\n\t lines.push(child);\n\t } else if (child instanceof _parchment2.default.Container) {\n\t lines = lines.concat(getLines(child, index, lengthLeft));\n\t }\n\t lengthLeft -= length;\n\t });\n\t return lines;\n\t };\n\t return getLines(this, index, length);\n\t }\n\t }, {\n\t key: 'optimize',\n\t value: function optimize() {\n\t var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\t\n\t if (this.batch === true) return;\n\t _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations);\n\t if (mutations.length > 0) {\n\t this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations);\n\t }\n\t }\n\t }, {\n\t key: 'path',\n\t value: function path(index) {\n\t return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update(mutations) {\n\t if (this.batch === true) return;\n\t var source = _emitter2.default.sources.USER;\n\t if (typeof mutations === 'string') {\n\t source = mutations;\n\t }\n\t if (!Array.isArray(mutations)) {\n\t mutations = this.observer.takeRecords();\n\t }\n\t if (mutations.length > 0) {\n\t this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations);\n\t }\n\t _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy\n\t if (mutations.length > 0) {\n\t this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations);\n\t }\n\t }\n\t }]);\n\t\n\t return Scroll;\n\t}(_parchment2.default.Scroll);\n\t\n\tScroll.blotName = 'scroll';\n\tScroll.className = 'ql-editor';\n\tScroll.tagName = 'DIV';\n\tScroll.defaultChild = 'block';\n\tScroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default];\n\t\n\texports.default = Scroll;\n\n/***/ },\n/* 48 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined;\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tvar _logger = __webpack_require__(38);\n\t\n\tvar _logger2 = _interopRequireDefault(_logger);\n\t\n\tvar _module = __webpack_require__(43);\n\t\n\tvar _module2 = _interopRequireDefault(_module);\n\t\n\tvar _align = __webpack_require__(49);\n\t\n\tvar _background = __webpack_require__(50);\n\t\n\tvar _color = __webpack_require__(51);\n\t\n\tvar _direction = __webpack_require__(52);\n\t\n\tvar _font = __webpack_require__(53);\n\t\n\tvar _size = __webpack_require__(54);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar debug = (0, _logger2.default)('quill:clipboard');\n\t\n\tvar CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]];\n\t\n\tvar ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) {\n\t memo[attr.keyName] = attr;\n\t return memo;\n\t}, {});\n\t\n\tvar STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) {\n\t memo[attr.keyName] = attr;\n\t return memo;\n\t}, {});\n\t\n\tvar Clipboard = function (_Module) {\n\t _inherits(Clipboard, _Module);\n\t\n\t function Clipboard(quill, options) {\n\t _classCallCheck(this, Clipboard);\n\t\n\t var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options));\n\t\n\t _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this));\n\t _this.container = _this.quill.addContainer('ql-clipboard');\n\t _this.container.setAttribute('contenteditable', true);\n\t _this.container.setAttribute('tabindex', -1);\n\t _this.matchers = [];\n\t CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (pair) {\n\t _this.addMatcher.apply(_this, _toConsumableArray(pair));\n\t });\n\t return _this;\n\t }\n\t\n\t _createClass(Clipboard, [{\n\t key: 'addMatcher',\n\t value: function addMatcher(selector, matcher) {\n\t this.matchers.push([selector, matcher]);\n\t }\n\t }, {\n\t key: 'convert',\n\t value: function convert(html) {\n\t var _this2 = this;\n\t\n\t var DOM_KEY = '__ql-matcher';\n\t if (typeof html === 'string') {\n\t this.container.innerHTML = html;\n\t }\n\t var textMatchers = [],\n\t elementMatchers = [];\n\t this.matchers.forEach(function (pair) {\n\t var _pair = _slicedToArray(pair, 2),\n\t selector = _pair[0],\n\t matcher = _pair[1];\n\t\n\t switch (selector) {\n\t case Node.TEXT_NODE:\n\t textMatchers.push(matcher);\n\t break;\n\t case Node.ELEMENT_NODE:\n\t elementMatchers.push(matcher);\n\t break;\n\t default:\n\t [].forEach.call(_this2.container.querySelectorAll(selector), function (node) {\n\t // TODO use weakmap\n\t node[DOM_KEY] = node[DOM_KEY] || [];\n\t node[DOM_KEY].push(matcher);\n\t });\n\t break;\n\t }\n\t });\n\t var traverse = function traverse(node) {\n\t // Post-order\n\t if (node.nodeType === node.TEXT_NODE) {\n\t return textMatchers.reduce(function (delta, matcher) {\n\t return matcher(node, delta);\n\t }, new _quillDelta2.default());\n\t } else if (node.nodeType === node.ELEMENT_NODE) {\n\t return [].reduce.call(node.childNodes || [], function (delta, childNode) {\n\t var childrenDelta = traverse(childNode);\n\t if (childNode.nodeType === node.ELEMENT_NODE) {\n\t childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) {\n\t return matcher(childNode, childrenDelta);\n\t }, childrenDelta);\n\t childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) {\n\t return matcher(childNode, childrenDelta);\n\t }, childrenDelta);\n\t }\n\t return delta.concat(childrenDelta);\n\t }, new _quillDelta2.default());\n\t } else {\n\t return new _quillDelta2.default();\n\t }\n\t };\n\t var delta = traverse(this.container);\n\t // Remove trailing newline\n\t if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n\t delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1));\n\t }\n\t debug.log('convert', this.container.innerHTML, delta);\n\t this.container.innerHTML = '';\n\t return delta;\n\t }\n\t }, {\n\t key: 'dangerouslyPasteHTML',\n\t value: function dangerouslyPasteHTML(index, html) {\n\t var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API;\n\t\n\t if (typeof index === 'string') {\n\t return this.quill.setContents(this.convert(index), html);\n\t } else {\n\t var paste = this.convert(html);\n\t return this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source);\n\t }\n\t }\n\t }, {\n\t key: 'onPaste',\n\t value: function onPaste(e) {\n\t var _this3 = this;\n\t\n\t if (e.defaultPrevented || !this.quill.isEnabled()) return;\n\t var range = this.quill.getSelection();\n\t var delta = new _quillDelta2.default().retain(range.index).delete(range.length);\n\t var bodyTop = document.body.scrollTop;\n\t this.container.focus();\n\t setTimeout(function () {\n\t _this3.quill.selection.update(_quill2.default.sources.SILENT);\n\t delta = delta.concat(_this3.convert());\n\t _this3.quill.updateContents(delta, _quill2.default.sources.USER);\n\t // range.length contributes to delta.length()\n\t _this3.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);\n\t document.body.scrollTop = bodyTop;\n\t _this3.quill.selection.scrollIntoView();\n\t }, 1);\n\t }\n\t }]);\n\t\n\t return Clipboard;\n\t}(_module2.default);\n\t\n\tClipboard.DEFAULTS = {\n\t matchers: []\n\t};\n\t\n\tfunction computeStyle(node) {\n\t if (node.nodeType !== Node.ELEMENT_NODE) return {};\n\t var DOM_KEY = '__ql-computed-style';\n\t return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n\t}\n\t\n\tfunction deltaEndsWith(delta, text) {\n\t var endText = \"\";\n\t for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n\t var op = delta.ops[i];\n\t if (typeof op.insert !== 'string') break;\n\t endText = op.insert + endText;\n\t }\n\t return endText.slice(-1 * text.length) === text;\n\t}\n\t\n\tfunction isLine(node) {\n\t if (node.childNodes.length === 0) return false; // Exclude embed blocks\n\t var style = computeStyle(node);\n\t return ['block', 'list-item'].indexOf(style.display) > -1;\n\t}\n\t\n\tfunction matchAlias(format, node, delta) {\n\t return delta.compose(new _quillDelta2.default().retain(delta.length(), _defineProperty({}, format, true)));\n\t}\n\t\n\tfunction matchAttributor(node, delta) {\n\t var attributes = _parchment2.default.Attributor.Attribute.keys(node);\n\t var classes = _parchment2.default.Attributor.Class.keys(node);\n\t var styles = _parchment2.default.Attributor.Style.keys(node);\n\t var formats = {};\n\t attributes.concat(classes).concat(styles).forEach(function (name) {\n\t var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE);\n\t if (attr != null) {\n\t formats[attr.attrName] = attr.value(node);\n\t if (formats[attr.attrName]) return;\n\t }\n\t if (ATTRIBUTE_ATTRIBUTORS[name] != null) {\n\t attr = ATTRIBUTE_ATTRIBUTORS[name];\n\t formats[attr.attrName] = attr.value(node);\n\t }\n\t if (STYLE_ATTRIBUTORS[name] != null) {\n\t attr = STYLE_ATTRIBUTORS[name];\n\t formats[attr.attrName] = attr.value(node);\n\t }\n\t });\n\t if (Object.keys(formats).length > 0) {\n\t delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats));\n\t }\n\t return delta;\n\t}\n\t\n\tfunction matchBlot(node, delta) {\n\t var match = _parchment2.default.query(node);\n\t if (match == null) return delta;\n\t if (match.prototype instanceof _parchment2.default.Embed) {\n\t var embed = {};\n\t var value = match.value(node);\n\t if (value != null) {\n\t embed[match.blotName] = value;\n\t delta = new _quillDelta2.default().insert(embed, match.formats(node));\n\t }\n\t } else if (typeof match.formats === 'function') {\n\t var formats = _defineProperty({}, match.blotName, match.formats(node));\n\t delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats));\n\t }\n\t return delta;\n\t}\n\t\n\tfunction matchBreak(node, delta) {\n\t if (!deltaEndsWith(delta, '\\n')) {\n\t delta.insert('\\n');\n\t }\n\t return delta;\n\t}\n\t\n\tfunction matchIgnore() {\n\t return new _quillDelta2.default();\n\t}\n\t\n\tfunction matchNewline(node, delta) {\n\t if (isLine(node) && !deltaEndsWith(delta, '\\n')) {\n\t delta.insert('\\n');\n\t }\n\t return delta;\n\t}\n\t\n\tfunction matchSpacing(node, delta) {\n\t if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\\n\\n')) {\n\t var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);\n\t if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) {\n\t delta.insert('\\n');\n\t }\n\t }\n\t return delta;\n\t}\n\t\n\tfunction matchStyles(node, delta) {\n\t var formats = {};\n\t var style = node.style || {};\n\t if (style.fontWeight && computeStyle(node).fontWeight === 'bold') {\n\t formats.bold = true;\n\t }\n\t if (Object.keys(formats).length > 0) {\n\t delta = delta.compose(new _quillDelta2.default().retain(delta.length(), formats));\n\t }\n\t if (parseFloat(style.textIndent || 0) > 0) {\n\t // Could be 0.5in\n\t delta = new _quillDelta2.default().insert('\\t').concat(delta);\n\t }\n\t return delta;\n\t}\n\t\n\tfunction matchText(node, delta) {\n\t var text = node.data;\n\t // Word represents empty line with  \n\t if (node.parentNode.tagName === 'O:P') {\n\t return delta.insert(text.trim());\n\t }\n\t if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n\t // eslint-disable-next-line func-style\n\t var replacer = function replacer(collapse, match) {\n\t match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n\t return match.length < 1 && collapse ? ' ' : match;\n\t };\n\t text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n\t text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n\t if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) {\n\t text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n\t }\n\t if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) {\n\t text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n\t }\n\t }\n\t return delta.insert(text);\n\t}\n\t\n\texports.default = Clipboard;\n\texports.matchAttributor = matchAttributor;\n\texports.matchBlot = matchBlot;\n\texports.matchNewline = matchNewline;\n\texports.matchSpacing = matchSpacing;\n\texports.matchText = matchText;\n\n/***/ },\n/* 49 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined;\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar config = {\n\t scope: _parchment2.default.Scope.BLOCK,\n\t whitelist: ['right', 'center', 'justify']\n\t};\n\t\n\tvar AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config);\n\tvar AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config);\n\tvar AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config);\n\t\n\texports.AlignAttribute = AlignAttribute;\n\texports.AlignClass = AlignClass;\n\texports.AlignStyle = AlignStyle;\n\n/***/ },\n/* 50 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.BackgroundStyle = exports.BackgroundClass = undefined;\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _color = __webpack_require__(51);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', {\n\t scope: _parchment2.default.Scope.INLINE\n\t});\n\tvar BackgroundStyle = new _color.ColorAttributor('background', 'background-color', {\n\t scope: _parchment2.default.Scope.INLINE\n\t});\n\t\n\texports.BackgroundClass = BackgroundClass;\n\texports.BackgroundStyle = BackgroundStyle;\n\n/***/ },\n/* 51 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ColorAttributor = function (_Parchment$Attributor) {\n\t _inherits(ColorAttributor, _Parchment$Attributor);\n\t\n\t function ColorAttributor() {\n\t _classCallCheck(this, ColorAttributor);\n\t\n\t return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments));\n\t }\n\t\n\t _createClass(ColorAttributor, [{\n\t key: 'value',\n\t value: function value(domNode) {\n\t var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode);\n\t if (!value.startsWith('rgb(')) return value;\n\t value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n\t return '#' + value.split(',').map(function (component) {\n\t return ('00' + parseInt(component).toString(16)).slice(-2);\n\t }).join('');\n\t }\n\t }]);\n\t\n\t return ColorAttributor;\n\t}(_parchment2.default.Attributor.Style);\n\t\n\tvar ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', {\n\t scope: _parchment2.default.Scope.INLINE\n\t});\n\tvar ColorStyle = new ColorAttributor('color', 'color', {\n\t scope: _parchment2.default.Scope.INLINE\n\t});\n\t\n\texports.ColorAttributor = ColorAttributor;\n\texports.ColorClass = ColorClass;\n\texports.ColorStyle = ColorStyle;\n\n/***/ },\n/* 52 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined;\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar config = {\n\t scope: _parchment2.default.Scope.BLOCK,\n\t whitelist: ['rtl']\n\t};\n\t\n\tvar DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config);\n\tvar DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config);\n\tvar DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config);\n\t\n\texports.DirectionAttribute = DirectionAttribute;\n\texports.DirectionClass = DirectionClass;\n\texports.DirectionStyle = DirectionStyle;\n\n/***/ },\n/* 53 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.FontClass = exports.FontStyle = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar config = {\n\t scope: _parchment2.default.Scope.INLINE,\n\t whitelist: ['serif', 'monospace']\n\t};\n\t\n\tvar FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config);\n\t\n\tvar FontStyleAttributor = function (_Parchment$Attributor) {\n\t _inherits(FontStyleAttributor, _Parchment$Attributor);\n\t\n\t function FontStyleAttributor() {\n\t _classCallCheck(this, FontStyleAttributor);\n\t\n\t return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments));\n\t }\n\t\n\t _createClass(FontStyleAttributor, [{\n\t key: 'value',\n\t value: function value(node) {\n\t return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/[\"']/g, '');\n\t }\n\t }]);\n\t\n\t return FontStyleAttributor;\n\t}(_parchment2.default.Attributor.Style);\n\t\n\tvar FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\t\n\texports.FontStyle = FontStyle;\n\texports.FontClass = FontClass;\n\n/***/ },\n/* 54 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.SizeStyle = exports.SizeClass = undefined;\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', {\n\t scope: _parchment2.default.Scope.INLINE,\n\t whitelist: ['small', 'large', 'huge']\n\t});\n\tvar SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', {\n\t scope: _parchment2.default.Scope.INLINE,\n\t whitelist: ['10px', '18px', '32px']\n\t});\n\t\n\texports.SizeClass = SizeClass;\n\texports.SizeStyle = SizeStyle;\n\n/***/ },\n/* 55 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.getLastChangeIndex = exports.default = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tvar _module = __webpack_require__(43);\n\t\n\tvar _module2 = _interopRequireDefault(_module);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar History = function (_Module) {\n\t _inherits(History, _Module);\n\t\n\t function History(quill, options) {\n\t _classCallCheck(this, History);\n\t\n\t var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options));\n\t\n\t _this.lastRecorded = 0;\n\t _this.ignoreChange = false;\n\t _this.clear();\n\t _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) {\n\t if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return;\n\t if (!_this.options.userOnly || source === _quill2.default.sources.USER) {\n\t _this.record(delta, oldDelta);\n\t } else {\n\t _this.transform(delta);\n\t }\n\t });\n\t _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this));\n\t _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this));\n\t if (/Win/i.test(navigator.platform)) {\n\t _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this));\n\t }\n\t return _this;\n\t }\n\t\n\t _createClass(History, [{\n\t key: 'change',\n\t value: function change(source, dest) {\n\t if (this.stack[source].length === 0) return;\n\t var delta = this.stack[source].pop();\n\t this.lastRecorded = 0;\n\t this.ignoreChange = true;\n\t this.quill.updateContents(delta[source], _quill2.default.sources.USER);\n\t this.ignoreChange = false;\n\t var index = getLastChangeIndex(delta[source]);\n\t this.quill.setSelection(index);\n\t this.quill.selection.scrollIntoView();\n\t this.stack[dest].push(delta);\n\t }\n\t }, {\n\t key: 'clear',\n\t value: function clear() {\n\t this.stack = { undo: [], redo: [] };\n\t }\n\t }, {\n\t key: 'record',\n\t value: function record(changeDelta, oldDelta) {\n\t if (changeDelta.ops.length === 0) return;\n\t this.stack.redo = [];\n\t var undoDelta = this.quill.getContents().diff(oldDelta);\n\t var timestamp = Date.now();\n\t if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n\t var delta = this.stack.undo.pop();\n\t undoDelta = undoDelta.compose(delta.undo);\n\t changeDelta = delta.redo.compose(changeDelta);\n\t } else {\n\t this.lastRecorded = timestamp;\n\t }\n\t this.stack.undo.push({\n\t redo: changeDelta,\n\t undo: undoDelta\n\t });\n\t if (this.stack.undo.length > this.options.maxStack) {\n\t this.stack.undo.shift();\n\t }\n\t }\n\t }, {\n\t key: 'redo',\n\t value: function redo() {\n\t this.change('redo', 'undo');\n\t }\n\t }, {\n\t key: 'transform',\n\t value: function transform(delta) {\n\t this.stack.undo.forEach(function (change) {\n\t change.undo = delta.transform(change.undo, true);\n\t change.redo = delta.transform(change.redo, true);\n\t });\n\t this.stack.redo.forEach(function (change) {\n\t change.undo = delta.transform(change.undo, true);\n\t change.redo = delta.transform(change.redo, true);\n\t });\n\t }\n\t }, {\n\t key: 'undo',\n\t value: function undo() {\n\t this.change('undo', 'redo');\n\t }\n\t }]);\n\t\n\t return History;\n\t}(_module2.default);\n\t\n\tHistory.DEFAULTS = {\n\t delay: 1000,\n\t maxStack: 100,\n\t userOnly: false\n\t};\n\t\n\tfunction endsWithNewlineChange(delta) {\n\t var lastOp = delta.ops[delta.ops.length - 1];\n\t if (lastOp == null) return false;\n\t if (lastOp.insert != null) {\n\t return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n\t }\n\t if (lastOp.attributes != null) {\n\t return Object.keys(lastOp.attributes).some(function (attr) {\n\t return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null;\n\t });\n\t }\n\t return false;\n\t}\n\t\n\tfunction getLastChangeIndex(delta) {\n\t var deleteLength = delta.reduce(function (length, op) {\n\t length += op.delete || 0;\n\t return length;\n\t }, 0);\n\t var changeIndex = delta.length() - deleteLength;\n\t if (endsWithNewlineChange(delta)) {\n\t changeIndex -= 1;\n\t }\n\t return changeIndex;\n\t}\n\t\n\texports.default = History;\n\texports.getLastChangeIndex = getLastChangeIndex;\n\n/***/ },\n/* 56 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _clone = __webpack_require__(39);\n\t\n\tvar _clone2 = _interopRequireDefault(_clone);\n\t\n\tvar _deepEqual = __webpack_require__(40);\n\t\n\tvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _op = __webpack_require__(26);\n\t\n\tvar _op2 = _interopRequireDefault(_op);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tvar _logger = __webpack_require__(38);\n\t\n\tvar _logger2 = _interopRequireDefault(_logger);\n\t\n\tvar _module = __webpack_require__(43);\n\t\n\tvar _module2 = _interopRequireDefault(_module);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar debug = (0, _logger2.default)('quill:keyboard');\n\t\n\tvar SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\t\n\tvar Keyboard = function (_Module) {\n\t _inherits(Keyboard, _Module);\n\t\n\t _createClass(Keyboard, null, [{\n\t key: 'match',\n\t value: function match(evt, binding) {\n\t binding = normalize(binding);\n\t if (!!binding.shortKey !== evt[SHORTKEY] && binding.shortKey !== null) return false;\n\t if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) {\n\t return key != SHORTKEY && !!binding[key] !== evt[key] && binding[key] !== null;\n\t })) {\n\t return false;\n\t }\n\t return binding.key === (evt.which || evt.keyCode);\n\t }\n\t }]);\n\t\n\t function Keyboard(quill, options) {\n\t _classCallCheck(this, Keyboard);\n\t\n\t var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options));\n\t\n\t _this.bindings = {};\n\t Object.keys(_this.options.bindings).forEach(function (name) {\n\t if (_this.options.bindings[name]) {\n\t _this.addBinding(_this.options.bindings[name]);\n\t }\n\t });\n\t _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n\t _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {});\n\t _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n\t _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^$/ }, handleDelete);\n\t _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n\t _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n\t if (/Trident/i.test(navigator.userAgent)) {\n\t _this.addBinding({ key: Keyboard.keys.BACKSPACE, shortKey: true }, handleBackspace);\n\t _this.addBinding({ key: Keyboard.keys.DELETE, shortKey: true }, handleDelete);\n\t }\n\t _this.listen();\n\t return _this;\n\t }\n\t\n\t _createClass(Keyboard, [{\n\t key: 'addBinding',\n\t value: function addBinding(key) {\n\t var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t\n\t var binding = normalize(key);\n\t if (binding == null || binding.key == null) {\n\t return debug.warn('Attempted to add invalid keyboard binding', binding);\n\t }\n\t if (typeof context === 'function') {\n\t context = { handler: context };\n\t }\n\t if (typeof handler === 'function') {\n\t handler = { handler: handler };\n\t }\n\t binding = (0, _extend2.default)(binding, context, handler);\n\t this.bindings[binding.key] = this.bindings[binding.key] || [];\n\t this.bindings[binding.key].push(binding);\n\t }\n\t }, {\n\t key: 'listen',\n\t value: function listen() {\n\t var _this2 = this;\n\t\n\t this.quill.root.addEventListener('keydown', function (evt) {\n\t if (evt.defaultPrevented) return;\n\t var which = evt.which || evt.keyCode;\n\t var bindings = (_this2.bindings[which] || []).filter(function (binding) {\n\t return Keyboard.match(evt, binding);\n\t });\n\t if (bindings.length === 0) return;\n\t var range = _this2.quill.getSelection();\n\t if (range == null || !_this2.quill.hasFocus()) return;\n\t\n\t var _quill$scroll$line = _this2.quill.scroll.line(range.index),\n\t _quill$scroll$line2 = _slicedToArray(_quill$scroll$line, 2),\n\t line = _quill$scroll$line2[0],\n\t offset = _quill$scroll$line2[1];\n\t\n\t var _quill$scroll$leaf = _this2.quill.scroll.leaf(range.index),\n\t _quill$scroll$leaf2 = _slicedToArray(_quill$scroll$leaf, 2),\n\t leafStart = _quill$scroll$leaf2[0],\n\t offsetStart = _quill$scroll$leaf2[1];\n\t\n\t var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.scroll.leaf(range.index + range.length),\n\t _ref2 = _slicedToArray(_ref, 2),\n\t leafEnd = _ref2[0],\n\t offsetEnd = _ref2[1];\n\t\n\t var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : '';\n\t var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : '';\n\t var curContext = {\n\t collapsed: range.length === 0,\n\t empty: range.length === 0 && line.length() <= 1,\n\t format: _this2.quill.getFormat(range),\n\t offset: offset,\n\t prefix: prefixText,\n\t suffix: suffixText\n\t };\n\t var prevented = bindings.some(function (binding) {\n\t if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n\t if (binding.empty != null && binding.empty !== curContext.empty) return false;\n\t if (binding.offset != null && binding.offset !== curContext.offset) return false;\n\t if (Array.isArray(binding.format)) {\n\t // any format is present\n\t if (binding.format.every(function (name) {\n\t return curContext.format[name] == null;\n\t })) {\n\t return false;\n\t }\n\t } else if (_typeof(binding.format) === 'object') {\n\t // all formats must match\n\t if (!Object.keys(binding.format).every(function (name) {\n\t if (binding.format[name] === true) return curContext.format[name] != null;\n\t if (binding.format[name] === false) return curContext.format[name] == null;\n\t return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]);\n\t })) {\n\t return false;\n\t }\n\t }\n\t if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n\t if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n\t return binding.handler.call(_this2, range, curContext) !== true;\n\t });\n\t if (prevented) {\n\t evt.preventDefault();\n\t }\n\t });\n\t }\n\t }]);\n\t\n\t return Keyboard;\n\t}(_module2.default);\n\t\n\tKeyboard.keys = {\n\t BACKSPACE: 8,\n\t TAB: 9,\n\t ENTER: 13,\n\t ESCAPE: 27,\n\t LEFT: 37,\n\t UP: 38,\n\t RIGHT: 39,\n\t DOWN: 40,\n\t DELETE: 46\n\t};\n\t\n\tKeyboard.DEFAULTS = {\n\t bindings: {\n\t 'bold': makeFormatHandler('bold'),\n\t 'italic': makeFormatHandler('italic'),\n\t 'underline': makeFormatHandler('underline'),\n\t 'indent': {\n\t // highlight tab or tab at beginning of list, indent or blockquote\n\t key: Keyboard.keys.TAB,\n\t format: ['blockquote', 'indent', 'list'],\n\t handler: function handler(range, context) {\n\t if (context.collapsed && context.offset !== 0) return true;\n\t this.quill.format('indent', '+1', _quill2.default.sources.USER);\n\t }\n\t },\n\t 'outdent': {\n\t key: Keyboard.keys.TAB,\n\t shiftKey: true,\n\t format: ['blockquote', 'indent', 'list'],\n\t // highlight tab or tab at beginning of list, indent or blockquote\n\t handler: function handler(range, context) {\n\t if (context.collapsed && context.offset !== 0) return true;\n\t this.quill.format('indent', '-1', _quill2.default.sources.USER);\n\t }\n\t },\n\t 'outdent backspace': {\n\t key: Keyboard.keys.BACKSPACE,\n\t collapsed: true,\n\t format: ['blockquote', 'indent', 'list'],\n\t offset: 0,\n\t handler: function handler(range, context) {\n\t if (context.format.indent != null) {\n\t this.quill.format('indent', '-1', _quill2.default.sources.USER);\n\t } else if (context.format.blockquote != null) {\n\t this.quill.format('blockquote', false, _quill2.default.sources.USER);\n\t } else if (context.format.list != null) {\n\t this.quill.format('list', false, _quill2.default.sources.USER);\n\t }\n\t }\n\t },\n\t 'indent code-block': makeCodeBlockHandler(true),\n\t 'outdent code-block': makeCodeBlockHandler(false),\n\t 'remove tab': {\n\t key: Keyboard.keys.TAB,\n\t shiftKey: true,\n\t collapsed: true,\n\t prefix: /\\t$/,\n\t handler: function handler(range) {\n\t this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);\n\t }\n\t },\n\t 'tab': {\n\t key: Keyboard.keys.TAB,\n\t handler: function handler(range, context) {\n\t if (!context.collapsed) {\n\t this.quill.scroll.deleteAt(range.index, range.length);\n\t }\n\t this.quill.insertText(range.index, '\\t', _quill2.default.sources.USER);\n\t this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n\t }\n\t },\n\t 'list empty enter': {\n\t key: Keyboard.keys.ENTER,\n\t collapsed: true,\n\t format: ['list'],\n\t empty: true,\n\t handler: function handler(range, context) {\n\t this.quill.format('list', false, _quill2.default.sources.USER);\n\t if (context.format.indent) {\n\t this.quill.format('indent', false, _quill2.default.sources.USER);\n\t }\n\t }\n\t },\n\t 'header enter': {\n\t key: Keyboard.keys.ENTER,\n\t collapsed: true,\n\t format: ['header'],\n\t suffix: /^$/,\n\t handler: function handler(range) {\n\t this.quill.scroll.insertAt(range.index, '\\n');\n\t this.quill.formatText(range.index + 1, 1, 'header', false, _quill2.default.sources.USER);\n\t this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n\t this.quill.selection.scrollIntoView();\n\t }\n\t },\n\t 'list autofill': {\n\t key: ' ',\n\t collapsed: true,\n\t format: { list: false },\n\t prefix: /^(1\\.|-)$/,\n\t handler: function handler(range, context) {\n\t var length = context.prefix.length;\n\t this.quill.scroll.deleteAt(range.index - length, length);\n\t this.quill.formatLine(range.index - length, 1, 'list', length === 1 ? 'bullet' : 'ordered', _quill2.default.sources.USER);\n\t this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT);\n\t }\n\t }\n\t }\n\t};\n\t\n\tfunction handleBackspace(range, context) {\n\t if (range.index === 0) return;\n\t\n\t var _quill$scroll$line3 = this.quill.scroll.line(range.index),\n\t _quill$scroll$line4 = _slicedToArray(_quill$scroll$line3, 1),\n\t line = _quill$scroll$line4[0];\n\t\n\t var formats = {};\n\t if (context.offset === 0) {\n\t var curFormats = line.formats();\n\t var prevFormats = this.quill.getFormat(range.index - 1, 1);\n\t formats = _op2.default.attributes.diff(curFormats, prevFormats) || {};\n\t }\n\t this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);\n\t if (Object.keys(formats).length > 0) {\n\t this.quill.formatLine(range.index - 1, 1, formats, _quill2.default.sources.USER);\n\t }\n\t this.quill.selection.scrollIntoView();\n\t}\n\t\n\tfunction handleDelete(range) {\n\t if (range.index >= this.quill.getLength() - 1) return;\n\t this.quill.deleteText(range.index, 1, _quill2.default.sources.USER);\n\t}\n\t\n\tfunction handleDeleteRange(range) {\n\t this.quill.deleteText(range, _quill2.default.sources.USER);\n\t this.quill.setSelection(range.index, _quill2.default.sources.SILENT);\n\t this.quill.selection.scrollIntoView();\n\t}\n\t\n\tfunction handleEnter(range, context) {\n\t var _this3 = this;\n\t\n\t if (range.length > 0) {\n\t this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n\t }\n\t var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) {\n\t if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n\t lineFormats[format] = context.format[format];\n\t }\n\t return lineFormats;\n\t }, {});\n\t this.quill.insertText(range.index, '\\n', lineFormats, _quill2.default.sources.USER);\n\t this.quill.selection.scrollIntoView();\n\t Object.keys(context.format).forEach(function (name) {\n\t if (lineFormats[name] != null) return;\n\t if (Array.isArray(context.format[name])) return;\n\t if (name === 'link') return;\n\t _this3.quill.format(name, context.format[name], _quill2.default.sources.USER);\n\t });\n\t}\n\t\n\tfunction makeCodeBlockHandler(indent) {\n\t return {\n\t key: Keyboard.keys.TAB,\n\t shiftKey: !indent,\n\t format: { 'code-block': true },\n\t handler: function handler(range) {\n\t var CodeBlock = _parchment2.default.query('code-block');\n\t var index = range.index,\n\t length = range.length;\n\t\n\t var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index),\n\t _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),\n\t block = _quill$scroll$descend2[0],\n\t offset = _quill$scroll$descend2[1];\n\t\n\t if (block == null) return;\n\t var scrollOffset = this.quill.scroll.offset(block);\n\t var start = block.newlineIndex(offset, true) + 1;\n\t var end = block.newlineIndex(scrollOffset + offset + length);\n\t var lines = block.domNode.textContent.slice(start, end).split('\\n');\n\t offset = 0;\n\t lines.forEach(function (line, i) {\n\t if (indent) {\n\t block.insertAt(start + offset, CodeBlock.TAB);\n\t offset += CodeBlock.TAB.length;\n\t if (i === 0) {\n\t index += CodeBlock.TAB.length;\n\t } else {\n\t length += CodeBlock.TAB.length;\n\t }\n\t } else if (line.startsWith(CodeBlock.TAB)) {\n\t block.deleteAt(start + offset, CodeBlock.TAB.length);\n\t offset -= CodeBlock.TAB.length;\n\t if (i === 0) {\n\t index -= CodeBlock.TAB.length;\n\t } else {\n\t length -= CodeBlock.TAB.length;\n\t }\n\t }\n\t offset += line.length + 1;\n\t });\n\t this.quill.update(_quill2.default.sources.USER);\n\t this.quill.setSelection(index, length, _quill2.default.sources.SILENT);\n\t }\n\t };\n\t}\n\t\n\tfunction makeFormatHandler(format) {\n\t return {\n\t key: format[0].toUpperCase(),\n\t shortKey: true,\n\t handler: function handler(range, context) {\n\t this.quill.format(format, !context.format[format], _quill2.default.sources.USER);\n\t }\n\t };\n\t}\n\t\n\tfunction normalize(binding) {\n\t if (typeof binding === 'string' || typeof binding === 'number') {\n\t return normalize({ key: binding });\n\t }\n\t if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') {\n\t binding = (0, _clone2.default)(binding, false);\n\t }\n\t if (typeof binding.key === 'string') {\n\t if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n\t binding.key = Keyboard.keys[binding.key.toUpperCase()];\n\t } else if (binding.key.length === 1) {\n\t binding.key = binding.key.toUpperCase().charCodeAt(0);\n\t } else {\n\t return null;\n\t }\n\t }\n\t return binding;\n\t}\n\t\n\texports.default = Keyboard;\n\n/***/ },\n/* 57 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.IndentClass = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar IdentAttributor = function (_Parchment$Attributor) {\n\t _inherits(IdentAttributor, _Parchment$Attributor);\n\t\n\t function IdentAttributor() {\n\t _classCallCheck(this, IdentAttributor);\n\t\n\t return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments));\n\t }\n\t\n\t _createClass(IdentAttributor, [{\n\t key: 'add',\n\t value: function add(node, value) {\n\t if (value === '+1' || value === '-1') {\n\t var indent = this.value(node) || 0;\n\t value = value === '+1' ? indent + 1 : indent - 1;\n\t }\n\t if (value === 0) {\n\t this.remove(node);\n\t return true;\n\t } else {\n\t return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value);\n\t }\n\t }\n\t }, {\n\t key: 'value',\n\t value: function value(node) {\n\t return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN\n\t }\n\t }]);\n\t\n\t return IdentAttributor;\n\t}(_parchment2.default.Attributor.Class);\n\t\n\tvar IndentClass = new IdentAttributor('indent', 'ql-indent', {\n\t scope: _parchment2.default.Scope.BLOCK,\n\t whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n\t});\n\t\n\texports.IndentClass = IndentClass;\n\n/***/ },\n/* 58 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Blockquote = function (_Block) {\n\t _inherits(Blockquote, _Block);\n\t\n\t function Blockquote() {\n\t _classCallCheck(this, Blockquote);\n\t\n\t return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments));\n\t }\n\t\n\t return Blockquote;\n\t}(_block2.default);\n\t\n\tBlockquote.blotName = 'blockquote';\n\tBlockquote.tagName = 'blockquote';\n\t\n\texports.default = Blockquote;\n\n/***/ },\n/* 59 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Header = function (_Block) {\n\t _inherits(Header, _Block);\n\t\n\t function Header() {\n\t _classCallCheck(this, Header);\n\t\n\t return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Header, null, [{\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t return this.tagName.indexOf(domNode.tagName) + 1;\n\t }\n\t }]);\n\t\n\t return Header;\n\t}(_block2.default);\n\t\n\tHeader.blotName = 'header';\n\tHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\t\n\texports.default = Header;\n\n/***/ },\n/* 60 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.ListItem = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _block2 = _interopRequireDefault(_block);\n\t\n\tvar _container = __webpack_require__(46);\n\t\n\tvar _container2 = _interopRequireDefault(_container);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ListItem = function (_Block) {\n\t _inherits(ListItem, _Block);\n\t\n\t function ListItem() {\n\t _classCallCheck(this, ListItem);\n\t\n\t return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments));\n\t }\n\t\n\t _createClass(ListItem, [{\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (name === List.blotName && !value) {\n\t this.replaceWith(_parchment2.default.create(this.statics.scope));\n\t } else {\n\t _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value);\n\t }\n\t }\n\t }, {\n\t key: 'remove',\n\t value: function remove() {\n\t if (this.prev == null && this.next == null) {\n\t this.parent.remove();\n\t } else {\n\t _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this);\n\t }\n\t }\n\t }, {\n\t key: 'replaceWith',\n\t value: function replaceWith(name, value) {\n\t this.parent.isolate(this.offset(this.parent), this.length());\n\t if (name === this.parent.statics.blotName) {\n\t this.parent.replaceWith(name, value);\n\t return this;\n\t } else {\n\t this.parent.unwrap();\n\t return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value);\n\t }\n\t }\n\t }], [{\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode);\n\t }\n\t }]);\n\t\n\t return ListItem;\n\t}(_block2.default);\n\t\n\tListItem.blotName = 'list-item';\n\tListItem.tagName = 'LI';\n\t\n\tvar List = function (_Container) {\n\t _inherits(List, _Container);\n\t\n\t function List() {\n\t _classCallCheck(this, List);\n\t\n\t return _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).apply(this, arguments));\n\t }\n\t\n\t _createClass(List, [{\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (this.children.length > 0) {\n\t this.children.tail.format(name, value);\n\t }\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats() {\n\t // We don't inherit from FormatBlot\n\t return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode));\n\t }\n\t }, {\n\t key: 'insertBefore',\n\t value: function insertBefore(blot, ref) {\n\t if (blot instanceof ListItem) {\n\t _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref);\n\t } else {\n\t var index = ref == null ? this.length() : ref.offset(this);\n\t var after = this.split(index);\n\t after.parent.insertBefore(blot, after);\n\t }\n\t }\n\t }, {\n\t key: 'optimize',\n\t value: function optimize() {\n\t _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this);\n\t var next = this.next;\n\t if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName) {\n\t next.moveChildren(this);\n\t next.remove();\n\t }\n\t }\n\t }, {\n\t key: 'replace',\n\t value: function replace(target) {\n\t if (target.statics.blotName !== this.statics.blotName) {\n\t var item = _parchment2.default.create(this.statics.defaultChild);\n\t target.moveChildren(item);\n\t this.appendChild(item);\n\t }\n\t _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target);\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create(value) {\n\t if (value === 'ordered') {\n\t value = 'OL';\n\t } else if (value === 'bullet') {\n\t value = 'UL';\n\t }\n\t return _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, value);\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t if (domNode.tagName === 'OL') return 'ordered';\n\t if (domNode.tagName === 'UL') return 'bullet';\n\t return undefined;\n\t }\n\t }]);\n\t\n\t return List;\n\t}(_container2.default);\n\t\n\tList.blotName = 'list';\n\tList.scope = _parchment2.default.Scope.BLOCK_BLOT;\n\tList.tagName = ['OL', 'UL'];\n\tList.defaultChild = 'list-item';\n\tList.allowedChildren = [ListItem];\n\t\n\texports.ListItem = ListItem;\n\texports.default = List;\n\n/***/ },\n/* 61 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Bold = function (_Inline) {\n\t _inherits(Bold, _Inline);\n\t\n\t function Bold() {\n\t _classCallCheck(this, Bold);\n\t\n\t return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Bold, [{\n\t key: 'optimize',\n\t value: function optimize() {\n\t _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this);\n\t if (this.domNode.tagName !== this.statics.tagName[0]) {\n\t this.replaceWith(this.statics.blotName);\n\t }\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create() {\n\t return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this);\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats() {\n\t return true;\n\t }\n\t }]);\n\t\n\t return Bold;\n\t}(_inline2.default);\n\t\n\tBold.blotName = 'bold';\n\tBold.tagName = ['STRONG', 'B'];\n\t\n\texports.default = Bold;\n\n/***/ },\n/* 62 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _bold = __webpack_require__(61);\n\t\n\tvar _bold2 = _interopRequireDefault(_bold);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Italic = function (_Bold) {\n\t _inherits(Italic, _Bold);\n\t\n\t function Italic() {\n\t _classCallCheck(this, Italic);\n\t\n\t return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments));\n\t }\n\t\n\t return Italic;\n\t}(_bold2.default);\n\t\n\tItalic.blotName = 'italic';\n\tItalic.tagName = ['EM', 'I'];\n\t\n\texports.default = Italic;\n\n/***/ },\n/* 63 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.sanitize = exports.default = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Link = function (_Inline) {\n\t _inherits(Link, _Inline);\n\t\n\t function Link() {\n\t _classCallCheck(this, Link);\n\t\n\t return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Link, [{\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value);\n\t value = this.constructor.sanitize(value);\n\t this.domNode.setAttribute('href', value);\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create(value) {\n\t var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value);\n\t value = this.sanitize(value);\n\t node.setAttribute('href', value);\n\t node.setAttribute('target', '_blank');\n\t return node;\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t return domNode.getAttribute('href');\n\t }\n\t }, {\n\t key: 'sanitize',\n\t value: function sanitize(url) {\n\t return _sanitize(url, ['http', 'https', 'mailto']) ? url : this.SANITIZED_URL;\n\t }\n\t }]);\n\t\n\t return Link;\n\t}(_inline2.default);\n\t\n\tLink.blotName = 'link';\n\tLink.tagName = 'A';\n\tLink.SANITIZED_URL = 'about:blank';\n\t\n\tfunction _sanitize(url, protocols) {\n\t var anchor = document.createElement('a');\n\t anchor.href = url;\n\t var protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n\t return protocols.indexOf(protocol) > -1;\n\t}\n\t\n\texports.default = Link;\n\texports.sanitize = _sanitize;\n\n/***/ },\n/* 64 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Script = function (_Inline) {\n\t _inherits(Script, _Inline);\n\t\n\t function Script() {\n\t _classCallCheck(this, Script);\n\t\n\t return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Script, null, [{\n\t key: 'create',\n\t value: function create(value) {\n\t if (value === 'super') {\n\t return document.createElement('sup');\n\t } else if (value === 'sub') {\n\t return document.createElement('sub');\n\t } else {\n\t return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value);\n\t }\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t if (domNode.tagName === 'SUB') return 'sub';\n\t if (domNode.tagName === 'SUP') return 'super';\n\t return undefined;\n\t }\n\t }]);\n\t\n\t return Script;\n\t}(_inline2.default);\n\t\n\tScript.blotName = 'script';\n\tScript.tagName = ['SUB', 'SUP'];\n\t\n\texports.default = Script;\n\n/***/ },\n/* 65 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Strike = function (_Inline) {\n\t _inherits(Strike, _Inline);\n\t\n\t function Strike() {\n\t _classCallCheck(this, Strike);\n\t\n\t return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments));\n\t }\n\t\n\t return Strike;\n\t}(_inline2.default);\n\t\n\tStrike.blotName = 'strike';\n\tStrike.tagName = 'S';\n\t\n\texports.default = Strike;\n\n/***/ },\n/* 66 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _inline = __webpack_require__(33);\n\t\n\tvar _inline2 = _interopRequireDefault(_inline);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar Underline = function (_Inline) {\n\t _inherits(Underline, _Inline);\n\t\n\t function Underline() {\n\t _classCallCheck(this, Underline);\n\t\n\t return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments));\n\t }\n\t\n\t return Underline;\n\t}(_inline2.default);\n\t\n\tUnderline.blotName = 'underline';\n\tUnderline.tagName = 'U';\n\t\n\texports.default = Underline;\n\n/***/ },\n/* 67 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tvar _link = __webpack_require__(63);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ATTRIBUTES = ['alt', 'height', 'width'];\n\t\n\tvar Image = function (_Embed) {\n\t _inherits(Image, _Embed);\n\t\n\t function Image() {\n\t _classCallCheck(this, Image);\n\t\n\t return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Image, [{\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (ATTRIBUTES.indexOf(name) > -1) {\n\t if (value) {\n\t this.domNode.setAttribute(name, value);\n\t } else {\n\t this.domNode.removeAttribute(name);\n\t }\n\t } else {\n\t _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value);\n\t }\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create(value) {\n\t var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value);\n\t if (typeof value === 'string') {\n\t node.setAttribute('src', this.sanitize(value));\n\t }\n\t return node;\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t return ATTRIBUTES.reduce(function (formats, attribute) {\n\t if (domNode.hasAttribute(attribute)) {\n\t formats[attribute] = domNode.getAttribute(attribute);\n\t }\n\t return formats;\n\t }, {});\n\t }\n\t }, {\n\t key: 'match',\n\t value: function match(url) {\n\t return (/\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url)\n\t );\n\t }\n\t }, {\n\t key: 'sanitize',\n\t value: function sanitize(url) {\n\t return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0';\n\t }\n\t }, {\n\t key: 'value',\n\t value: function value(domNode) {\n\t return domNode.getAttribute('src');\n\t }\n\t }]);\n\t\n\t return Image;\n\t}(_embed2.default);\n\t\n\tImage.blotName = 'image';\n\tImage.tagName = 'IMG';\n\t\n\texports.default = Image;\n\n/***/ },\n/* 68 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _block = __webpack_require__(29);\n\t\n\tvar _link = __webpack_require__(63);\n\t\n\tvar _link2 = _interopRequireDefault(_link);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ATTRIBUTES = ['height', 'width'];\n\t\n\tvar Video = function (_BlockEmbed) {\n\t _inherits(Video, _BlockEmbed);\n\t\n\t function Video() {\n\t _classCallCheck(this, Video);\n\t\n\t return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments));\n\t }\n\t\n\t _createClass(Video, [{\n\t key: 'format',\n\t value: function format(name, value) {\n\t if (ATTRIBUTES.indexOf(name) > -1) {\n\t if (value) {\n\t this.domNode.setAttribute(name, value);\n\t } else {\n\t this.domNode.removeAttribute(name);\n\t }\n\t } else {\n\t _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value);\n\t }\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create(value) {\n\t var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value);\n\t node.setAttribute('frameborder', '0');\n\t node.setAttribute('allowfullscreen', true);\n\t node.setAttribute('src', this.sanitize(value));\n\t return node;\n\t }\n\t }, {\n\t key: 'formats',\n\t value: function formats(domNode) {\n\t return ATTRIBUTES.reduce(function (formats, attribute) {\n\t if (domNode.hasAttribute(attribute)) {\n\t formats[attribute] = domNode.getAttribute(attribute);\n\t }\n\t return formats;\n\t }, {});\n\t }\n\t }, {\n\t key: 'sanitize',\n\t value: function sanitize(url) {\n\t return _link2.default.sanitize(url);\n\t }\n\t }, {\n\t key: 'value',\n\t value: function value(domNode) {\n\t return domNode.getAttribute('src');\n\t }\n\t }]);\n\t\n\t return Video;\n\t}(_block.BlockEmbed);\n\t\n\tVideo.blotName = 'video';\n\tVideo.className = 'ql-video';\n\tVideo.tagName = 'IFRAME';\n\t\n\texports.default = Video;\n\n/***/ },\n/* 69 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.FormulaBlot = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _embed = __webpack_require__(32);\n\t\n\tvar _embed2 = _interopRequireDefault(_embed);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar FormulaBlot = function (_Embed) {\n\t _inherits(FormulaBlot, _Embed);\n\t\n\t function FormulaBlot() {\n\t _classCallCheck(this, FormulaBlot);\n\t\n\t return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments));\n\t }\n\t\n\t _createClass(FormulaBlot, [{\n\t key: 'index',\n\t value: function index() {\n\t return 1;\n\t }\n\t }], [{\n\t key: 'create',\n\t value: function create(value) {\n\t var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value);\n\t if (typeof value === 'string') {\n\t window.katex.render(value, node);\n\t node.setAttribute('data-value', value);\n\t }\n\t node.setAttribute('contenteditable', false);\n\t return node;\n\t }\n\t }, {\n\t key: 'value',\n\t value: function value(domNode) {\n\t return domNode.getAttribute('data-value');\n\t }\n\t }]);\n\t\n\t return FormulaBlot;\n\t}(_embed2.default);\n\t\n\tFormulaBlot.blotName = 'formula';\n\tFormulaBlot.className = 'ql-formula';\n\tFormulaBlot.tagName = 'SPAN';\n\t\n\tfunction Formula() {\n\t if (window.katex == null) {\n\t throw new Error('Formula module requires KaTeX.');\n\t }\n\t _quill2.default.register(FormulaBlot, true);\n\t}\n\t\n\texports.FormulaBlot = FormulaBlot;\n\texports.default = Formula;\n\n/***/ },\n/* 70 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.CodeToken = exports.CodeBlock = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tvar _module = __webpack_require__(43);\n\t\n\tvar _module2 = _interopRequireDefault(_module);\n\t\n\tvar _code = __webpack_require__(28);\n\t\n\tvar _code2 = _interopRequireDefault(_code);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar SyntaxCodeBlock = function (_CodeBlock) {\n\t _inherits(SyntaxCodeBlock, _CodeBlock);\n\t\n\t function SyntaxCodeBlock() {\n\t _classCallCheck(this, SyntaxCodeBlock);\n\t\n\t return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments));\n\t }\n\t\n\t _createClass(SyntaxCodeBlock, [{\n\t key: 'replaceWith',\n\t value: function replaceWith(block) {\n\t this.domNode.textContent = this.domNode.textContent;\n\t this.attach();\n\t _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block);\n\t }\n\t }, {\n\t key: 'highlight',\n\t value: function highlight(_highlight) {\n\t if (this.cachedHTML !== this.domNode.innerHTML) {\n\t var text = this.domNode.textContent;\n\t if (text.trim().length > 0 || this.cachedHTML == null) {\n\t this.domNode.innerHTML = _highlight(text);\n\t this.attach();\n\t }\n\t this.cachedHTML = this.domNode.innerHTML;\n\t }\n\t }\n\t }]);\n\t\n\t return SyntaxCodeBlock;\n\t}(_code2.default);\n\t\n\tSyntaxCodeBlock.className = 'ql-syntax';\n\t\n\tvar CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', {\n\t scope: _parchment2.default.Scope.INLINE\n\t});\n\t\n\tvar Syntax = function (_Module) {\n\t _inherits(Syntax, _Module);\n\t\n\t function Syntax(quill, options) {\n\t _classCallCheck(this, Syntax);\n\t\n\t var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options));\n\t\n\t if (typeof _this2.options.highlight !== 'function') {\n\t throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');\n\t }\n\t _quill2.default.register(CodeToken, true);\n\t _quill2.default.register(SyntaxCodeBlock, true);\n\t var timer = null;\n\t _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {\n\t if (timer != null) return;\n\t timer = setTimeout(function () {\n\t _this2.highlight();\n\t timer = null;\n\t }, 100);\n\t });\n\t _this2.highlight();\n\t return _this2;\n\t }\n\t\n\t _createClass(Syntax, [{\n\t key: 'highlight',\n\t value: function highlight() {\n\t var _this3 = this;\n\t\n\t if (this.quill.selection.composing) return;\n\t var range = this.quill.getSelection();\n\t this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) {\n\t code.highlight(_this3.options.highlight);\n\t });\n\t this.quill.update(_quill2.default.sources.SILENT);\n\t if (range != null) {\n\t this.quill.setSelection(range, _quill2.default.sources.SILENT);\n\t }\n\t }\n\t }]);\n\t\n\t return Syntax;\n\t}(_module2.default);\n\t\n\tSyntax.DEFAULTS = {\n\t highlight: function () {\n\t if (window.hljs == null) return null;\n\t return function (text) {\n\t var result = window.hljs.highlightAuto(text);\n\t return result.value;\n\t };\n\t }()\n\t};\n\t\n\texports.CodeBlock = SyntaxCodeBlock;\n\texports.CodeToken = CodeToken;\n\texports.default = Syntax;\n\n/***/ },\n/* 71 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.addControls = exports.default = undefined;\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _parchment = __webpack_require__(2);\n\t\n\tvar _parchment2 = _interopRequireDefault(_parchment);\n\t\n\tvar _quill = __webpack_require__(18);\n\t\n\tvar _quill2 = _interopRequireDefault(_quill);\n\t\n\tvar _logger = __webpack_require__(38);\n\t\n\tvar _logger2 = _interopRequireDefault(_logger);\n\t\n\tvar _module = __webpack_require__(43);\n\t\n\tvar _module2 = _interopRequireDefault(_module);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar debug = (0, _logger2.default)('quill:toolbar');\n\t\n\tvar Toolbar = function (_Module) {\n\t _inherits(Toolbar, _Module);\n\t\n\t function Toolbar(quill, options) {\n\t _classCallCheck(this, Toolbar);\n\t\n\t var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options));\n\t\n\t if (Array.isArray(_this.options.container)) {\n\t var container = document.createElement('div');\n\t addControls(container, _this.options.container);\n\t quill.container.parentNode.insertBefore(container, quill.container);\n\t _this.container = container;\n\t } else if (typeof _this.options.container === 'string') {\n\t _this.container = document.querySelector(_this.options.container);\n\t } else {\n\t _this.container = _this.options.container;\n\t }\n\t if (!(_this.container instanceof HTMLElement)) {\n\t var _ret;\n\t\n\t return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret);\n\t }\n\t _this.container.classList.add('ql-toolbar');\n\t _this.controls = [];\n\t _this.handlers = {};\n\t Object.keys(_this.options.handlers).forEach(function (format) {\n\t _this.addHandler(format, _this.options.handlers[format]);\n\t });\n\t [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) {\n\t _this.attach(input);\n\t });\n\t _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) {\n\t if (type === _quill2.default.events.SELECTION_CHANGE) {\n\t _this.update(range);\n\t }\n\t });\n\t _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {\n\t var _this$quill$selection = _this.quill.selection.getRange(),\n\t _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1),\n\t range = _this$quill$selection2[0]; // quill.getSelection triggers update\n\t\n\t\n\t _this.update(range);\n\t });\n\t return _this;\n\t }\n\t\n\t _createClass(Toolbar, [{\n\t key: 'addHandler',\n\t value: function addHandler(format, handler) {\n\t this.handlers[format] = handler;\n\t }\n\t }, {\n\t key: 'attach',\n\t value: function attach(input) {\n\t var _this2 = this;\n\t\n\t var format = [].find.call(input.classList, function (className) {\n\t return className.indexOf('ql-') === 0;\n\t });\n\t if (!format) return;\n\t format = format.slice('ql-'.length);\n\t if (input.tagName === 'BUTTON') {\n\t input.setAttribute('type', 'button');\n\t }\n\t if (this.handlers[format] == null) {\n\t if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n\t debug.warn('ignoring attaching to disabled format', format, input);\n\t return;\n\t }\n\t if (_parchment2.default.query(format) == null) {\n\t debug.warn('ignoring attaching to nonexistent format', format, input);\n\t return;\n\t }\n\t }\n\t var eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n\t input.addEventListener(eventName, function (e) {\n\t var value = void 0;\n\t if (input.tagName === 'SELECT') {\n\t if (input.selectedIndex < 0) return;\n\t var selected = input.options[input.selectedIndex];\n\t if (selected.hasAttribute('selected')) {\n\t value = false;\n\t } else {\n\t value = selected.value || false;\n\t }\n\t } else {\n\t if (input.classList.contains('ql-active')) {\n\t value = false;\n\t } else {\n\t value = input.value || !input.hasAttribute('value');\n\t }\n\t e.preventDefault();\n\t }\n\t _this2.quill.focus();\n\t\n\t var _quill$selection$getR = _this2.quill.selection.getRange(),\n\t _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1),\n\t range = _quill$selection$getR2[0];\n\t\n\t if (_this2.handlers[format] != null) {\n\t _this2.handlers[format].call(_this2, value);\n\t } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) {\n\t value = prompt('Enter ' + format);\n\t if (!value) return;\n\t _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER);\n\t } else {\n\t _this2.quill.format(format, value, _quill2.default.sources.USER);\n\t }\n\t _this2.update(range);\n\t });\n\t // TODO use weakmap\n\t this.controls.push([format, input]);\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update(range) {\n\t var formats = range == null ? {} : this.quill.getFormat(range);\n\t this.controls.forEach(function (pair) {\n\t var _pair = _slicedToArray(pair, 2),\n\t format = _pair[0],\n\t input = _pair[1];\n\t\n\t if (input.tagName === 'SELECT') {\n\t var option = void 0;\n\t if (range == null) {\n\t option = null;\n\t } else if (formats[format] == null) {\n\t option = input.querySelector('option[selected]');\n\t } else if (!Array.isArray(formats[format])) {\n\t var value = formats[format];\n\t if (typeof value === 'string') {\n\t value = value.replace(/\\\"/g, '\\\\\"');\n\t }\n\t option = input.querySelector('option[value=\"' + value + '\"]');\n\t }\n\t if (option == null) {\n\t input.value = ''; // TODO make configurable?\n\t input.selectedIndex = -1;\n\t } else {\n\t option.selected = true;\n\t }\n\t } else {\n\t if (range == null) {\n\t input.classList.remove('ql-active');\n\t } else if (input.hasAttribute('value')) {\n\t // both being null should match (default values)\n\t // '1' should match with 1 (headers)\n\t var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value');\n\t input.classList.toggle('ql-active', isActive);\n\t } else {\n\t input.classList.toggle('ql-active', formats[format] != null);\n\t }\n\t }\n\t });\n\t }\n\t }]);\n\t\n\t return Toolbar;\n\t}(_module2.default);\n\t\n\tToolbar.DEFAULTS = {};\n\t\n\tfunction addButton(container, format, value) {\n\t var input = document.createElement('button');\n\t input.setAttribute('type', 'button');\n\t input.classList.add('ql-' + format);\n\t if (value != null) {\n\t input.value = value;\n\t }\n\t container.appendChild(input);\n\t}\n\t\n\tfunction addControls(container, groups) {\n\t if (!Array.isArray(groups[0])) {\n\t groups = [groups];\n\t }\n\t groups.forEach(function (controls) {\n\t var group = document.createElement('span');\n\t group.classList.add('ql-formats');\n\t controls.forEach(function (control) {\n\t if (typeof control === 'string') {\n\t addButton(group, control);\n\t } else {\n\t var format = Object.keys(control)[0];\n\t var value = control[format];\n\t if (Array.isArray(value)) {\n\t addSelect(group, format, value);\n\t } else {\n\t addButton(group, format, value);\n\t }\n\t }\n\t });\n\t container.appendChild(group);\n\t });\n\t}\n\t\n\tfunction addSelect(container, format, values) {\n\t var input = document.createElement('select');\n\t input.classList.add('ql-' + format);\n\t values.forEach(function (value) {\n\t var option = document.createElement('option');\n\t if (value !== false) {\n\t option.setAttribute('value', value);\n\t } else {\n\t option.setAttribute('selected', 'selected');\n\t }\n\t input.appendChild(option);\n\t });\n\t container.appendChild(input);\n\t}\n\t\n\tToolbar.DEFAULTS = {\n\t container: null,\n\t handlers: {\n\t clean: function clean() {\n\t var _this3 = this;\n\t\n\t var range = this.quill.getSelection();\n\t if (range == null) return;\n\t if (range.length == 0) {\n\t var formats = this.quill.getFormat();\n\t Object.keys(formats).forEach(function (name) {\n\t // Clean functionality in existing apps only clean inline formats\n\t if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) {\n\t _this3.quill.format(name, false);\n\t }\n\t });\n\t } else {\n\t this.quill.removeFormat(range, _quill2.default.sources.USER);\n\t }\n\t },\n\t direction: function direction(value) {\n\t var align = this.quill.getFormat()['align'];\n\t if (value === 'rtl' && align == null) {\n\t this.quill.format('align', 'right', _quill2.default.sources.USER);\n\t } else if (!value && align === 'right') {\n\t this.quill.format('align', false, _quill2.default.sources.USER);\n\t }\n\t this.quill.format('direction', value, _quill2.default.sources.USER);\n\t },\n\t link: function link(value) {\n\t if (value === true) {\n\t value = prompt('Enter link URL:');\n\t }\n\t this.quill.format('link', value, _quill2.default.sources.USER);\n\t },\n\t indent: function indent(value) {\n\t var range = this.quill.getSelection();\n\t var formats = this.quill.getFormat(range);\n\t var indent = parseInt(formats.indent || 0);\n\t if (value === '+1' || value === '-1') {\n\t var modifier = value === '+1' ? 1 : -1;\n\t if (formats.direction === 'rtl') modifier *= -1;\n\t this.quill.format('indent', indent + modifier, _quill2.default.sources.USER);\n\t }\n\t }\n\t }\n\t};\n\t\n\texports.default = Toolbar;\n\texports.addControls = addControls;\n\n/***/ },\n/* 72 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t 'align': {\n\t '': __webpack_require__(73),\n\t 'center': __webpack_require__(74),\n\t 'right': __webpack_require__(75),\n\t 'justify': __webpack_require__(76)\n\t },\n\t 'background': __webpack_require__(77),\n\t 'blockquote': __webpack_require__(78),\n\t 'bold': __webpack_require__(79),\n\t 'clean': __webpack_require__(80),\n\t 'code': __webpack_require__(81),\n\t 'code-block': __webpack_require__(81),\n\t 'color': __webpack_require__(82),\n\t 'direction': {\n\t '': __webpack_require__(83),\n\t 'rtl': __webpack_require__(84)\n\t },\n\t 'float': {\n\t 'center': __webpack_require__(85),\n\t 'full': __webpack_require__(86),\n\t 'left': __webpack_require__(87),\n\t 'right': __webpack_require__(88)\n\t },\n\t 'formula': __webpack_require__(89),\n\t 'header': {\n\t '1': __webpack_require__(90),\n\t '2': __webpack_require__(91)\n\t },\n\t 'italic': __webpack_require__(92),\n\t 'image': __webpack_require__(93),\n\t 'indent': {\n\t '+1': __webpack_require__(94),\n\t '-1': __webpack_require__(95)\n\t },\n\t 'link': __webpack_require__(96),\n\t 'list': {\n\t 'ordered': __webpack_require__(97),\n\t 'bullet': __webpack_require__(98)\n\t },\n\t 'script': {\n\t 'sub': __webpack_require__(99),\n\t 'super': __webpack_require__(100)\n\t },\n\t 'strike': __webpack_require__(101),\n\t 'underline': __webpack_require__(102),\n\t 'video': __webpack_require__(103)\n\t};\n\n/***/ },\n/* 73 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 74 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 75 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 76 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 77 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 78 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 79 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 80 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 81 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 82 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 83 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 84 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 85 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 86 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 87 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 88 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 89 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 90 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 91 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 92 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 93 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 94 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 95 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 96 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 97 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 98 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 99 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 100 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 101 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 102 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 103 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 104 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _dropdown = __webpack_require__(105);\n\t\n\tvar _dropdown2 = _interopRequireDefault(_dropdown);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Picker = function () {\n\t function Picker(select) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Picker);\n\t\n\t this.select = select;\n\t this.container = document.createElement('span');\n\t this.buildPicker();\n\t this.select.style.display = 'none';\n\t this.select.parentNode.insertBefore(this.container, this.select);\n\t this.label.addEventListener('click', function () {\n\t _this.container.classList.toggle('ql-expanded');\n\t });\n\t this.select.addEventListener('change', this.update.bind(this));\n\t }\n\t\n\t _createClass(Picker, [{\n\t key: 'buildItem',\n\t value: function buildItem(option) {\n\t var _this2 = this;\n\t\n\t var item = document.createElement('span');\n\t item.classList.add('ql-picker-item');\n\t if (option.hasAttribute('value')) {\n\t item.setAttribute('data-value', option.getAttribute('value'));\n\t }\n\t if (option.textContent) {\n\t item.setAttribute('data-label', option.textContent);\n\t }\n\t item.addEventListener('click', function () {\n\t _this2.selectItem(item, true);\n\t });\n\t return item;\n\t }\n\t }, {\n\t key: 'buildLabel',\n\t value: function buildLabel() {\n\t var label = document.createElement('span');\n\t label.classList.add('ql-picker-label');\n\t label.innerHTML = _dropdown2.default;\n\t this.container.appendChild(label);\n\t return label;\n\t }\n\t }, {\n\t key: 'buildOptions',\n\t value: function buildOptions() {\n\t var _this3 = this;\n\t\n\t var options = document.createElement('span');\n\t options.classList.add('ql-picker-options');\n\t [].slice.call(this.select.options).forEach(function (option) {\n\t var item = _this3.buildItem(option);\n\t options.appendChild(item);\n\t if (option.hasAttribute('selected')) {\n\t _this3.selectItem(item);\n\t }\n\t });\n\t this.container.appendChild(options);\n\t }\n\t }, {\n\t key: 'buildPicker',\n\t value: function buildPicker() {\n\t var _this4 = this;\n\t\n\t [].slice.call(this.select.attributes).forEach(function (item) {\n\t _this4.container.setAttribute(item.name, item.value);\n\t });\n\t this.container.classList.add('ql-picker');\n\t this.label = this.buildLabel();\n\t this.buildOptions();\n\t }\n\t }, {\n\t key: 'close',\n\t value: function close() {\n\t this.container.classList.remove('ql-expanded');\n\t }\n\t }, {\n\t key: 'selectItem',\n\t value: function selectItem(item) {\n\t var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\t\n\t var selected = this.container.querySelector('.ql-selected');\n\t if (item === selected) return;\n\t if (selected != null) {\n\t selected.classList.remove('ql-selected');\n\t }\n\t if (item != null) {\n\t item.classList.add('ql-selected');\n\t this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);\n\t if (item.hasAttribute('data-value')) {\n\t this.label.setAttribute('data-value', item.getAttribute('data-value'));\n\t } else {\n\t this.label.removeAttribute('data-value');\n\t }\n\t if (item.hasAttribute('data-label')) {\n\t this.label.setAttribute('data-label', item.getAttribute('data-label'));\n\t } else {\n\t this.label.removeAttribute('data-label');\n\t }\n\t if (trigger) {\n\t if (typeof Event === 'function') {\n\t this.select.dispatchEvent(new Event('change'));\n\t } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') {\n\t // IE11\n\t var event = document.createEvent('Event');\n\t event.initEvent('change', true, true);\n\t this.select.dispatchEvent(event);\n\t }\n\t this.close();\n\t }\n\t } else {\n\t this.label.removeAttribute('data-value');\n\t this.label.removeAttribute('data-label');\n\t }\n\t }\n\t }, {\n\t key: 'update',\n\t value: function update() {\n\t var option = void 0;\n\t if (this.select.selectedIndex > -1) {\n\t var item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex];\n\t option = this.select.options[this.select.selectedIndex];\n\t this.selectItem(item);\n\t } else {\n\t this.selectItem(null);\n\t }\n\t var isActive = option != null && option !== this.select.querySelector('option[selected]');\n\t this.label.classList.toggle('ql-active', isActive);\n\t }\n\t }]);\n\t\n\t return Picker;\n\t}();\n\t\n\texports.default = Picker;\n\n/***/ },\n/* 105 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \" \";\n\n/***/ },\n/* 106 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _picker = __webpack_require__(104);\n\t\n\tvar _picker2 = _interopRequireDefault(_picker);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ColorPicker = function (_Picker) {\n\t _inherits(ColorPicker, _Picker);\n\t\n\t function ColorPicker(select, label) {\n\t _classCallCheck(this, ColorPicker);\n\t\n\t var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select));\n\t\n\t _this.label.innerHTML = label;\n\t _this.container.classList.add('ql-color-picker');\n\t [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) {\n\t item.classList.add('ql-primary');\n\t });\n\t return _this;\n\t }\n\t\n\t _createClass(ColorPicker, [{\n\t key: 'buildItem',\n\t value: function buildItem(option) {\n\t var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option);\n\t item.style.backgroundColor = option.getAttribute('value') || '';\n\t return item;\n\t }\n\t }, {\n\t key: 'selectItem',\n\t value: function selectItem(item, trigger) {\n\t _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger);\n\t var colorLabel = this.label.querySelector('.ql-color-label');\n\t var value = item ? item.getAttribute('data-value') || '' : '';\n\t if (colorLabel) {\n\t if (colorLabel.tagName === 'line') {\n\t colorLabel.style.stroke = value;\n\t } else {\n\t colorLabel.style.fill = value;\n\t }\n\t }\n\t }\n\t }]);\n\t\n\t return ColorPicker;\n\t}(_picker2.default);\n\t\n\texports.default = ColorPicker;\n\n/***/ },\n/* 107 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _picker = __webpack_require__(104);\n\t\n\tvar _picker2 = _interopRequireDefault(_picker);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar IconPicker = function (_Picker) {\n\t _inherits(IconPicker, _Picker);\n\t\n\t function IconPicker(select, icons) {\n\t _classCallCheck(this, IconPicker);\n\t\n\t var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select));\n\t\n\t _this.container.classList.add('ql-icon-picker');\n\t [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) {\n\t item.innerHTML = icons[item.getAttribute('data-value') || ''];\n\t });\n\t _this.defaultItem = _this.container.querySelector('.ql-selected');\n\t _this.selectItem(_this.defaultItem);\n\t return _this;\n\t }\n\t\n\t _createClass(IconPicker, [{\n\t key: 'selectItem',\n\t value: function selectItem(item, trigger) {\n\t _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger);\n\t item = item || this.defaultItem;\n\t this.label.innerHTML = item.innerHTML;\n\t }\n\t }]);\n\t\n\t return IconPicker;\n\t}(_picker2.default);\n\t\n\texports.default = IconPicker;\n\n/***/ },\n/* 108 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Tooltip = function () {\n\t function Tooltip(quill, boundsContainer) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Tooltip);\n\t\n\t this.quill = quill;\n\t this.boundsContainer = boundsContainer || document.body;\n\t this.root = quill.addContainer('ql-tooltip');\n\t this.root.innerHTML = this.constructor.TEMPLATE;\n\t var offset = parseInt(window.getComputedStyle(this.root).marginTop);\n\t this.quill.root.addEventListener('scroll', function () {\n\t _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + offset + 'px';\n\t _this.checkBounds();\n\t });\n\t this.hide();\n\t }\n\t\n\t _createClass(Tooltip, [{\n\t key: 'checkBounds',\n\t value: function checkBounds() {\n\t this.root.classList.toggle('ql-out-top', this.root.offsetTop <= 0);\n\t this.root.classList.remove('ql-out-bottom');\n\t this.root.classList.toggle('ql-out-bottom', this.root.offsetTop + this.root.offsetHeight >= this.quill.root.offsetHeight);\n\t }\n\t }, {\n\t key: 'hide',\n\t value: function hide() {\n\t this.root.classList.add('ql-hidden');\n\t }\n\t }, {\n\t key: 'position',\n\t value: function position(reference) {\n\t var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n\t var top = reference.bottom + this.quill.root.scrollTop;\n\t this.root.style.left = left + 'px';\n\t this.root.style.top = top + 'px';\n\t var containerBounds = this.boundsContainer.getBoundingClientRect();\n\t var rootBounds = this.root.getBoundingClientRect();\n\t var shift = 0;\n\t if (rootBounds.right > containerBounds.right) {\n\t shift = containerBounds.right - rootBounds.right;\n\t this.root.style.left = left + shift + 'px';\n\t }\n\t if (rootBounds.left < containerBounds.left) {\n\t shift = containerBounds.left - rootBounds.left;\n\t this.root.style.left = left + shift + 'px';\n\t }\n\t this.checkBounds();\n\t return shift;\n\t }\n\t }, {\n\t key: 'show',\n\t value: function show() {\n\t this.root.classList.remove('ql-editing');\n\t this.root.classList.remove('ql-hidden');\n\t }\n\t }]);\n\t\n\t return Tooltip;\n\t}();\n\t\n\texports.default = Tooltip;\n\n/***/ },\n/* 109 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.BubbleTooltip = undefined;\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _emitter = __webpack_require__(36);\n\t\n\tvar _emitter2 = _interopRequireDefault(_emitter);\n\t\n\tvar _base = __webpack_require__(110);\n\t\n\tvar _base2 = _interopRequireDefault(_base);\n\t\n\tvar _selection = __webpack_require__(44);\n\t\n\tvar _icons = __webpack_require__(72);\n\t\n\tvar _icons2 = _interopRequireDefault(_icons);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']];\n\t\n\tvar BubbleTheme = function (_BaseTheme) {\n\t _inherits(BubbleTheme, _BaseTheme);\n\t\n\t function BubbleTheme(quill, options) {\n\t _classCallCheck(this, BubbleTheme);\n\t\n\t if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n\t options.modules.toolbar.container = TOOLBAR_CONFIG;\n\t }\n\t\n\t var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options));\n\t\n\t _this.quill.container.classList.add('ql-bubble');\n\t return _this;\n\t }\n\t\n\t _createClass(BubbleTheme, [{\n\t key: 'extendToolbar',\n\t value: function extendToolbar(toolbar) {\n\t this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n\t this.tooltip.root.appendChild(toolbar.container);\n\t this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);\n\t this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);\n\t }\n\t }]);\n\t\n\t return BubbleTheme;\n\t}(_base2.default);\n\t\n\tBubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {\n\t modules: {\n\t toolbar: {\n\t handlers: {\n\t link: function link(value) {\n\t if (!value) {\n\t this.quill.format('link', false);\n\t } else {\n\t this.quill.theme.tooltip.edit();\n\t }\n\t }\n\t }\n\t }\n\t }\n\t});\n\t\n\tvar BubbleTooltip = function (_BaseTooltip) {\n\t _inherits(BubbleTooltip, _BaseTooltip);\n\t\n\t function BubbleTooltip(quill, bounds) {\n\t _classCallCheck(this, BubbleTooltip);\n\t\n\t var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds));\n\t\n\t _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range) {\n\t if (type !== _emitter2.default.events.SELECTION_CHANGE) return;\n\t if (range != null && range.length > 0) {\n\t _this2.show();\n\t // Lock our width so we will expand beyond our offsetParent boundaries\n\t _this2.root.style.left = '0px';\n\t _this2.root.style.width = '';\n\t _this2.root.style.width = _this2.root.offsetWidth + 'px';\n\t var lines = _this2.quill.scroll.lines(range.index, range.length);\n\t if (lines.length === 1) {\n\t _this2.position(_this2.quill.getBounds(range));\n\t } else {\n\t var lastLine = lines[lines.length - 1];\n\t var index = lastLine.offset(_this2.quill.scroll);\n\t var length = Math.min(lastLine.length() - 1, range.index + range.length - index);\n\t var _bounds = _this2.quill.getBounds(new _selection.Range(index, length));\n\t _this2.position(_bounds);\n\t }\n\t } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) {\n\t _this2.hide();\n\t }\n\t });\n\t return _this2;\n\t }\n\t\n\t _createClass(BubbleTooltip, [{\n\t key: 'listen',\n\t value: function listen() {\n\t var _this3 = this;\n\t\n\t _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this);\n\t this.root.querySelector('.ql-close').addEventListener('click', function () {\n\t _this3.root.classList.remove('ql-editing');\n\t });\n\t this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () {\n\t // Let selection be restored by toolbar handlers before repositioning\n\t setTimeout(function () {\n\t if (_this3.root.classList.contains('ql-hidden')) return;\n\t var range = _this3.quill.getSelection();\n\t if (range != null) {\n\t _this3.position(_this3.quill.getBounds(range));\n\t }\n\t }, 1);\n\t });\n\t }\n\t }, {\n\t key: 'cancel',\n\t value: function cancel() {\n\t this.show();\n\t }\n\t }, {\n\t key: 'position',\n\t value: function position(reference) {\n\t var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference);\n\t var arrow = this.root.querySelector('.ql-tooltip-arrow');\n\t arrow.style.marginLeft = '';\n\t if (shift === 0) return shift;\n\t arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px';\n\t }\n\t }]);\n\t\n\t return BubbleTooltip;\n\t}(_base.BaseTooltip);\n\t\n\tBubbleTooltip.TEMPLATE = ['', '
    ', '', '', '
    '].join('');\n\t\n\texports.BubbleTooltip = BubbleTooltip;\n\texports.default = BubbleTheme;\n\n/***/ },\n/* 110 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = exports.BaseTooltip = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _quillDelta = __webpack_require__(20);\n\t\n\tvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\t\n\tvar _emitter = __webpack_require__(36);\n\t\n\tvar _emitter2 = _interopRequireDefault(_emitter);\n\t\n\tvar _keyboard = __webpack_require__(56);\n\t\n\tvar _keyboard2 = _interopRequireDefault(_keyboard);\n\t\n\tvar _theme = __webpack_require__(45);\n\t\n\tvar _theme2 = _interopRequireDefault(_theme);\n\t\n\tvar _colorPicker = __webpack_require__(106);\n\t\n\tvar _colorPicker2 = _interopRequireDefault(_colorPicker);\n\t\n\tvar _iconPicker = __webpack_require__(107);\n\t\n\tvar _iconPicker2 = _interopRequireDefault(_iconPicker);\n\t\n\tvar _picker = __webpack_require__(104);\n\t\n\tvar _picker2 = _interopRequireDefault(_picker);\n\t\n\tvar _tooltip = __webpack_require__(108);\n\t\n\tvar _tooltip2 = _interopRequireDefault(_tooltip);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ALIGNS = [false, 'center', 'right', 'justify'];\n\t\n\tvar 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\"];\n\t\n\tvar FONTS = [false, 'serif', 'monospace'];\n\t\n\tvar HEADERS = ['1', '2', '3', false];\n\t\n\tvar SIZES = ['small', false, 'large', 'huge'];\n\t\n\tvar BaseTheme = function (_Theme) {\n\t _inherits(BaseTheme, _Theme);\n\t\n\t function BaseTheme(quill, options) {\n\t _classCallCheck(this, BaseTheme);\n\t\n\t var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options));\n\t\n\t var listener = function listener(e) {\n\t if (!document.body.contains(quill.root)) {\n\t return document.body.removeEventListener('click', listener);\n\t }\n\t if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) {\n\t _this.tooltip.hide();\n\t }\n\t if (_this.pickers != null) {\n\t _this.pickers.forEach(function (picker) {\n\t if (!picker.container.contains(e.target)) {\n\t picker.close();\n\t }\n\t });\n\t }\n\t };\n\t document.body.addEventListener('click', listener);\n\t return _this;\n\t }\n\t\n\t _createClass(BaseTheme, [{\n\t key: 'addModule',\n\t value: function addModule(name) {\n\t var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name);\n\t if (name === 'toolbar') {\n\t this.extendToolbar(module);\n\t }\n\t return module;\n\t }\n\t }, {\n\t key: 'buildButtons',\n\t value: function buildButtons(buttons, icons) {\n\t buttons.forEach(function (button) {\n\t var className = button.getAttribute('class') || '';\n\t className.split(/\\s+/).forEach(function (name) {\n\t if (!name.startsWith('ql-')) return;\n\t name = name.slice('ql-'.length);\n\t if (icons[name] == null) return;\n\t if (name === 'direction') {\n\t button.innerHTML = icons[name][''] + icons[name]['rtl'];\n\t } else if (typeof icons[name] === 'string') {\n\t button.innerHTML = icons[name];\n\t } else {\n\t var value = button.value || '';\n\t if (value != null && icons[name][value]) {\n\t button.innerHTML = icons[name][value];\n\t }\n\t }\n\t });\n\t });\n\t }\n\t }, {\n\t key: 'buildPickers',\n\t value: function buildPickers(selects, icons) {\n\t var _this2 = this;\n\t\n\t this.pickers = selects.map(function (select) {\n\t if (select.classList.contains('ql-align')) {\n\t if (select.querySelector('option') == null) {\n\t fillSelect(select, ALIGNS);\n\t }\n\t return new _iconPicker2.default(select, icons.align);\n\t } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {\n\t var format = select.classList.contains('ql-background') ? 'background' : 'color';\n\t if (select.querySelector('option') == null) {\n\t fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');\n\t }\n\t return new _colorPicker2.default(select, icons[format]);\n\t } else {\n\t if (select.querySelector('option') == null) {\n\t if (select.classList.contains('ql-font')) {\n\t fillSelect(select, FONTS);\n\t } else if (select.classList.contains('ql-header')) {\n\t fillSelect(select, HEADERS);\n\t } else if (select.classList.contains('ql-size')) {\n\t fillSelect(select, SIZES);\n\t }\n\t }\n\t return new _picker2.default(select);\n\t }\n\t });\n\t var update = function update() {\n\t _this2.pickers.forEach(function (picker) {\n\t picker.update();\n\t });\n\t };\n\t this.quill.on(_emitter2.default.events.SELECTION_CHANGE, update).on(_emitter2.default.events.SCROLL_OPTIMIZE, update);\n\t }\n\t }]);\n\t\n\t return BaseTheme;\n\t}(_theme2.default);\n\t\n\tBaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, {\n\t modules: {\n\t toolbar: {\n\t handlers: {\n\t formula: function formula() {\n\t this.quill.theme.tooltip.edit('formula');\n\t },\n\t image: function image() {\n\t var _this3 = this;\n\t\n\t var fileInput = this.container.querySelector('input.ql-image[type=file]');\n\t if (fileInput == null) {\n\t fileInput = document.createElement('input');\n\t fileInput.setAttribute('type', 'file');\n\t fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon, image/svg+xml');\n\t fileInput.classList.add('ql-image');\n\t fileInput.addEventListener('change', function () {\n\t if (fileInput.files != null && fileInput.files[0] != null) {\n\t var reader = new FileReader();\n\t reader.onload = function (e) {\n\t var range = _this3.quill.getSelection(true);\n\t _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER);\n\t fileInput.value = \"\";\n\t };\n\t reader.readAsDataURL(fileInput.files[0]);\n\t }\n\t });\n\t this.container.appendChild(fileInput);\n\t }\n\t fileInput.click();\n\t },\n\t video: function video() {\n\t this.quill.theme.tooltip.edit('video');\n\t }\n\t }\n\t }\n\t }\n\t});\n\t\n\tvar BaseTooltip = function (_Tooltip) {\n\t _inherits(BaseTooltip, _Tooltip);\n\t\n\t function BaseTooltip(quill, boundsContainer) {\n\t _classCallCheck(this, BaseTooltip);\n\t\n\t var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer));\n\t\n\t _this4.textbox = _this4.root.querySelector('input[type=\"text\"]');\n\t _this4.listen();\n\t return _this4;\n\t }\n\t\n\t _createClass(BaseTooltip, [{\n\t key: 'listen',\n\t value: function listen() {\n\t var _this5 = this;\n\t\n\t this.textbox.addEventListener('keydown', function (event) {\n\t if (_keyboard2.default.match(event, 'enter')) {\n\t _this5.save();\n\t event.preventDefault();\n\t } else if (_keyboard2.default.match(event, 'escape')) {\n\t _this5.cancel();\n\t event.preventDefault();\n\t }\n\t });\n\t }\n\t }, {\n\t key: 'cancel',\n\t value: function cancel() {\n\t this.hide();\n\t }\n\t }, {\n\t key: 'edit',\n\t value: function edit() {\n\t var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link';\n\t var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\t\n\t this.root.classList.remove('ql-hidden');\n\t this.root.classList.add('ql-editing');\n\t if (preview != null) {\n\t this.textbox.value = preview;\n\t } else if (mode !== this.root.getAttribute('data-mode')) {\n\t this.textbox.value = '';\n\t }\n\t this.position(this.quill.getBounds(this.quill.selection.savedRange));\n\t this.textbox.select();\n\t this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || '');\n\t this.root.setAttribute('data-mode', mode);\n\t }\n\t }, {\n\t key: 'restoreFocus',\n\t value: function restoreFocus() {\n\t var scrollTop = this.quill.root.scrollTop;\n\t this.quill.focus();\n\t this.quill.root.scrollTop = scrollTop;\n\t }\n\t }, {\n\t key: 'save',\n\t value: function save() {\n\t var value = this.textbox.value;\n\t switch (this.root.getAttribute('data-mode')) {\n\t case 'link':\n\t {\n\t var scrollTop = this.quill.root.scrollTop;\n\t if (this.linkRange) {\n\t this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER);\n\t delete this.linkRange;\n\t } else {\n\t this.restoreFocus();\n\t this.quill.format('link', value, _emitter2.default.sources.USER);\n\t }\n\t this.quill.root.scrollTop = scrollTop;\n\t break;\n\t }\n\t case 'video':\n\t {\n\t var match = value.match(/^(https?):\\/\\/(www\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/) || value.match(/^(https?):\\/\\/(www\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n\t if (match) {\n\t value = match[1] + '://www.youtube.com/embed/' + match[3] + '?showinfo=0';\n\t } else if (match = value.match(/^(https?):\\/\\/(www\\.)?vimeo\\.com\\/(\\d+)/)) {\n\t // eslint-disable-line no-cond-assign\n\t value = match[1] + '://player.vimeo.com/video/' + match[3] + '/';\n\t }\n\t } // eslint-disable-next-line no-fallthrough\n\t case 'formula':\n\t {\n\t var range = this.quill.getSelection(true);\n\t var index = range.index + range.length;\n\t if (range != null) {\n\t this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER);\n\t if (this.root.getAttribute('data-mode') === 'formula') {\n\t this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER);\n\t }\n\t this.quill.setSelection(index + 2, _emitter2.default.sources.USER);\n\t }\n\t break;\n\t }\n\t default:\n\t }\n\t this.textbox.value = '';\n\t this.hide();\n\t }\n\t }]);\n\t\n\t return BaseTooltip;\n\t}(_tooltip2.default);\n\t\n\tfunction fillSelect(select, values) {\n\t var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\t\n\t values.forEach(function (value) {\n\t var option = document.createElement('option');\n\t if (value === defaultValue) {\n\t option.setAttribute('selected', 'selected');\n\t } else {\n\t option.setAttribute('value', value);\n\t }\n\t select.appendChild(option);\n\t });\n\t}\n\t\n\texports.BaseTooltip = BaseTooltip;\n\texports.default = BaseTheme;\n\n/***/ },\n/* 111 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\t\n\tvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _extend = __webpack_require__(30);\n\t\n\tvar _extend2 = _interopRequireDefault(_extend);\n\t\n\tvar _emitter = __webpack_require__(36);\n\t\n\tvar _emitter2 = _interopRequireDefault(_emitter);\n\t\n\tvar _base = __webpack_require__(110);\n\t\n\tvar _base2 = _interopRequireDefault(_base);\n\t\n\tvar _link = __webpack_require__(63);\n\t\n\tvar _link2 = _interopRequireDefault(_link);\n\t\n\tvar _selection = __webpack_require__(44);\n\t\n\tvar _icons = __webpack_require__(72);\n\t\n\tvar _icons2 = _interopRequireDefault(_icons);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']];\n\t\n\tvar SnowTheme = function (_BaseTheme) {\n\t _inherits(SnowTheme, _BaseTheme);\n\t\n\t function SnowTheme(quill, options) {\n\t _classCallCheck(this, SnowTheme);\n\t\n\t if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n\t options.modules.toolbar.container = TOOLBAR_CONFIG;\n\t }\n\t\n\t var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options));\n\t\n\t _this.quill.container.classList.add('ql-snow');\n\t return _this;\n\t }\n\t\n\t _createClass(SnowTheme, [{\n\t key: 'extendToolbar',\n\t value: function extendToolbar(toolbar) {\n\t toolbar.container.classList.add('ql-snow');\n\t this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);\n\t this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);\n\t this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n\t if (toolbar.container.querySelector('.ql-link')) {\n\t this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) {\n\t toolbar.handlers['link'].call(toolbar, !context.format.link);\n\t });\n\t }\n\t }\n\t }]);\n\t\n\t return SnowTheme;\n\t}(_base2.default);\n\t\n\tSnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {\n\t modules: {\n\t toolbar: {\n\t handlers: {\n\t link: function link(value) {\n\t if (value) {\n\t var range = this.quill.getSelection();\n\t if (range == null || range.length == 0) return;\n\t var preview = this.quill.getText(range);\n\t if (/^\\S+@\\S+\\.\\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {\n\t preview = 'mailto:' + preview;\n\t }\n\t var tooltip = this.quill.theme.tooltip;\n\t tooltip.edit('link', preview);\n\t } else {\n\t this.quill.format('link', false);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t});\n\t\n\tvar SnowTooltip = function (_BaseTooltip) {\n\t _inherits(SnowTooltip, _BaseTooltip);\n\t\n\t function SnowTooltip(quill, bounds) {\n\t _classCallCheck(this, SnowTooltip);\n\t\n\t var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds));\n\t\n\t _this2.preview = _this2.root.querySelector('a.ql-preview');\n\t return _this2;\n\t }\n\t\n\t _createClass(SnowTooltip, [{\n\t key: 'listen',\n\t value: function listen() {\n\t var _this3 = this;\n\t\n\t _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this);\n\t this.root.querySelector('a.ql-action').addEventListener('click', function (event) {\n\t if (_this3.root.classList.contains('ql-editing')) {\n\t _this3.save();\n\t } else {\n\t _this3.edit('link', _this3.preview.textContent);\n\t }\n\t event.preventDefault();\n\t });\n\t this.root.querySelector('a.ql-remove').addEventListener('click', function (event) {\n\t if (_this3.linkRange != null) {\n\t _this3.restoreFocus();\n\t _this3.quill.formatText(_this3.linkRange, 'link', false, _emitter2.default.sources.USER);\n\t delete _this3.linkRange;\n\t }\n\t event.preventDefault();\n\t _this3.hide();\n\t });\n\t this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range) {\n\t if (range == null) return;\n\t if (range.length === 0) {\n\t var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index),\n\t _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),\n\t link = _quill$scroll$descend2[0],\n\t offset = _quill$scroll$descend2[1];\n\t\n\t if (link != null) {\n\t _this3.linkRange = new _selection.Range(range.index - offset, link.length());\n\t var preview = _link2.default.formats(link.domNode);\n\t _this3.preview.textContent = preview;\n\t _this3.preview.setAttribute('href', preview);\n\t _this3.show();\n\t _this3.position(_this3.quill.getBounds(_this3.linkRange));\n\t return;\n\t }\n\t } else {\n\t delete _this3.linkRange;\n\t }\n\t _this3.hide();\n\t });\n\t }\n\t }, {\n\t key: 'show',\n\t value: function show() {\n\t _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this);\n\t this.root.removeAttribute('data-mode');\n\t }\n\t }]);\n\t\n\t return SnowTooltip;\n\t}(_base.BaseTooltip);\n\t\n\tSnowTooltip.TEMPLATE = ['', '', '', ''].join('');\n\t\n\texports.default = SnowTheme;\n\n/***/ },\n/* 112 */\n/***/ function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) {\n\n\tvar pSlice = Array.prototype.slice;\n\tvar objectKeys = __webpack_require__(__webpack_module_template_argument_0__);\n\tvar isArguments = __webpack_require__(__webpack_module_template_argument_1__);\n\t\n\tvar deepEqual = module.exports = function (actual, expected, opts) {\n\t if (!opts) opts = {};\n\t // 7.1. All identical values are equivalent, as determined by ===.\n\t if (actual === expected) {\n\t return true;\n\t\n\t } else if (actual instanceof Date && expected instanceof Date) {\n\t return actual.getTime() === expected.getTime();\n\t\n\t // 7.3. Other pairs that do not both pass typeof value == 'object',\n\t // equivalence is determined by ==.\n\t } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n\t return opts.strict ? actual === expected : actual == expected;\n\t\n\t // 7.4. For all other Object pairs, including Array objects, equivalence is\n\t // determined by having the same number of owned properties (as verified\n\t // with Object.prototype.hasOwnProperty.call), the same set of keys\n\t // (although not necessarily the same order), equivalent values for every\n\t // corresponding key, and an identical 'prototype' property. Note: this\n\t // accounts for both named and indexed properties on Arrays.\n\t } else {\n\t return objEquiv(actual, expected, opts);\n\t }\n\t}\n\t\n\tfunction isUndefinedOrNull(value) {\n\t return value === null || value === undefined;\n\t}\n\t\n\tfunction isBuffer (x) {\n\t if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n\t if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n\t return false;\n\t }\n\t if (x.length > 0 && typeof x[0] !== 'number') return false;\n\t return true;\n\t}\n\t\n\tfunction objEquiv(a, b, opts) {\n\t var i, key;\n\t if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n\t return false;\n\t // an identical 'prototype' property.\n\t if (a.prototype !== b.prototype) return false;\n\t //~~~I've managed to break Object.keys through screwy arguments passing.\n\t // Converting to array solves the problem.\n\t if (isArguments(a)) {\n\t if (!isArguments(b)) {\n\t return false;\n\t }\n\t a = pSlice.call(a);\n\t b = pSlice.call(b);\n\t return deepEqual(a, b, opts);\n\t }\n\t if (isBuffer(a)) {\n\t if (!isBuffer(b)) {\n\t return false;\n\t }\n\t if (a.length !== b.length) return false;\n\t for (i = 0; i < a.length; i++) {\n\t if (a[i] !== b[i]) return false;\n\t }\n\t return true;\n\t }\n\t try {\n\t var ka = objectKeys(a),\n\t kb = objectKeys(b);\n\t } catch (e) {//happens when one is a string literal and the other isn't\n\t return false;\n\t }\n\t // having the same number of owned properties (keys incorporates\n\t // hasOwnProperty)\n\t if (ka.length != kb.length)\n\t return false;\n\t //the same set of keys (although not necessarily the same order),\n\t ka.sort();\n\t kb.sort();\n\t //~~~cheap key test\n\t for (i = ka.length - 1; i >= 0; i--) {\n\t if (ka[i] != kb[i])\n\t return false;\n\t }\n\t //equivalent values for every corresponding key, and\n\t //~~~possibly expensive deep test\n\t for (i = ka.length - 1; i >= 0; i--) {\n\t key = ka[i];\n\t if (!deepEqual(a[key], b[key], opts)) return false;\n\t }\n\t return typeof a === typeof b;\n\t}\n\n\n/***/ }\n/******/ ])))\n});\n;\n\n\n// WEBPACK FOOTER //\n// quill.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 12da403d1f2adb6b6342","import Quill from './core';\n\nimport { AlignClass, AlignStyle } from './formats/align';\nimport { DirectionAttribute, DirectionClass, DirectionStyle } from './formats/direction';\nimport { IndentClass as Indent } from './formats/indent';\n\nimport Blockquote from './formats/blockquote';\nimport Header from './formats/header';\nimport List, { ListItem } from './formats/list';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background';\nimport { ColorClass, ColorStyle } from './formats/color';\nimport { FontClass, FontStyle } from './formats/font';\nimport { SizeClass, SizeStyle } from './formats/size';\n\nimport Bold from './formats/bold';\nimport Italic from './formats/italic';\nimport Link from './formats/link';\nimport Script from './formats/script';\nimport Strike from './formats/strike';\nimport Underline from './formats/underline';\n\nimport Image from './formats/image';\nimport Video from './formats/video';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code';\n\nimport Formula from './modules/formula';\nimport Syntax from './modules/syntax';\nimport Toolbar from './modules/toolbar';\n\nimport Icons from './ui/icons';\nimport Picker from './ui/picker';\nimport ColorPicker from './ui/color-picker';\nimport IconPicker from './ui/icon-picker';\nimport Tooltip from './ui/tooltip';\n\nimport BubbleTheme from './themes/bubble';\nimport SnowTheme from './themes/snow';\n\n\nQuill.register({\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle\n}, true);\n\n\nQuill.register({\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'formats/list/item': ListItem,\n\n 'modules/formula': Formula,\n 'modules/syntax': Syntax,\n 'modules/toolbar': Toolbar,\n\n 'themes/bubble': BubbleTheme,\n 'themes/snow': SnowTheme,\n\n 'ui/icons': Icons,\n 'ui/picker': Picker,\n 'ui/icon-picker': IconPicker,\n 'ui/color-picker': ColorPicker,\n 'ui/tooltip': Tooltip\n}, true);\n\n\nmodule.exports = Quill;\n\n\n\n// WEBPACK FOOTER //\n// ./quill.js","import Parchment from 'parchment';\nimport Quill from './core/quill';\n\nimport Block, { BlockEmbed } from './blots/block';\nimport Break from './blots/break';\nimport Container from './blots/container';\nimport Cursor from './blots/cursor';\nimport Embed from './blots/embed';\nimport Inline from './blots/inline';\nimport Scroll from './blots/scroll';\nimport TextBlot from './blots/text';\n\nimport Clipboard from './modules/clipboard';\nimport History from './modules/history';\nimport Keyboard from './modules/keyboard';\n\nQuill.register({\n 'blots/block' : Block,\n 'blots/block/embed' : BlockEmbed,\n 'blots/break' : Break,\n 'blots/container' : Container,\n 'blots/cursor' : Cursor,\n 'blots/embed' : Embed,\n 'blots/inline' : Inline,\n 'blots/scroll' : Scroll,\n 'blots/text' : TextBlot,\n\n 'modules/clipboard' : Clipboard,\n 'modules/history' : History,\n 'modules/keyboard' : Keyboard\n});\n\nParchment.register(Block, Break, Cursor, Inline, Scroll, TextBlot);\n\n\nmodule.exports = Quill;\n\n\n\n// WEBPACK FOOTER //\n// ./core.js","\"use strict\";\nvar container_1 = require('./blot/abstract/container');\nvar format_1 = require('./blot/abstract/format');\nvar leaf_1 = require('./blot/abstract/leaf');\nvar scroll_1 = require('./blot/scroll');\nvar inline_1 = require('./blot/inline');\nvar block_1 = require('./blot/block');\nvar embed_1 = require('./blot/embed');\nvar text_1 = require('./blot/text');\nvar attributor_1 = require('./attributor/attributor');\nvar class_1 = require('./attributor/class');\nvar style_1 = require('./attributor/style');\nvar store_1 = require('./attributor/store');\nvar Registry = require('./registry');\nvar Parchment = {\n Scope: Registry.Scope,\n create: Registry.create,\n find: Registry.find,\n query: Registry.query,\n register: Registry.register,\n Container: container_1.default,\n Format: format_1.default,\n Leaf: leaf_1.default,\n Embed: embed_1.default,\n Scroll: scroll_1.default,\n Block: block_1.default,\n Inline: inline_1.default,\n Text: text_1.default,\n Attributor: {\n Attribute: attributor_1.default,\n Class: class_1.default,\n Style: style_1.default,\n Store: store_1.default\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Parchment;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/parchment.ts\n// module id = 2\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar linked_list_1 = require('../../collection/linked-list');\nvar shadow_1 = require('./shadow');\nvar Registry = require('../../registry');\nvar ContainerBlot = (function (_super) {\n __extends(ContainerBlot, _super);\n function ContainerBlot() {\n _super.apply(this, arguments);\n }\n ContainerBlot.prototype.appendChild = function (other) {\n this.insertBefore(other);\n };\n ContainerBlot.prototype.attach = function () {\n var _this = this;\n _super.prototype.attach.call(this);\n this.children = new linked_list_1.default();\n // Need to be reversed for if DOM nodes already in order\n [].slice.call(this.domNode.childNodes).reverse().forEach(function (node) {\n try {\n var child = makeBlot(node);\n _this.insertBefore(child, _this.children.head);\n }\n catch (err) {\n if (err instanceof Registry.ParchmentError)\n return;\n else\n throw err;\n }\n });\n };\n ContainerBlot.prototype.deleteAt = function (index, length) {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.deleteAt(offset, length);\n });\n };\n ContainerBlot.prototype.descendant = function (criteria, index) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n return [child, offset];\n }\n else if (child instanceof ContainerBlot) {\n return child.descendant(criteria, offset);\n }\n else {\n return [null, -1];\n }\n };\n ContainerBlot.prototype.descendants = function (criteria, index, length) {\n if (index === void 0) { index = 0; }\n if (length === void 0) { length = Number.MAX_VALUE; }\n var descendants = [], lengthLeft = length;\n this.children.forEachAt(index, length, function (child, index, length) {\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n descendants.push(child);\n }\n if (child instanceof ContainerBlot) {\n descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return descendants;\n };\n ContainerBlot.prototype.detach = function () {\n this.children.forEach(function (child) {\n child.detach();\n });\n _super.prototype.detach.call(this);\n };\n ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.formatAt(offset, length, name, value);\n });\n };\n ContainerBlot.prototype.insertAt = function (index, value, def) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if (child) {\n child.insertAt(offset, value, def);\n }\n else {\n var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def);\n this.appendChild(blot);\n }\n };\n ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function (child) {\n return childBlot instanceof child;\n })) {\n throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n }\n childBlot.insertInto(this, refBlot);\n };\n ContainerBlot.prototype.length = function () {\n return this.children.reduce(function (memo, child) {\n return memo + child.length();\n }, 0);\n };\n ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n this.children.forEach(function (child) {\n targetParent.insertBefore(child, refNode);\n });\n };\n ContainerBlot.prototype.optimize = function () {\n _super.prototype.optimize.call(this);\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n var child = Registry.create(this.statics.defaultChild);\n this.appendChild(child);\n child.optimize();\n }\n else {\n this.remove();\n }\n }\n };\n ContainerBlot.prototype.path = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n var position = [[this, index]];\n if (child instanceof ContainerBlot) {\n return position.concat(child.path(offset, inclusive));\n }\n else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n };\n ContainerBlot.prototype.removeChild = function (child) {\n this.children.remove(child);\n };\n ContainerBlot.prototype.replace = function (target) {\n if (target instanceof ContainerBlot) {\n target.moveChildren(this);\n }\n _super.prototype.replace.call(this, target);\n };\n ContainerBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = this.clone();\n this.parent.insertBefore(after, this.next);\n this.children.forEachAt(index, this.length(), function (child, offset, length) {\n child = child.split(offset, force);\n after.appendChild(child);\n });\n return after;\n };\n ContainerBlot.prototype.unwrap = function () {\n this.moveChildren(this.parent, this.next);\n this.remove();\n };\n ContainerBlot.prototype.update = function (mutations) {\n var _this = this;\n var addedNodes = [], removedNodes = [];\n mutations.forEach(function (mutation) {\n if (mutation.target === _this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach(function (node) {\n if (node.parentNode != null &&\n (document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY)) {\n // Node has not actually been removed\n return;\n }\n var blot = Registry.find(node);\n if (blot == null)\n return;\n if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n blot.detach();\n }\n });\n addedNodes.filter(function (node) {\n return node.parentNode == _this.domNode;\n }).sort(function (a, b) {\n if (a === b)\n return 0;\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n }).forEach(function (node) {\n var refBlot = null;\n if (node.nextSibling != null) {\n refBlot = Registry.find(node.nextSibling);\n }\n var blot = makeBlot(node);\n if (blot.next != refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(_this);\n }\n _this.insertBefore(blot, refBlot);\n }\n });\n };\n return ContainerBlot;\n}(shadow_1.default));\nfunction makeBlot(node) {\n var blot = Registry.find(node);\n if (blot == null) {\n try {\n blot = Registry.create(node);\n }\n catch (e) {\n blot = Registry.create(Registry.Scope.INLINE);\n [].slice.call(node.childNodes).forEach(function (child) {\n blot.domNode.appendChild(child);\n });\n node.parentNode.replaceChild(blot.domNode, node);\n blot.attach();\n }\n }\n return blot;\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = ContainerBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/abstract/container.ts\n// module id = 3\n// module chunks = 0","\"use strict\";\nvar LinkedList = (function () {\n function LinkedList() {\n this.head = this.tail = undefined;\n this.length = 0;\n }\n LinkedList.prototype.append = function () {\n var nodes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodes[_i - 0] = arguments[_i];\n }\n this.insertBefore(nodes[0], undefined);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n };\n LinkedList.prototype.contains = function (node) {\n var cur, next = this.iterator();\n while (cur = next()) {\n if (cur === node)\n return true;\n }\n return false;\n };\n LinkedList.prototype.insertBefore = function (node, refNode) {\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n }\n else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n }\n else {\n node.prev = undefined;\n this.head = this.tail = node;\n }\n this.length += 1;\n };\n LinkedList.prototype.offset = function (target) {\n var index = 0, cur = this.head;\n while (cur != null) {\n if (cur === target)\n return index;\n index += cur.length();\n cur = cur.next;\n }\n return -1;\n };\n LinkedList.prototype.remove = function (node) {\n if (!this.contains(node))\n return;\n if (node.prev != null)\n node.prev.next = node.next;\n if (node.next != null)\n node.next.prev = node.prev;\n if (node === this.head)\n this.head = node.next;\n if (node === this.tail)\n this.tail = node.prev;\n this.length -= 1;\n };\n LinkedList.prototype.iterator = function (curNode) {\n if (curNode === void 0) { curNode = this.head; }\n // TODO use yield when we can\n return function () {\n var ret = curNode;\n if (curNode != null)\n curNode = curNode.next;\n return ret;\n };\n };\n LinkedList.prototype.find = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var cur, next = this.iterator();\n while (cur = next()) {\n var length_1 = cur.length();\n if (index < length_1 || (inclusive && index === length_1 && (cur.next == null || cur.next.length() !== 0))) {\n return [cur, index];\n }\n index -= length_1;\n }\n return [null, 0];\n };\n LinkedList.prototype.forEach = function (callback) {\n var cur, next = this.iterator();\n while (cur = next()) {\n callback(cur);\n }\n };\n LinkedList.prototype.forEachAt = function (index, length, callback) {\n if (length <= 0)\n return;\n var _a = this.find(index), startNode = _a[0], offset = _a[1];\n var cur, curIndex = index - offset, next = this.iterator(startNode);\n while ((cur = next()) && curIndex < index + length) {\n var curLength = cur.length();\n if (index > curIndex) {\n callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n }\n else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n }\n };\n LinkedList.prototype.map = function (callback) {\n return this.reduce(function (memo, cur) {\n memo.push(callback(cur));\n return memo;\n }, []);\n };\n LinkedList.prototype.reduce = function (callback, memo) {\n var cur, next = this.iterator();\n while (cur = next()) {\n memo = callback(memo, cur);\n }\n return memo;\n };\n return LinkedList;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = LinkedList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/collection/linked-list.ts\n// module id = 4\n// module chunks = 0","\"use strict\";\nvar Registry = require('../../registry');\nvar ShadowBlot = (function () {\n function ShadowBlot(domNode) {\n this.domNode = domNode;\n this.attach();\n }\n Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n // Hack for accessing inherited static methods\n get: function () {\n return this.constructor;\n },\n enumerable: true,\n configurable: true\n });\n ShadowBlot.create = function (value) {\n if (this.tagName == null) {\n throw new Registry.ParchmentError('Blot definition missing tagName');\n }\n var node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value).toString() === value) {\n value = parseInt(value);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n }\n else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n }\n else {\n node = document.createElement(this.tagName[0]);\n }\n }\n else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n };\n ShadowBlot.prototype.attach = function () {\n this.domNode[Registry.DATA_KEY] = { blot: this };\n };\n ShadowBlot.prototype.clone = function () {\n var domNode = this.domNode.cloneNode();\n return Registry.create(domNode);\n };\n ShadowBlot.prototype.detach = function () {\n if (this.parent != null)\n this.parent.removeChild(this);\n delete this.domNode[Registry.DATA_KEY];\n };\n ShadowBlot.prototype.deleteAt = function (index, length) {\n var blot = this.isolate(index, length);\n blot.remove();\n };\n ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n var blot = this.isolate(index, length);\n if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n }\n else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n var parent_1 = Registry.create(this.statics.scope);\n blot.wrap(parent_1);\n parent_1.format(name, value);\n }\n };\n ShadowBlot.prototype.insertAt = function (index, value, def) {\n var blot = (def == null) ? Registry.create('text', value) : Registry.create(value, def);\n var ref = this.split(index);\n this.parent.insertBefore(blot, ref);\n };\n ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n if (this.parent != null) {\n this.parent.children.remove(this);\n }\n parentBlot.children.insertBefore(this, refBlot);\n if (refBlot != null) {\n var refDomNode = refBlot.domNode;\n }\n if (this.next == null || this.domNode.nextSibling != refDomNode) {\n parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n }\n this.parent = parentBlot;\n };\n ShadowBlot.prototype.isolate = function (index, length) {\n var target = this.split(index);\n target.split(length);\n return target;\n };\n ShadowBlot.prototype.length = function () {\n return 1;\n };\n ;\n ShadowBlot.prototype.offset = function (root) {\n if (root === void 0) { root = this.parent; }\n if (this.parent == null || this == root)\n return 0;\n return this.parent.children.offset(this) + this.parent.offset(root);\n };\n ShadowBlot.prototype.optimize = function () {\n // TODO clean up once we use WeakMap\n if (this.domNode[Registry.DATA_KEY] != null) {\n delete this.domNode[Registry.DATA_KEY].mutations;\n }\n };\n ShadowBlot.prototype.remove = function () {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n };\n ShadowBlot.prototype.replace = function (target) {\n if (target.parent == null)\n return;\n target.parent.insertBefore(this, target.next);\n target.remove();\n };\n ShadowBlot.prototype.replaceWith = function (name, value) {\n var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n replacement.replace(this);\n return replacement;\n };\n ShadowBlot.prototype.split = function (index, force) {\n return index === 0 ? this : this.next;\n };\n ShadowBlot.prototype.update = function (mutations) {\n if (mutations === void 0) { mutations = []; }\n // Nothing to do by default\n };\n ShadowBlot.prototype.wrap = function (name, value) {\n var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next);\n }\n wrapper.appendChild(this);\n return wrapper;\n };\n ShadowBlot.blotName = 'abstract';\n return ShadowBlot;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = ShadowBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/abstract/shadow.ts\n// module id = 5\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar ParchmentError = (function (_super) {\n __extends(ParchmentError, _super);\n function ParchmentError(message) {\n message = '[Parchment] ' + message;\n _super.call(this, message);\n this.message = message;\n this.name = this.constructor.name;\n }\n return ParchmentError;\n}(Error));\nexports.ParchmentError = ParchmentError;\nvar attributes = {};\nvar classes = {};\nvar tags = {};\nvar types = {};\nexports.DATA_KEY = '__blot';\n(function (Scope) {\n Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n})(exports.Scope || (exports.Scope = {}));\nvar Scope = exports.Scope;\n;\nfunction create(input, value) {\n var match = query(input);\n if (match == null) {\n throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n }\n var BlotClass = match;\n var node = input instanceof Node ? input : BlotClass.create(value);\n return new BlotClass(node, value);\n}\nexports.create = create;\nfunction find(node, bubble) {\n if (bubble === void 0) { bubble = false; }\n if (node == null)\n return null;\n if (node[exports.DATA_KEY] != null)\n return node[exports.DATA_KEY].blot;\n if (bubble)\n return find(node.parentNode, bubble);\n return null;\n}\nexports.find = find;\nfunction query(query, scope) {\n if (scope === void 0) { scope = Scope.ANY; }\n var match;\n if (typeof query === 'string') {\n match = types[query] || attributes[query];\n }\n else if (query instanceof Text) {\n match = types['text'];\n }\n else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = types['block'];\n }\n else if (query & Scope.LEVEL & Scope.INLINE) {\n match = types['inline'];\n }\n }\n else if (query instanceof HTMLElement) {\n var names = (query.getAttribute('class') || '').split(/\\s+/);\n for (var i in names) {\n match = classes[names[i]];\n if (match)\n break;\n }\n match = match || tags[query.tagName];\n }\n if (match == null) {\n if (query instanceof Node) {\n console.log(query.nodeType);\n }\n }\n if (match == null)\n return null;\n if ((scope & Scope.LEVEL & match.scope) && (scope & Scope.TYPE & match.scope))\n return match;\n return null;\n}\nexports.query = query;\nfunction register() {\n var Definitions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n Definitions[_i - 0] = arguments[_i];\n }\n if (Definitions.length > 1) {\n return Definitions.map(function (d) {\n return register(d);\n });\n }\n var Definition = Definitions[0];\n if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n throw new ParchmentError('Invalid definition');\n }\n else if (Definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n types[Definition.blotName || Definition.attrName] = Definition;\n if (typeof Definition.keyName === 'string') {\n attributes[Definition.keyName] = Definition;\n }\n else {\n if (Definition.className != null) {\n classes[Definition.className] = Definition;\n }\n if (Definition.tagName != null) {\n if (Array.isArray(Definition.tagName)) {\n Definition.tagName = Definition.tagName.map(function (tagName) {\n return tagName.toUpperCase();\n });\n }\n else {\n Definition.tagName = Definition.tagName.toUpperCase();\n }\n var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n tagNames.forEach(function (tag) {\n if (tags[tag] == null || Definition.className == null) {\n tags[tag] = Definition;\n }\n });\n }\n }\n return Definition;\n}\nexports.register = register;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/registry.ts\n// module id = 6\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar attributor_1 = require('../../attributor/attributor');\nvar store_1 = require('../../attributor/store');\nvar container_1 = require('./container');\nvar Registry = require('../../registry');\nvar FormatBlot = (function (_super) {\n __extends(FormatBlot, _super);\n function FormatBlot() {\n _super.apply(this, arguments);\n }\n FormatBlot.formats = function (domNode) {\n if (typeof this.tagName === 'string') {\n return true;\n }\n else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n };\n FormatBlot.prototype.attach = function () {\n _super.prototype.attach.call(this);\n this.attributes = new store_1.default(this.domNode);\n };\n FormatBlot.prototype.format = function (name, value) {\n var format = Registry.query(name);\n if (format instanceof attributor_1.default) {\n this.attributes.attribute(format, value);\n }\n else if (value) {\n if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n this.replaceWith(name, value);\n }\n }\n };\n FormatBlot.prototype.formats = function () {\n var formats = this.attributes.values();\n var format = this.statics.formats(this.domNode);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n };\n FormatBlot.prototype.replaceWith = function (name, value) {\n var replacement = _super.prototype.replaceWith.call(this, name, value);\n this.attributes.copy(replacement);\n return replacement;\n };\n FormatBlot.prototype.update = function (mutations) {\n var _this = this;\n _super.prototype.update.call(this, mutations);\n if (mutations.some(function (mutation) {\n return mutation.target === _this.domNode && mutation.type === 'attributes';\n })) {\n this.attributes.build();\n }\n };\n FormatBlot.prototype.wrap = function (name, value) {\n var wrapper = _super.prototype.wrap.call(this, name, value);\n if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n };\n return FormatBlot;\n}(container_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = FormatBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/abstract/format.ts\n// module id = 7\n// module chunks = 0","\"use strict\";\nvar Registry = require('../registry');\nvar Attributor = (function () {\n function Attributor(attrName, keyName, options) {\n if (options === void 0) { options = {}; }\n this.attrName = attrName;\n this.keyName = keyName;\n var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n if (options.scope != null) {\n // Ignore type bits, force attribute bit\n this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n }\n else {\n this.scope = Registry.Scope.ATTRIBUTE;\n }\n if (options.whitelist != null)\n this.whitelist = options.whitelist;\n }\n Attributor.keys = function (node) {\n return [].map.call(node.attributes, function (item) {\n return item.name;\n });\n };\n Attributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.setAttribute(this.keyName, value);\n return true;\n };\n Attributor.prototype.canAdd = function (node, value) {\n var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n if (match != null && (this.whitelist == null || this.whitelist.indexOf(value) > -1)) {\n return true;\n }\n return false;\n };\n Attributor.prototype.remove = function (node) {\n node.removeAttribute(this.keyName);\n };\n Attributor.prototype.value = function (node) {\n return node.getAttribute(this.keyName);\n };\n return Attributor;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Attributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/attributor/attributor.ts\n// module id = 8\n// module chunks = 0","\"use strict\";\nvar attributor_1 = require('./attributor');\nvar class_1 = require('./class');\nvar style_1 = require('./style');\nvar Registry = require('../registry');\nvar AttributorStore = (function () {\n function AttributorStore(domNode) {\n this.attributes = {};\n this.domNode = domNode;\n this.build();\n }\n AttributorStore.prototype.attribute = function (attribute, value) {\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n }\n else {\n delete this.attributes[attribute.attrName];\n }\n }\n }\n else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n };\n AttributorStore.prototype.build = function () {\n var _this = this;\n this.attributes = {};\n var attributes = attributor_1.default.keys(this.domNode);\n var classes = class_1.default.keys(this.domNode);\n var styles = style_1.default.keys(this.domNode);\n attributes.concat(classes).concat(styles).forEach(function (name) {\n var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n if (attr instanceof attributor_1.default) {\n _this.attributes[attr.attrName] = attr;\n }\n });\n };\n AttributorStore.prototype.copy = function (target) {\n var _this = this;\n Object.keys(this.attributes).forEach(function (key) {\n var value = _this.attributes[key].value(_this.domNode);\n target.format(key, value);\n });\n };\n AttributorStore.prototype.move = function (target) {\n var _this = this;\n this.copy(target);\n Object.keys(this.attributes).forEach(function (key) {\n _this.attributes[key].remove(_this.domNode);\n });\n this.attributes = {};\n };\n AttributorStore.prototype.values = function () {\n var _this = this;\n return Object.keys(this.attributes).reduce(function (attributes, name) {\n attributes[name] = _this.attributes[name].value(_this.domNode);\n return attributes;\n }, {});\n };\n return AttributorStore;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = AttributorStore;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/attributor/store.ts\n// module id = 9\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar attributor_1 = require('./attributor');\nfunction match(node, prefix) {\n var className = node.getAttribute('class') || '';\n return className.split(/\\s+/).filter(function (name) {\n return name.indexOf(prefix + \"-\") === 0;\n });\n}\nvar ClassAttributor = (function (_super) {\n __extends(ClassAttributor, _super);\n function ClassAttributor() {\n _super.apply(this, arguments);\n }\n ClassAttributor.keys = function (node) {\n return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n return name.split('-').slice(0, -1).join('-');\n });\n };\n ClassAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n this.remove(node);\n node.classList.add(this.keyName + \"-\" + value);\n return true;\n };\n ClassAttributor.prototype.remove = function (node) {\n var matches = match(node, this.keyName);\n matches.forEach(function (name) {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n };\n ClassAttributor.prototype.value = function (node) {\n var result = match(node, this.keyName)[0] || '';\n return result.slice(this.keyName.length + 1); // +1 for hyphen\n };\n return ClassAttributor;\n}(attributor_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = ClassAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/attributor/class.ts\n// module id = 10\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar attributor_1 = require('./attributor');\nfunction camelize(name) {\n var parts = name.split('-');\n var rest = parts.slice(1).map(function (part) {\n return part[0].toUpperCase() + part.slice(1);\n }).join('');\n return parts[0] + rest;\n}\nvar StyleAttributor = (function (_super) {\n __extends(StyleAttributor, _super);\n function StyleAttributor() {\n _super.apply(this, arguments);\n }\n StyleAttributor.keys = function (node) {\n return (node.getAttribute('style') || '').split(';').map(function (value) {\n var arr = value.split(':');\n return arr[0].trim();\n });\n };\n StyleAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.style[camelize(this.keyName)] = value;\n return true;\n };\n StyleAttributor.prototype.remove = function (node) {\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n };\n StyleAttributor.prototype.value = function (node) {\n return node.style[camelize(this.keyName)];\n };\n return StyleAttributor;\n}(attributor_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = StyleAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/attributor/style.ts\n// module id = 11\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar shadow_1 = require('./shadow');\nvar Registry = require('../../registry');\nvar LeafBlot = (function (_super) {\n __extends(LeafBlot, _super);\n function LeafBlot() {\n _super.apply(this, arguments);\n }\n LeafBlot.value = function (domNode) {\n return true;\n };\n LeafBlot.prototype.index = function (node, offset) {\n if (node !== this.domNode)\n return -1;\n return Math.min(offset, 1);\n };\n LeafBlot.prototype.position = function (index, inclusive) {\n var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n if (index > 0)\n offset += 1;\n return [this.parent.domNode, offset];\n };\n LeafBlot.prototype.value = function () {\n return (_a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a);\n var _a;\n };\n LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n return LeafBlot;\n}(shadow_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = LeafBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/abstract/leaf.ts\n// module id = 12\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar container_1 = require('./abstract/container');\nvar Registry = require('../registry');\nvar OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true\n};\nvar MAX_OPTIMIZE_ITERATIONS = 100;\nvar ScrollBlot = (function (_super) {\n __extends(ScrollBlot, _super);\n function ScrollBlot(node) {\n var _this = this;\n _super.call(this, node);\n this.parent = null;\n this.observer = new MutationObserver(function (mutations) {\n _this.update(mutations);\n });\n this.observer.observe(this.domNode, OBSERVER_CONFIG);\n }\n ScrollBlot.prototype.detach = function () {\n _super.prototype.detach.call(this);\n this.observer.disconnect();\n };\n ScrollBlot.prototype.deleteAt = function (index, length) {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(function (child) {\n child.remove();\n });\n }\n else {\n _super.prototype.deleteAt.call(this, index, length);\n }\n };\n ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n this.update();\n _super.prototype.formatAt.call(this, index, length, name, value);\n };\n ScrollBlot.prototype.insertAt = function (index, value, def) {\n this.update();\n _super.prototype.insertAt.call(this, index, value, def);\n };\n ScrollBlot.prototype.optimize = function (mutations) {\n var _this = this;\n if (mutations === void 0) { mutations = []; }\n _super.prototype.optimize.call(this);\n mutations.push.apply(mutations, this.observer.takeRecords());\n // TODO use WeakMap\n var mark = function (blot, markParent) {\n if (markParent === void 0) { markParent = true; }\n if (blot == null || blot === _this)\n return;\n if (blot.domNode.parentNode == null)\n return;\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n blot.domNode[Registry.DATA_KEY].mutations = [];\n }\n if (markParent)\n mark(blot.parent);\n };\n var optimize = function (blot) {\n if (blot.domNode[Registry.DATA_KEY] == null || blot.domNode[Registry.DATA_KEY].mutations == null) {\n return;\n }\n if (blot instanceof container_1.default) {\n blot.children.forEach(optimize);\n }\n blot.optimize();\n };\n var remaining = mutations;\n for (var i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(Registry.find(mutation.previousSibling, false));\n [].forEach.call(mutation.addedNodes, function (node) {\n var child = Registry.find(node, false);\n mark(child, false);\n if (child instanceof container_1.default) {\n child.children.forEach(function (grandChild) {\n mark(grandChild, false);\n });\n }\n });\n }\n else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = this.observer.takeRecords();\n mutations.push.apply(mutations, remaining);\n }\n };\n ScrollBlot.prototype.update = function (mutations) {\n var _this = this;\n mutations = mutations || this.observer.takeRecords();\n // TODO use WeakMap\n mutations.map(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n return blot;\n }\n else {\n blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n return null;\n }\n }).forEach(function (blot) {\n if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null)\n return;\n blot.update(blot.domNode[Registry.DATA_KEY].mutations || []);\n });\n if (this.domNode[Registry.DATA_KEY].mutations != null) {\n _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations);\n }\n this.optimize(mutations);\n };\n ScrollBlot.blotName = 'scroll';\n ScrollBlot.defaultChild = 'block';\n ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n ScrollBlot.tagName = 'DIV';\n return ScrollBlot;\n}(container_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = ScrollBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/scroll.ts\n// module id = 13\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar format_1 = require('./abstract/format');\nvar Registry = require('../registry');\n// Shallow object comparison\nfunction isEqual(obj1, obj2) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length)\n return false;\n for (var prop in obj1) {\n if (obj1[prop] !== obj2[prop])\n return false;\n }\n return true;\n}\nvar InlineBlot = (function (_super) {\n __extends(InlineBlot, _super);\n function InlineBlot() {\n _super.apply(this, arguments);\n }\n InlineBlot.formats = function (domNode) {\n if (domNode.tagName === InlineBlot.tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n InlineBlot.prototype.format = function (name, value) {\n var _this = this;\n if (name === this.statics.blotName && !value) {\n this.children.forEach(function (child) {\n if (!(child instanceof format_1.default)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n _this.attributes.copy(child);\n });\n this.unwrap();\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n InlineBlot.prototype.formatAt = function (index, length, name, value) {\n if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n var blot = this.isolate(index, length);\n blot.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n InlineBlot.prototype.optimize = function () {\n _super.prototype.optimize.call(this);\n var formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n var next = this.next;\n if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n next.moveChildren(this);\n next.remove();\n }\n };\n InlineBlot.blotName = 'inline';\n InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n InlineBlot.tagName = 'SPAN';\n return InlineBlot;\n}(format_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = InlineBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/inline.ts\n// module id = 14\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar format_1 = require('./abstract/format');\nvar Registry = require('../registry');\nvar BlockBlot = (function (_super) {\n __extends(BlockBlot, _super);\n function BlockBlot() {\n _super.apply(this, arguments);\n }\n BlockBlot.formats = function (domNode) {\n var tagName = Registry.query(BlockBlot.blotName).tagName;\n if (domNode.tagName === tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n BlockBlot.prototype.format = function (name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n return;\n }\n else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n BlockBlot.prototype.formatAt = function (index, length, name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n BlockBlot.prototype.insertAt = function (index, value, def) {\n if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n // Insert text or inline\n _super.prototype.insertAt.call(this, index, value, def);\n }\n else {\n var after = this.split(index);\n var blot = Registry.create(value, def);\n after.parent.insertBefore(blot, after);\n }\n };\n BlockBlot.blotName = 'block';\n BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n BlockBlot.tagName = 'P';\n return BlockBlot;\n}(format_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = BlockBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/block.ts\n// module id = 15\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar leaf_1 = require('./abstract/leaf');\nvar EmbedBlot = (function (_super) {\n __extends(EmbedBlot, _super);\n function EmbedBlot() {\n _super.apply(this, arguments);\n }\n EmbedBlot.formats = function (domNode) {\n return undefined;\n };\n EmbedBlot.prototype.format = function (name, value) {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n };\n EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n EmbedBlot.prototype.formats = function () {\n return this.statics.formats(this.domNode);\n };\n return EmbedBlot;\n}(leaf_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = EmbedBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/embed.ts\n// module id = 16\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar leaf_1 = require('./abstract/leaf');\nvar Registry = require('../registry');\nvar TextBlot = (function (_super) {\n __extends(TextBlot, _super);\n function TextBlot(node) {\n _super.call(this, node);\n this.text = this.statics.value(this.domNode);\n }\n TextBlot.create = function (value) {\n return document.createTextNode(value);\n };\n TextBlot.value = function (domNode) {\n return domNode.data;\n };\n TextBlot.prototype.deleteAt = function (index, length) {\n this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n };\n TextBlot.prototype.index = function (node, offset) {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n };\n TextBlot.prototype.insertAt = function (index, value, def) {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n }\n else {\n _super.prototype.insertAt.call(this, index, value, def);\n }\n };\n TextBlot.prototype.length = function () {\n return this.text.length;\n };\n TextBlot.prototype.optimize = function () {\n _super.prototype.optimize.call(this);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n }\n else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), this.next.value());\n this.next.remove();\n }\n };\n TextBlot.prototype.position = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return [this.domNode, index];\n };\n TextBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = Registry.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next);\n this.text = this.statics.value(this.domNode);\n return after;\n };\n TextBlot.prototype.update = function (mutations) {\n var _this = this;\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this.domNode;\n })) {\n this.text = this.statics.value(this.domNode);\n }\n };\n TextBlot.prototype.value = function () {\n return this.text;\n };\n TextBlot.blotName = 'text';\n TextBlot.scope = Registry.Scope.INLINE_BLOT;\n return TextBlot;\n}(leaf_1.default));\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = TextBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/text.ts\n// module id = 17\n// module chunks = 0","import './polyfill';\nimport Delta from 'quill-delta';\nimport Editor from './editor';\nimport Emitter from './emitter';\nimport Module from './module';\nimport Parchment from 'parchment';\nimport Selection, { Range } from './selection';\nimport extend from 'extend';\nimport logger from './logger';\nimport Theme from './theme';\n\nlet debug = logger('quill');\n\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(path, target, overwrite = false) {\n if (typeof path !== 'string') {\n let name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register('formats/' + name, path, target);\n } else {\n Object.keys(path).forEach((key) => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if ((path.startsWith('blots/') || path.startsWith('formats/')) &&\n target.blotName !== 'abstract') {\n Parchment.register(target);\n }\n }\n }\n\n constructor(container, options = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n let html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.emitter = new Emitter();\n this.scroll = Parchment.create(this.root, {\n emitter: this.emitter,\n whitelist: this.options.formats\n });\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options);\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n let range = this.selection.lastRange;\n let index = range && range.length === 0 ? range.index : undefined;\n modify.call(this, () => {\n return this.editor.update(null, mutations, index);\n }, source);\n });\n let contents = this.clipboard.convert(`
    ${html}


    `);\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n }\n\n addContainer(container, refNode = null) {\n if (typeof container === 'string') {\n let className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1*length);\n }\n\n disable() {\n this.enable(false);\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n if (!enabled) {\n this.blur();\n }\n }\n\n focus() {\n this.selection.focus();\n this.selection.scrollIntoView();\n }\n\n format(name, value, source = Emitter.sources.API) {\n return modify.call(this, () => {\n let range = this.getSelection(true);\n let change = new Delta();\n if (range == null) {\n return change;\n } else if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, { [name]: value });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, { [name]: value });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index, length = 0) {\n if (typeof index === 'number') {\n return this.selection.getBounds(index, length);\n } else {\n return this.selection.getBounds(index.index, index.length);\n }\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index = this.getSelection(), length = 0) {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n } else {\n return this.editor.getFormat(index.index, index.length);\n }\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection(focus = false) {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getText(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value, source = Quill.sources.API) {\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats;\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return !this.container.classList.contains('ql-disabled');\n }\n\n off() {\n return this.emitter.off.apply(this.emitter, arguments);\n }\n\n on() {\n return this.emitter.on.apply(this.emitter, arguments);\n }\n\n once() {\n return this.emitter.once.apply(this.emitter, arguments);\n }\n\n pasteHTML(index, html, source) {\n this.clipboard.dangerouslyPasteHTML(index, html, source);\n }\n\n removeFormat(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n setContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n let length = this.getLength();\n let deleted = this.editor.deleteText(0, length);\n let applied = this.editor.applyDelta(delta);\n let lastOp = applied.ops[applied.ops.length - 1];\n if (lastOp != null && typeof(lastOp.insert) === 'string' && lastOp.insert[lastOp.insert.length-1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n let ret = deleted.compose(applied);\n return ret;\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(index, length), source);\n }\n this.selection.scrollIntoView();\n }\n\n setText(text, source = Emitter.sources.API) {\n let delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source = Emitter.sources.USER) {\n let change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n return change;\n }\n\n updateContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n}\nQuill.DEFAULTS = {\n bounds: null,\n formats: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n strict: true,\n theme: 'default'\n};\nQuill.events = Emitter.events;\nQuill.sources = Emitter.sources;\n// eslint-disable-next-line no-undef\nQuill.version = typeof(QUILL_VERSION) === 'undefined' ? 'dev' : QUILL_VERSION;\n\nQuill.imports = {\n 'delta' : Delta,\n 'parchment' : Parchment,\n 'core/module' : Module,\n 'core/theme' : Theme\n};\n\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend(true, {\n container: container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true\n }\n }, userConfig);\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = Theme;\n } else {\n userConfig.theme = Quill.import(`themes/${userConfig.theme}`);\n if (userConfig.theme == null) {\n throw new Error(`Invalid theme ${userConfig.theme}. Did you register it?`);\n }\n }\n let themeConfig = extend(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(function(config) {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(function(module) {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n let moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n let moduleConfig = moduleNames.reduce(function(config, name) {\n let moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(`Cannot load ${name} module. Are you sure you registered it?`);\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (userConfig.modules != null && userConfig.modules.toolbar &&\n userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n userConfig = extend(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n ['bounds', 'container'].forEach(function(key) {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(function(config, name) {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n }, {});\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (!this.options.strict && !this.isEnabled() && source === Emitter.sources.USER) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n let oldDelta = this.editor.delta;\n let change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n let args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value, value = name, name = length, length = index.length, index = index.index;\n } else {\n length = index.length, index = index.index;\n }\n } else if (typeof length !== 'number') {\n source = value, value = name, name = length, length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start, end;\n if (index instanceof Delta) {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n return index.transformPosition(pos, source === Emitter.sources.USER);\n });\n } else {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n if (pos < index || (pos === index && source !== Emitter.sources.USER)) return pos;\n if (length >= 0) {\n return pos + length;\n } else {\n return Math.max(index, pos + length);\n }\n });\n }\n return new Range(start, end - start);\n}\n\n\nexport { expandConfig, overload, Quill as default };\n\n\n\n// WEBPACK FOOTER //\n// ./core/quill.js","let elem = document.createElement('div');\nelem.classList.toggle('test-class', false);\nif (elem.classList.contains('test-class')) {\n let _toggle = DOMTokenList.prototype.toggle;\n DOMTokenList.prototype.toggle = function(token, force) {\n if (arguments.length > 1 && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n}\n\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function(searchString, position){\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function(searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n}\n\nif (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, \"find\", {\n value: function(predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n }\n });\n}\n\n// Disable resizing in Firefox\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n document.execCommand(\"enableObjectResizing\", false, false);\n});\n\n\n\n// WEBPACK FOOTER //\n// ./core/polyfill.js","var diff = require('fast-diff');\nvar equal = require('deep-equal');\nvar extend = require('extend');\nvar op = require('./op');\n\n\nvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\n\nvar Delta = function (ops) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n};\n\n\nDelta.prototype.insert = function (text, attributes) {\n var newOp = {};\n if (text.length === 0) return this;\n newOp.insert = text;\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype['delete'] = function (length) {\n if (length <= 0) return this;\n return this.push({ 'delete': length });\n};\n\nDelta.prototype.retain = function (length, attributes) {\n if (length <= 0) return this;\n var newOp = { retain: length };\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype.push = function (newOp) {\n var index = this.ops.length;\n var lastOp = this.ops[index - 1];\n newOp = extend(true, {}, newOp);\n if (typeof lastOp === 'object') {\n if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {\n this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (equal(newOp.attributes, lastOp.attributes)) {\n if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n};\n\nDelta.prototype.filter = function (predicate) {\n return this.ops.filter(predicate);\n};\n\nDelta.prototype.forEach = function (predicate) {\n this.ops.forEach(predicate);\n};\n\nDelta.prototype.map = function (predicate) {\n return this.ops.map(predicate);\n};\n\nDelta.prototype.partition = function (predicate) {\n var passed = [], failed = [];\n this.forEach(function(op) {\n var target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n};\n\nDelta.prototype.reduce = function (predicate, initial) {\n return this.ops.reduce(predicate, initial);\n};\n\nDelta.prototype.chop = function () {\n var lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n};\n\nDelta.prototype.length = function () {\n return this.reduce(function (length, elem) {\n return length + op.length(elem);\n }, 0);\n};\n\nDelta.prototype.slice = function (start, end) {\n start = start || 0;\n if (typeof end !== 'number') end = Infinity;\n var ops = [];\n var iter = op.iterator(this.ops);\n var index = 0;\n while (index < end && iter.hasNext()) {\n var nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += op.length(nextOp);\n }\n return new Delta(ops);\n};\n\n\nDelta.prototype.compose = function (other) {\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (typeof otherOp.retain === 'number') {\n var newOp = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length;\n } else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n if (attributes) newOp.attributes = attributes;\n delta.push(newOp);\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.concat = function (other) {\n var delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n};\n\nDelta.prototype.diff = function (other, index) {\n if (this.ops === other.ops) {\n return new Delta();\n }\n var strings = [this, other].map(function (delta) {\n return delta.map(function (op) {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n var prep = (delta === other) ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n }).join('');\n });\n var delta = new Delta();\n var diffResult = diff(strings[0], strings[1], index);\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n diffResult.forEach(function (component) {\n var length = component[1].length;\n while (length > 0) {\n var opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n delta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n delta['delete'](opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n var thisOp = thisIter.next(opLength);\n var otherOp = otherIter.next(opLength);\n if (equal(thisOp.insert, otherOp.insert)) {\n delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));\n } else {\n delta.push(otherOp)['delete'](opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return delta.chop();\n};\n\nDelta.prototype.eachLine = function (predicate, newline) {\n newline = newline || '\\n';\n var iter = op.iterator(this.ops);\n var line = new Delta();\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') return;\n var thisOp = iter.peek();\n var start = op.length(thisOp) - iter.peekLength();\n var index = typeof thisOp.insert === 'string' ?\n thisOp.insert.indexOf(newline, start) - start : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n predicate(line, iter.next(1).attributes || {});\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {});\n }\n};\n\nDelta.prototype.transform = function (other, priority) {\n priority = !!priority;\n if (typeof other === 'number') {\n return this.transformPosition(other, priority);\n }\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {\n delta.retain(op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (thisOp['delete']) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp['delete']) {\n delta.push(otherOp);\n } else {\n // We retain either their retain or insert\n delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.transformPosition = function (index, priority) {\n priority = !!priority;\n var thisIter = op.iterator(this.ops);\n var offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n var length = thisIter.peekLength();\n var nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n};\n\n\nmodule.exports = Delta;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/lib/delta.js\n// module id = 20\n// module chunks = 0","/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int} cursor_pos Expected edit position in text1 (optional)\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos) {\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n // Check cursor_pos within bounds\n if (cursor_pos < 0 || text1.length < cursor_pos) {\n cursor_pos = null;\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs);\n if (cursor_pos != null) {\n diffs = fix_cursor(diffs, cursor_pos);\n }\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [[DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n */\nfunction diff_cleanupMerge(diffs) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL,\n text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n if (count_delete === 0) {\n diffs.splice(pointer - count_insert,\n count_delete + count_insert, [DIFF_INSERT, text_insert]);\n } else if (count_insert === 0) {\n diffs.splice(pointer - count_delete,\n count_delete + count_insert, [DIFF_DELETE, text_delete]);\n } else {\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert, [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]);\n }\n pointer = pointer - count_delete - count_insert +\n (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n};\n\n\nvar diff = diff_main;\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n\n/*\n * Modify a diff such that the cursor position points to the start of a change:\n * E.g.\n * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)\n * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]\n * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)\n * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} A tuple [cursor location in the modified diff, modified diff]\n */\nfunction cursor_normalize_diff (diffs, cursor_pos) {\n if (cursor_pos === 0) {\n return [DIFF_EQUAL, diffs];\n }\n for (var current_pos = 0, i = 0; i < diffs.length; i++) {\n var d = diffs[i];\n if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {\n var next_pos = current_pos + d[1].length;\n if (cursor_pos === next_pos) {\n return [i + 1, diffs];\n } else if (cursor_pos < next_pos) {\n // copy to prevent side effects\n diffs = diffs.slice();\n // split d into two diff changes\n var split_pos = cursor_pos - current_pos;\n var d_left = [d[0], d[1].slice(0, split_pos)];\n var d_right = [d[0], d[1].slice(split_pos)];\n diffs.splice(i, 1, d_left, d_right);\n return [i + 1, diffs];\n } else {\n current_pos = next_pos;\n }\n }\n }\n throw new Error('cursor_pos is out of bounds!')\n}\n\n/*\n * Modify a diff such that the edit position is \"shifted\" to the proposed edit location (cursor_position).\n *\n * Case 1)\n * Check if a naive shift is possible:\n * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)\n * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result\n * Case 2)\n * Check if the following shifts are possible:\n * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']\n * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']\n * ^ ^\n * d d_next\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} Array of diff tuples\n */\nfunction fix_cursor (diffs, cursor_pos) {\n var norm = cursor_normalize_diff(diffs, cursor_pos);\n var ndiffs = norm[1];\n var cursor_pointer = norm[0];\n var d = ndiffs[cursor_pointer];\n var d_next = ndiffs[cursor_pointer + 1];\n\n if (d == null) {\n // Text was deleted from end of original string,\n // cursor is now out of bounds in new string\n return diffs;\n } else if (d[0] !== DIFF_EQUAL) {\n // A modification happened at the cursor location.\n // This is the expected outcome, so we can return the original diff.\n return diffs;\n } else {\n if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {\n // Case 1)\n // It is possible to perform a naive shift\n ndiffs.splice(cursor_pointer, 2, d_next, d)\n return merge_tuples(ndiffs, cursor_pointer, 2)\n } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {\n // Case 2)\n // d[1] is a prefix of d_next[1]\n // We can assume that d_next[0] !== 0, since d[0] === 0\n // Shift edit locations..\n ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);\n var suffix = d_next[1].slice(d[1].length);\n if (suffix.length > 0) {\n ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);\n }\n return merge_tuples(ndiffs, cursor_pointer, 3)\n } else {\n // Not possible to perform any modification\n return diffs;\n }\n }\n\n}\n\n/*\n * Try to merge tuples with their neigbors in a given range.\n * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']\n *\n * @param {Array} diffs Array of diff tuples.\n * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).\n * @param {Int} length Number of consecutive elements to check.\n * @return {Array} Array of merged diff tuples.\n */\nfunction merge_tuples (diffs, start, length) {\n // Check from (start-1) to (start+length).\n for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {\n if (i + 1 < diffs.length) {\n var left_d = diffs[i];\n var right_d = diffs[i+1];\n if (left_d[0] === right_d[1]) {\n diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);\n }\n }\n }\n return diffs;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/~/fast-diff/diff.js\n// module id = 21\n// module chunks = 0","exports = module.exports = typeof Object.keys === 'function'\n ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/~/deep-equal/lib/keys.js\n// module id = 23\n// module chunks = 0","var supportsArgumentsClass = (function(){\n return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n return object &&\n typeof object == 'object' &&\n typeof object.length == 'number' &&\n Object.prototype.hasOwnProperty.call(object, 'callee') &&\n !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n false;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/~/deep-equal/lib/is_arguments.js\n// module id = 24\n// module chunks = 0","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[0],\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t} else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = target[name];\n\t\t\t\tcopy = options[name];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\ttarget[name] = extend(deep, clone, copy);\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/~/extend/index.js\n// module id = 25\n// module chunks = 0","var equal = require('deep-equal');\nvar extend = require('extend');\n\n\nvar lib = {\n attributes: {\n compose: function (a, b, keepNull) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = extend(true, {}, b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce(function (copy, key) {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (var key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n diff: function(a, b) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {\n if (!equal(a[key], b[key])) {\n attributes[key] = b[key] === undefined ? null : b[key];\n }\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n transform: function (a, b, priority) {\n if (typeof a !== 'object') return b;\n if (typeof b !== 'object') return undefined;\n if (!priority) return b; // b simply overwrites us without priority\n var attributes = Object.keys(b).reduce(function (attributes, key) {\n if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n },\n\n iterator: function (ops) {\n return new Iterator(ops);\n },\n\n length: function (op) {\n if (typeof op['delete'] === 'number') {\n return op['delete'];\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n};\n\n\nfunction Iterator(ops) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n};\n\nIterator.prototype.hasNext = function () {\n return this.peekLength() < Infinity;\n};\n\nIterator.prototype.next = function (length) {\n if (!length) length = Infinity;\n var nextOp = this.ops[this.index];\n if (nextOp) {\n var offset = this.offset;\n var opLength = lib.length(nextOp)\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp['delete'] === 'number') {\n return { 'delete': length };\n } else {\n var retOp = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n};\n\nIterator.prototype.peek = function () {\n return this.ops[this.index];\n};\n\nIterator.prototype.peekLength = function () {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return lib.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n};\n\nIterator.prototype.peekType = function () {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index]['delete'] === 'number') {\n return 'delete';\n } else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n};\n\n\nmodule.exports = lib;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/lib/op.js\n// module id = 26\n// module chunks = 0","import Delta from 'quill-delta';\nimport DeltaOp from 'quill-delta/lib/op';\nimport Parchment from 'parchment';\nimport CodeBlock from '../formats/code';\nimport CursorBlot from '../blots/cursor';\nimport Block, { bubbleFormats } from '../blots/block';\nimport clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\n\n\nclass Editor {\n constructor(scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta) {\n let consumeNextNewline = false;\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batch = true;\n delta = normalizeDelta(delta);\n delta.reduce((index, op) => {\n let length = op.retain || op.delete || op.insert.length || 1;\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n let text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (index >= scrollLength && !text.endsWith('\\n')) {\n consumeNextNewline = true;\n }\n this.scroll.insertAt(index, text);\n let [line, offset] = this.scroll.line(index);\n let formats = extend({}, bubbleFormats(line));\n if (line instanceof Block) {\n let [leaf, ] = line.descendant(Parchment.Leaf, offset);\n formats = extend(formats, bubbleFormats(leaf));\n }\n attributes = DeltaOp.attributes.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n let key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach((name) => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n delta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batch = false;\n this.scroll.optimize();\n return this.update(delta);\n }\n\n deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(index, length, formats = {}) {\n this.scroll.update();\n Object.keys(formats).forEach((format) => {\n let lines = this.scroll.lines(index, Math.max(length, 1));\n let lengthRemaining = length;\n lines.forEach((line) => {\n let lineLength = line.length();\n if (!(line instanceof CodeBlock)) {\n line.format(format, formats[format]);\n } else {\n let codeIndex = index - line.offset(this.scroll);\n let codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n line.formatAt(codeIndex, codeLength, format, formats[format]);\n }\n lengthRemaining -= lineLength;\n });\n });\n this.scroll.optimize();\n return this.update(new Delta().retain(index).retain(length, clone(formats)));\n }\n\n formatText(index, length, formats = {}) {\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).retain(length, clone(formats)));\n }\n\n getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n\n getDelta() {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index, length = 0) {\n let lines = [], leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(function(path) {\n let [blot, ] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof Parchment.Leaf) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(Parchment.Leaf, index, length);\n }\n let formatsArr = [lines, leaves].map(function(blots) {\n if (blots.length === 0) return {};\n let formats = bubbleFormats(blots.shift());\n while (Object.keys(formats).length > 0) {\n let blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return extend.apply(extend, formatsArr);\n }\n\n getText(index, length) {\n return this.getContents(index, length).filter(function(op) {\n return typeof op.insert === 'string';\n }).map(function(op) {\n return op.insert;\n }).join('');\n }\n\n insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(index, text, formats = {}) {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).insert(text, clone(formats)));\n }\n\n isBlank() {\n if (this.scroll.children.length == 0) return true;\n if (this.scroll.children.length > 1) return false;\n let child = this.scroll.children.head;\n return child.length() <= 1 && Object.keys(child.formats()).length == 0;\n }\n\n removeFormat(index, length) {\n let text = this.getText(index, length);\n let [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0, suffix = new Delta();\n if (line != null) {\n if (!(line instanceof CodeBlock)) {\n suffixLength = line.length() - offset;\n } else {\n suffixLength = line.newlineIndex(offset) - offset + 1;\n }\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n let contents = this.getContents(index, length + suffixLength);\n let diff = contents.diff(new Delta().insert(text).concat(suffix));\n let delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(change, mutations = [], cursorIndex = undefined) {\n let oldDelta = this.delta;\n if (mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n Parchment.find(mutations[0].target)) {\n // Optimization for character changes\n let textBlot = Parchment.find(mutations[0].target);\n let formats = bubbleFormats(textBlot);\n let index = textBlot.offset(this.scroll);\n let oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n let oldText = new Delta().insert(oldValue);\n let newText = new Delta().insert(textBlot.value());\n let diffDelta = new Delta().retain(index).concat(oldText.diff(newText, cursorIndex));\n change = diffDelta.reduce(function(delta, op) {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n } else {\n return delta.push(op);\n }\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !equal(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, cursorIndex);\n }\n }\n return change;\n }\n}\n\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce(function(merged, name) {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce(function(delta, op) {\n if (op.insert === 1) {\n let attributes = clone(op.attributes);\n delete attributes['image'];\n return delta.insert({ image: op.attributes.image }, attributes);\n }\n if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n op = clone(op);\n if (op.attributes.list) {\n op.attributes.list = 'ordered';\n } else {\n op.attributes.list = 'bullet';\n delete op.attributes.bullet;\n }\n }\n if (typeof op.insert === 'string') {\n let text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return delta.insert(text, op.attributes);\n }\n return delta.push(op);\n }, new Delta());\n}\n\n\nexport default Editor;\n\n\n\n// WEBPACK FOOTER //\n// ./core/editor.js","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Inline from '../blots/inline';\nimport TextBlot from '../blots/text';\n\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\n\nclass CodeBlock extends Block {\n static create(value) {\n let domNode = super.create(value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n\n static formats() {\n return true;\n }\n\n delta() {\n let text = this.domNode.textContent;\n if (text.endsWith('\\n')) { // Should always be true\n text = text.slice(0, -1);\n }\n return text.split('\\n').reduce((delta, frag) => {\n return delta.insert(frag).insert('\\n', this.formats());\n }, new Delta());\n }\n\n format(name, value) {\n if (name === this.statics.blotName && value) return;\n let [text, ] = this.descendant(TextBlot, this.length() - 1);\n if (text != null) {\n text.deleteAt(text.length() - 1, 1);\n }\n super.format(name, value);\n }\n\n formatAt(index, length, name, value) {\n if (length === 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK) == null ||\n (name === this.statics.blotName && value === this.statics.formats(this.domNode))) {\n return;\n }\n let nextNewline = this.newlineIndex(index);\n if (nextNewline < 0 || nextNewline >= index + length) return;\n let prevNewline = this.newlineIndex(index, true) + 1;\n let isolateLength = nextNewline - prevNewline + 1;\n let blot = this.isolate(prevNewline, isolateLength);\n let next = blot.next;\n blot.format(name, value);\n if (next instanceof CodeBlock) {\n next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n }\n }\n\n insertAt(index, value, def) {\n if (def != null) return;\n let [text, offset] = this.descendant(TextBlot, index);\n text.insertAt(offset, value);\n }\n\n length() {\n let length = this.domNode.textContent.length;\n if (!this.domNode.textContent.endsWith('\\n')) {\n return length + 1;\n }\n return length;\n }\n\n newlineIndex(searchIndex, reverse = false) {\n if (!reverse) {\n let offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n return offset > -1 ? searchIndex + offset : -1;\n } else {\n return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n }\n }\n\n optimize() {\n if (!this.domNode.textContent.endsWith('\\n')) {\n this.appendChild(Parchment.create('text', '\\n'));\n }\n super.optimize();\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n next.optimize();\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n super.replace(target);\n [].slice.call(this.domNode.querySelectorAll('*')).forEach(function(node) {\n let blot = Parchment.find(node);\n if (blot == null) {\n node.parentNode.removeChild(node);\n } else if (blot instanceof Parchment.Embed) {\n blot.remove();\n } else {\n blot.unwrap();\n }\n });\n }\n}\nCodeBlock.blotName = 'code-block';\nCodeBlock.tagName = 'PRE';\nCodeBlock.TAB = ' ';\n\n\nexport { Code, CodeBlock as default };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/code.js","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Break from './break';\nimport Embed from './embed';\nimport Inline from './inline';\nimport TextBlot from './text';\n\n\nconst NEWLINE_LENGTH = 1;\n\n\nclass BlockEmbed extends Embed {\n attach() {\n super.attach();\n this.attributes = new Parchment.Attributor.Store(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), extend(this.formats(), this.attributes.values()));\n }\n\n format(name, value) {\n let attribute = Parchment.query(name, Parchment.Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index, length, name, value) {\n this.format(name, value);\n }\n\n insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n let block = Parchment.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n super.insertAt(index, value, def);\n }\n }\n}\nBlockEmbed.scope = Parchment.Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\n\nclass Block extends Parchment.Block {\n constructor(domNode) {\n super(domNode);\n this.cache = {};\n }\n\n delta() {\n if (this.cache.delta == null) {\n this.cache.delta = this.descendants(Parchment.Leaf).reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n } else {\n return delta.insert(leaf.value(), bubbleFormats(leaf));\n }\n }, new Delta()).insert('\\n', bubbleFormats(this));\n }\n return this.cache.delta;\n }\n\n deleteAt(index, length) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(index, Math.min(length, this.length() - index - 1), name, value);\n }\n this.cache = {};\n }\n\n insertAt(index, value, def) {\n if (def != null) return super.insertAt(index, value, def);\n if (value.length === 0) return;\n let lines = value.split('\\n');\n let text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n let block = this;\n lines.reduce(function(index, line) {\n block = block.split(index, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot, ref) {\n let head = this.children.head;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target, ref) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize() {\n super.optimize();\n this.cache = {};\n }\n\n path(index) {\n return super.path(index, true);\n }\n\n removeChild(child) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index, force = false) {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n let clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n } else {\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n } else {\n let next = super.split(index, force);\n this.cache = {};\n return next;\n }\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = 'break';\nBlock.allowedChildren = [Inline, Embed, TextBlot];\n\n\nfunction bubbleFormats(blot, formats = {}) {\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = extend(formats, blot.formats());\n }\n if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats);\n}\n\n\nexport { bubbleFormats, BlockEmbed, Block as default };\n\n\n\n// WEBPACK FOOTER //\n// ./blots/block.js","import Embed from './embed';\n\n\nclass Break extends Embed {\n static value() {\n return undefined;\n }\n\n insertInto(parent, ref) {\n if (parent.children.length === 0) {\n super.insertInto(parent, ref);\n } else {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\n\nexport default Break;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/break.js","import Parchment from 'parchment';\n\nclass Embed extends Parchment.Embed { }\n\nexport default Embed;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/embed.js","import Embed from './embed';\nimport Text from './text';\nimport Parchment from 'parchment';\n\n\nclass Inline extends Parchment.Inline {\n static compare(self, other) {\n let selfIndex = Inline.order.indexOf(self);\n let otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n } else if (self === other) {\n return 0;\n } else if (self < other) {\n return -1;\n } else {\n return 1;\n }\n }\n\n formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && Parchment.query(name, Parchment.Scope.BLOT)) {\n let blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize() {\n super.optimize();\n if (this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n let parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\nInline.allowedChildren = [Inline, Embed, Text];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = [\n 'cursor', 'inline', // Must be lower\n 'code', 'underline', 'strike', 'italic', 'bold', 'script',\n 'link' // Must be higher\n];\n\n\nexport default Inline;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/inline.js","import Parchment from 'parchment';\n\nclass TextBlot extends Parchment.Text { }\n\nexport default TextBlot;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/text.js","import Parchment from 'parchment';\nimport Embed from './embed';\nimport TextBlot from './text';\nimport Emitter from '../core/emitter';\n\n\nclass Cursor extends Embed {\n static value() {\n return undefined;\n }\n\n constructor(domNode, selection) {\n super(domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this._length = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name, value) {\n if (this._length !== 0) {\n return super.format(name, value);\n }\n let target = this, index = 0;\n while (target != null && target.statics.scope !== Parchment.Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this._length = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this._length = 0;\n }\n }\n\n index(node, offset) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this._length;\n }\n\n position() {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n this.parent = null;\n }\n\n restore() {\n if (this.selection.composing) return;\n if (this.parent == null) return;\n let textNode = this.textNode;\n let range = this.selection.getNativeRange();\n let restoreText, start, end;\n if (range != null && range.start.node === textNode && range.end.node === textNode) {\n [restoreText, start, end] = [textNode, range.start.offset, range.end.offset];\n }\n // Link format will insert text outside of anchor tag\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n if (this.textNode.data !== Cursor.CONTENTS) {\n let text = this.textNode.data.split(Cursor.CONTENTS).join('');\n if (this.next instanceof TextBlot) {\n restoreText = this.next.domNode;\n this.next.insertAt(0, text);\n this.textNode.data = Cursor.CONTENTS;\n } else {\n this.textNode.data = text;\n this.parent.insertBefore(Parchment.create(this.textNode), this);\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n }\n }\n this.remove();\n if (start == null) return;\n this.selection.emitter.once(Emitter.events.SCROLL_OPTIMIZE, () => {\n [start, end] = [start, end].map(function(offset) {\n return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n });\n this.selection.setNativeRange(restoreText, start, restoreText, end);\n });\n }\n\n update(mutations) {\n mutations.forEach((mutation) => {\n if (mutation.type === 'characterData' && mutation.target === this.textNode) {\n this.restore();\n }\n });\n }\n\n value() {\n return '';\n }\n}\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = \"\\uFEFF\"; // Zero width no break space\n\n\nexport default Cursor;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/cursor.js","import EventEmitter from 'eventemitter3';\nimport logger from './logger';\n\nlet debug = logger('quill:events');\n\n\nclass Emitter extends EventEmitter {\n constructor() {\n super();\n this.on('error', debug.error);\n }\n\n emit() {\n debug.log.apply(debug, arguments);\n super.emit.apply(this, arguments);\n }\n}\n\nEmitter.events = {\n EDITOR_CHANGE : 'editor-change',\n SCROLL_BEFORE_UPDATE : 'scroll-before-update',\n SCROLL_OPTIMIZE : 'scroll-optimize',\n SCROLL_UPDATE : 'scroll-update',\n SELECTION_CHANGE : 'selection-change',\n TEXT_CHANGE : 'text-change'\n};\nEmitter.sources = {\n API : 'api',\n SILENT : 'silent',\n USER : 'user'\n};\n\n\nexport default Emitter;\n\n\n\n// WEBPACK FOOTER //\n// ./core/emitter.js","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/eventemitter3/index.js\n// module id = 37\n// module chunks = 0","let levels = ['error', 'warn', 'log', 'info'];\nlet level = 'warn';\n\nfunction debug(method, ...args) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method].apply(console, args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce(function(logger, method) {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\ndebug.level = namespace.level = function(newLevel) {\n level = newLevel;\n};\n\n\nexport default namespace;\n\n\n\n// WEBPACK FOOTER //\n// ./core/logger.js","var clone = (function() {\n'use strict';\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n*/\nfunction clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (parent instanceof nativeMap) {\n child = new nativeMap();\n } else if (parent instanceof nativeSet) {\n child = new nativeSet();\n } else if (parent instanceof nativePromise) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (parent instanceof nativeMap) {\n var keyIterator = parent.keys();\n while(true) {\n var next = keyIterator.next();\n if (next.done) {\n break;\n }\n var keyChild = _clone(next.value, depth - 1);\n var valueChild = _clone(parent.get(next.value), depth - 1);\n child.set(keyChild, valueChild);\n }\n }\n if (parent instanceof nativeSet) {\n var iterator = parent.keys();\n while(true) {\n var next = iterator.next();\n if (next.done) {\n break;\n }\n var entryChild = _clone(next.value, depth - 1);\n child.add(entryChild);\n }\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n child[symbol] = _clone(parent[symbol], depth - 1);\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/clone/clone.js\n// module id = 39\n// module chunks = 0","class Module {\n constructor(quill, options = {}) {\n this.quill = quill;\n this.options = options;\n }\n}\nModule.DEFAULTS = {};\n\n\nexport default Module;\n\n\n\n// WEBPACK FOOTER //\n// ./core/module.js","import Parchment from 'parchment';\nimport clone from 'clone';\nimport equal from 'deep-equal';\nimport Emitter from './emitter';\nimport logger from './logger';\n\nlet debug = logger('quill:selection');\n\n\nclass Range {\n constructor(index, length = 0) {\n this.index = index;\n this.length = length;\n }\n}\n\n\nclass Selection {\n constructor(scroll, emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.root = this.scroll.domNode;\n this.root.addEventListener('compositionstart', () => {\n this.composing = true;\n });\n this.root.addEventListener('compositionend', () => {\n this.composing = false;\n });\n this.cursor = Parchment.create('cursor', this);\n // savedRange is last non-null range\n this.lastRange = this.savedRange = new Range(0, 0);\n ['keyup', 'mouseup', 'mouseleave', 'touchend', 'touchleave', 'focus', 'blur'].forEach((eventName) => {\n this.root.addEventListener(eventName, () => {\n // When range used to be a selection and user click within the selection,\n // the range now being a cursor has not updated yet without setTimeout\n setTimeout(this.update.bind(this, Emitter.sources.USER), 100);\n });\n });\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type, delta) => {\n if (type === Emitter.events.TEXT_CHANGE && delta.length() > 0) {\n this.update(Emitter.sources.SILENT);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, () => {\n let native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n // TODO unclear if this has negative side effects\n this.emitter.once(Emitter.events.SCROLL_UPDATE, () => {\n try {\n this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);\n } catch (ignored) {}\n });\n });\n this.update(Emitter.sources.SILENT);\n }\n\n focus() {\n if (this.hasFocus()) return;\n let bodyTop = document.body.scrollTop;\n this.root.focus();\n document.body.scrollTop = bodyTop;\n this.setRange(this.savedRange);\n }\n\n format(format, value) {\n this.scroll.update();\n let nativeRange = this.getNativeRange();\n if (nativeRange == null || !nativeRange.native.collapsed || Parchment.query(format, Parchment.Scope.BLOCK)) return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n let blot = Parchment.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof Parchment.Leaf) {\n let after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index, length = 0) {\n let scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let bounds, node, [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n let range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n bounds = range.getBoundingClientRect();\n } else {\n let side = 'left';\n let rect;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n bounds = {\n height: rect.height,\n left: rect[side],\n width: 0,\n top: rect.top\n };\n }\n let containerBounds = this.root.parentNode.getBoundingClientRect();\n return {\n left: bounds.left - containerBounds.left,\n right: bounds.left + bounds.width - containerBounds.left,\n top: bounds.top - containerBounds.top,\n bottom: bounds.top + bounds.height - containerBounds.top,\n height: bounds.height,\n width: bounds.width\n };\n }\n\n getNativeRange() {\n let selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n let nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n if (!contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))) {\n return null;\n }\n let range = {\n start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange\n };\n [range.start, range.end].forEach(function(position) {\n let node = position.node, offset = position.offset;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n } else {\n break;\n }\n }\n position.node = node, position.offset = offset;\n });\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange() {\n let range = this.getNativeRange();\n if (range == null) return [null, null];\n let positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n let indexes = positions.map((position) => {\n let [node, offset] = position;\n let blot = Parchment.find(node, true);\n let index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n } else if (blot instanceof Parchment.Container) {\n return index + blot.length();\n } else {\n return index + blot.index(node, offset);\n }\n });\n let start = Math.min(...indexes), end = Math.max(...indexes);\n return [new Range(start, end-start), range];\n }\n\n hasFocus() {\n return document.activeElement === this.root;\n }\n\n scrollIntoView(range = this.lastRange) {\n if (range == null) return;\n let bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n if (this.root.offsetHeight < bounds.bottom) {\n let [line, ] = this.scroll.line(Math.min(range.index + range.length, this.scroll.length()-1));\n this.root.scrollTop = line.domNode.offsetTop + line.domNode.offsetHeight - this.root.offsetHeight;\n } else if (bounds.top < 0) {\n let [line, ] = this.scroll.line(Math.min(range.index, this.scroll.length()-1));\n this.root.scrollTop = line.domNode.offsetTop;\n }\n }\n\n setNativeRange(startNode, startOffset, endNode = startNode, endOffset = startOffset, force = false) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n return;\n }\n let selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n let nativeRange = this.getNativeRange();\n if (nativeRange == null || force ||\n startNode !== nativeRange.start.node || startOffset !== nativeRange.start.offset ||\n endNode !== nativeRange.end.node || endOffset !== nativeRange.end.offset) {\n let range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n }\n }\n\n setRange(range, force = false, source = Emitter.sources.API) {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n let indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n let args = [];\n let scrollLength = this.scroll.length();\n indexes.forEach((index, i) => {\n index = Math.min(scrollLength - 1, index);\n let node, [leaf, offset] = this.scroll.leaf(index);\n [node, offset] = leaf.position(offset, i !== 0);\n args.push(node, offset);\n });\n if (args.length < 2) {\n args = args.concat(args);\n }\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source = Emitter.sources.USER) {\n let nativeRange, oldRange = this.lastRange;\n [this.lastRange, nativeRange] = this.getRange();\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!equal(oldRange, this.lastRange)) {\n if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n this.cursor.restore();\n }\n let args = [Emitter.events.SELECTION_CHANGE, clone(this.lastRange), clone(oldRange), source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode;\n } catch (e) {\n return false;\n }\n // IE11 has bug with Text nodes\n // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n if (descendant instanceof Text) {\n descendant = descendant.parentNode;\n }\n return parent.contains(descendant);\n}\n\n\nexport { Range, Selection as default };\n\n\n\n// WEBPACK FOOTER //\n// ./core/selection.js","class Theme {\n constructor(quill, options) {\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n init() {\n Object.keys(this.options.modules).forEach((name) => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name) {\n let moduleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n return this.modules[name];\n }\n}\nTheme.DEFAULTS = {\n modules: {}\n};\nTheme.themes = {\n 'default': Theme\n};\n\n\nexport default Theme;\n\n\n\n// WEBPACK FOOTER //\n// ./core/theme.js","import Parchment from 'parchment';\nimport Block, { BlockEmbed } from './block';\n\n\nclass Container extends Parchment.Container { }\nContainer.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Container;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/container.js","import Parchment from 'parchment';\nimport Emitter from '../core/emitter';\nimport Block, { BlockEmbed } from './block';\nimport Break from './break';\nimport Container from './container';\nimport CodeBlock from '../formats/code';\n\n\nfunction isLine(blot) {\n return (blot instanceof Block || blot instanceof BlockEmbed);\n}\n\n\nclass Scroll extends Parchment.Scroll {\n constructor(domNode, config) {\n super(domNode);\n this.emitter = config.emitter;\n if (Array.isArray(config.whitelist)) {\n this.whitelist = config.whitelist.reduce(function(whitelist, format) {\n whitelist[format] = true;\n return whitelist;\n }, {});\n }\n this.optimize();\n this.enable();\n }\n\n deleteAt(index, length) {\n let [first, offset] = this.line(index);\n let [last, ] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0 &&\n !(first instanceof BlockEmbed) && !(last instanceof BlockEmbed)) {\n if (last instanceof CodeBlock) {\n last.deleteAt(last.length() - 1, 1);\n }\n let ref = last.children.head instanceof Break ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled);\n }\n\n formatAt(index, length, format, value) {\n if (this.whitelist != null && !this.whitelist[format]) return;\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index, value, def) {\n if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n if (index >= this.length()) {\n if (def == null || Parchment.query(value, Parchment.Scope.BLOCK) == null) {\n let blot = Parchment.create(this.statics.defaultChild);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n value = value.slice(0, -1);\n }\n blot.insertAt(0, value, def);\n } else {\n let embed = Parchment.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot, ref) {\n if (blot.statics.scope === Parchment.Scope.INLINE_BLOT) {\n let wrapper = Parchment.create(this.statics.defaultChild);\n wrapper.appendChild(blot);\n blot = wrapper;\n }\n super.insertBefore(blot, ref);\n }\n\n leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n\n line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE) {\n let getLines = (blot, index, length) => {\n let lines = [], lengthLeft = length;\n blot.children.forEachAt(index, length, function(child, index, length) {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof Parchment.Container) {\n lines = lines.concat(getLines(child, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(mutations = []) {\n if (this.batch === true) return;\n super.optimize(mutations);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations);\n }\n }\n\n path(index) {\n return super.path(index).slice(1); // Exclude self\n }\n\n update(mutations) {\n if (this.batch === true) return;\n let source = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n}\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = 'block';\nScroll.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Scroll;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/scroll.js","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nimport { AlignAttribute, AlignStyle } from '../formats/align';\nimport { BackgroundStyle } from '../formats/background';\nimport { ColorStyle } from '../formats/color';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction';\nimport { FontStyle } from '../formats/font';\nimport { SizeStyle } from '../formats/size';\n\nlet debug = logger('quill:clipboard');\n\nconst CLIPBOARD_CONFIG = [\n [Node.TEXT_NODE, matchText],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchSpacing],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['b', matchAlias.bind(matchAlias, 'bold')],\n ['i', matchAlias.bind(matchAlias, 'italic')],\n ['style', matchIgnore]\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [\n AlignAttribute,\n DirectionAttribute\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\n\nclass Clipboard extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.quill.root.addEventListener('paste', this.onPaste.bind(this));\n this.container = this.quill.addContainer('ql-clipboard');\n this.container.setAttribute('contenteditable', true);\n this.container.setAttribute('tabindex', -1);\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers).forEach((pair) => {\n this.addMatcher(...pair);\n });\n }\n\n addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert(html) {\n const DOM_KEY = '__ql-matcher';\n if (typeof html === 'string') {\n this.container.innerHTML = html;\n }\n let textMatchers = [], elementMatchers = [];\n this.matchers.forEach((pair) => {\n let [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n [].forEach.call(this.container.querySelectorAll(selector), (node) => {\n // TODO use weakmap\n node[DOM_KEY] = node[DOM_KEY] || [];\n node[DOM_KEY].push(matcher);\n });\n break;\n }\n });\n let traverse = (node) => { // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce(function(delta, matcher) {\n return matcher(node, delta);\n }, new Delta());\n } else if (node.nodeType === node.ELEMENT_NODE) {\n return [].reduce.call(node.childNodes || [], (delta, childNode) => {\n let childrenDelta = traverse(childNode);\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n childrenDelta = (childNode[DOM_KEY] || []).reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n } else {\n return new Delta();\n }\n };\n let delta = traverse(this.container);\n // Remove trailing newline\n if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n delta = delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n debug.log('convert', this.container.innerHTML, delta);\n this.container.innerHTML = '';\n return delta;\n }\n\n dangerouslyPasteHTML(index, html, source = Quill.sources.API) {\n if (typeof index === 'string') {\n return this.quill.setContents(this.convert(index), html);\n } else {\n let paste = this.convert(html);\n return this.quill.updateContents(new Delta().retain(index).concat(paste), source);\n }\n }\n\n onPaste(e) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n let range = this.quill.getSelection();\n let delta = new Delta().retain(range.index).delete(range.length);\n let bodyTop = document.body.scrollTop;\n this.container.focus();\n setTimeout(() => {\n this.quill.selection.update(Quill.sources.SILENT);\n delta = delta.concat(this.convert());\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(delta.length() - range.length, Quill.sources.SILENT);\n document.body.scrollTop = bodyTop;\n this.quill.selection.scrollIntoView();\n }, 1);\n }\n}\nClipboard.DEFAULTS = {\n matchers: []\n};\n\n\nfunction computeStyle(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) return {};\n const DOM_KEY = '__ql-computed-style';\n return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n}\n\nfunction deltaEndsWith(delta, text) {\n let endText = \"\";\n for (let i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n let op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1*text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n let style = computeStyle(node);\n return ['block', 'list-item'].indexOf(style.display) > -1;\n}\n\nfunction matchAlias(format, node, delta) {\n return delta.compose(new Delta().retain(delta.length(), { [format]: true }));\n}\n\nfunction matchAttributor(node, delta) {\n let attributes = Parchment.Attributor.Attribute.keys(node);\n let classes = Parchment.Attributor.Class.keys(node);\n let styles = Parchment.Attributor.Style.keys(node);\n let formats = {};\n attributes.concat(classes).concat(styles).forEach((name) => {\n let attr = Parchment.query(name, Parchment.Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n if (ATTRIBUTE_ATTRIBUTORS[name] != null) {\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node);\n }\n if (STYLE_ATTRIBUTORS[name] != null) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node);\n }\n });\n if (Object.keys(formats).length > 0) {\n delta = delta.compose(new Delta().retain(delta.length(), formats));\n }\n return delta;\n}\n\nfunction matchBlot(node, delta) {\n let match = Parchment.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof Parchment.Embed) {\n let embed = {};\n let value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n delta = new Delta().insert(embed, match.formats(node));\n }\n } else if (typeof match.formats === 'function') {\n let formats = { [match.blotName]: match.formats(node) };\n delta = delta.compose(new Delta().retain(delta.length(), formats));\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchNewline(node, delta) {\n if (isLine(node) && !deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchSpacing(node, delta) {\n if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\\n\\n')) {\n let nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);\n if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight*1.5) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n let formats = {};\n let style = node.style || {};\n if (style.fontWeight && computeStyle(node).fontWeight === 'bold') {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = delta.compose(new Delta().retain(delta.length(), formats));\n }\n if (parseFloat(style.textIndent || 0) > 0) { // Could be 0.5in\n delta = new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchText(node, delta) {\n let text = node.data;\n // Word represents empty line with  \n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n // eslint-disable-next-line func-style\n let replacer = function(collapse, match) {\n match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return match.length < 1 && collapse ? ' ' : match;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if ((node.previousSibling == null && isLine(node.parentNode)) ||\n (node.previousSibling != null && isLine(node.previousSibling))) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if ((node.nextSibling == null && isLine(node.parentNode)) ||\n (node.nextSibling != null && isLine(node.nextSibling))) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\n\nexport { Clipboard as default, matchAttributor, matchBlot, matchNewline, matchSpacing, matchText };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/clipboard.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['right', 'center', 'justify']\n};\n\nlet AlignAttribute = new Parchment.Attributor.Attribute('align', 'align', config);\nlet AlignClass = new Parchment.Attributor.Class('align', 'ql-align', config);\nlet AlignStyle = new Parchment.Attributor.Style('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/align.js","import Parchment from 'parchment';\nimport { ColorAttributor } from './color';\n\nlet BackgroundClass = new Parchment.Attributor.Class('background', 'ql-bg', {\n scope: Parchment.Scope.INLINE\n});\nlet BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { BackgroundClass, BackgroundStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/background.js","import Parchment from 'parchment';\n\nclass ColorAttributor extends Parchment.Attributor.Style {\n value(domNode) {\n let value = super.value(domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n return '#' + value.split(',').map(function(component) {\n return ('00' + parseInt(component).toString(16)).slice(-2);\n }).join('');\n }\n}\n\nlet ColorClass = new Parchment.Attributor.Class('color', 'ql-color', {\n scope: Parchment.Scope.INLINE\n});\nlet ColorStyle = new ColorAttributor('color', 'color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/color.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['rtl']\n};\n\nlet DirectionAttribute = new Parchment.Attributor.Attribute('direction', 'dir', config);\nlet DirectionClass = new Parchment.Attributor.Class('direction', 'ql-direction', config);\nlet DirectionStyle = new Parchment.Attributor.Style('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/direction.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.INLINE,\n whitelist: ['serif', 'monospace']\n};\n\nlet FontClass = new Parchment.Attributor.Class('font', 'ql-font', config);\n\nclass FontStyleAttributor extends Parchment.Attributor.Style {\n value(node) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nlet FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/font.js","import Parchment from 'parchment';\n\nlet SizeClass = new Parchment.Attributor.Class('size', 'ql-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['small', 'large', 'huge']\n});\nlet SizeStyle = new Parchment.Attributor.Style('size', 'font-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['10px', '18px', '32px']\n});\n\nexport { SizeClass, SizeStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/size.js","import Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\n\n\nclass History extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.lastRecorded = 0;\n this.ignoreChange = false;\n this.clear();\n this.quill.on(Quill.events.EDITOR_CHANGE, (eventName, delta, oldDelta, source) => {\n if (eventName !== Quill.events.TEXT_CHANGE || this.ignoreChange) return;\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(delta, oldDelta);\n } else {\n this.transform(delta);\n }\n });\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, this.undo.bind(this));\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, this.redo.bind(this));\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, this.redo.bind(this));\n }\n }\n\n change(source, dest) {\n if (this.stack[source].length === 0) return;\n let delta = this.stack[source].pop();\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta[source], Quill.sources.USER);\n this.ignoreChange = false;\n let index = getLastChangeIndex(delta[source]);\n this.quill.setSelection(index);\n this.quill.selection.scrollIntoView();\n this.stack[dest].push(delta);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = this.quill.getContents().diff(oldDelta);\n let timestamp = Date.now();\n if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n let delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta.undo);\n changeDelta = delta.redo.compose(changeDelta);\n } else {\n this.lastRecorded = timestamp;\n }\n this.stack.undo.push({\n redo: changeDelta,\n undo: undoDelta\n });\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta) {\n this.stack.undo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n this.stack.redo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n}\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false\n};\n\nfunction endsWithNewlineChange(delta) {\n let lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(function(attr) {\n return Parchment.query(attr, Parchment.Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(delta) {\n let deleteLength = delta.reduce(function(length, op) {\n length += (op.delete || 0);\n return length;\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\n\nexport { History as default, getLastChangeIndex };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/history.js","import clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\nimport DeltaOp from 'quill-delta/lib/op';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nlet debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\n\nclass Keyboard extends Module {\n static match(evt, binding) {\n binding = normalize(binding);\n if (!!binding.shortKey !== evt[SHORTKEY] && binding.shortKey !== null) return false;\n if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function(key) {\n return (key != SHORTKEY && !!binding[key] !== evt[key] && binding[key] !== null);\n })) {\n return false;\n }\n return binding.key === (evt.which || evt.keyCode);\n }\n\n constructor(quill, options) {\n super(quill, options);\n this.bindings = {};\n Object.keys(this.options.bindings).forEach((name) => {\n if (this.options.bindings[name]) {\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function() {});\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^$/ }, handleDelete);\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n if (/Trident/i.test(navigator.userAgent)) {\n this.addBinding({ key: Keyboard.keys.BACKSPACE, shortKey: true }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE, shortKey: true }, handleDelete);\n }\n this.listen();\n }\n\n addBinding(key, context = {}, handler = {}) {\n let binding = normalize(key);\n if (binding == null || binding.key == null) {\n return debug.warn('Attempted to add invalid keyboard binding', binding);\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler: handler };\n }\n binding = extend(binding, context, handler);\n this.bindings[binding.key] = this.bindings[binding.key] || [];\n this.bindings[binding.key].push(binding);\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', (evt) => {\n if (evt.defaultPrevented) return;\n let which = evt.which || evt.keyCode;\n let bindings = (this.bindings[which] || []).filter(function(binding) {\n return Keyboard.match(evt, binding);\n });\n if (bindings.length === 0) return;\n let range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n let [line, offset] = this.quill.scroll.line(range.index);\n let [leafStart, offsetStart] = this.quill.scroll.leaf(range.index);\n let [leafEnd, offsetEnd] = range.length === 0 ? [leafStart, offsetStart] : this.quill.scroll.leaf(range.index + range.length);\n let prefixText = leafStart instanceof Parchment.Text ? leafStart.value().slice(0, offsetStart) : '';\n let suffixText = leafEnd instanceof Parchment.Text ? leafEnd.value().slice(offsetEnd) : '';\n let curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n offset: offset,\n prefix: prefixText,\n suffix: suffixText\n };\n let prevented = bindings.some((binding) => {\n if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n if (binding.empty != null && binding.empty !== curContext.empty) return false;\n if (binding.offset != null && binding.offset !== curContext.offset) return false;\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(function(name) {\n return curContext.format[name] == null;\n })) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (!Object.keys(binding.format).every(function(name) {\n if (binding.format[name] === true) return curContext.format[name] != null;\n if (binding.format[name] === false) return curContext.format[name] == null;\n return equal(binding.format[name], curContext.format[name]);\n })) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n return binding.handler.call(this, range, curContext) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n}\n\nKeyboard.keys = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n DELETE: 46\n};\n\nKeyboard.DEFAULTS = {\n bindings: {\n 'bold' : makeFormatHandler('bold'),\n 'italic' : makeFormatHandler('italic'),\n 'underline' : makeFormatHandler('underline'),\n 'indent': {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: Keyboard.keys.TAB,\n format: ['blockquote', 'indent', 'list'],\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n }\n },\n 'outdent': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n }\n },\n 'outdent backspace': {\n key: Keyboard.keys.BACKSPACE,\n collapsed: true,\n format: ['blockquote', 'indent', 'list'],\n offset: 0,\n handler: function(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.blockquote != null) {\n this.quill.format('blockquote', false, Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n }\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler: function(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n }\n },\n 'tab': {\n key: Keyboard.keys.TAB,\n handler: function(range, context) {\n if (!context.collapsed) {\n this.quill.scroll.deleteAt(range.index, range.length);\n }\n this.quill.insertText(range.index, '\\t', Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n }\n },\n 'list empty enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['list'],\n empty: true,\n handler: function(range, context) {\n this.quill.format('list', false, Quill.sources.USER);\n if (context.format.indent) {\n this.quill.format('indent', false, Quill.sources.USER);\n }\n }\n },\n 'header enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler: function(range) {\n this.quill.scroll.insertAt(range.index, '\\n');\n this.quill.formatText(range.index + 1, 1, 'header', false, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.selection.scrollIntoView();\n }\n },\n 'list autofill': {\n key: ' ',\n collapsed: true,\n format: { list: false },\n prefix: /^(1\\.|-)$/,\n handler: function(range, context) {\n let length = context.prefix.length;\n this.quill.scroll.deleteAt(range.index - length, length);\n this.quill.formatLine(range.index - length, 1, 'list', length === 1 ? 'bullet' : 'ordered', Quill.sources.USER);\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n }\n }\n }\n};\n\n\nfunction handleBackspace(range, context) {\n if (range.index === 0) return;\n let [line, ] = this.quill.scroll.line(range.index);\n let formats = {};\n if (context.offset === 0) {\n let curFormats = line.formats();\n let prevFormats = this.quill.getFormat(range.index-1, 1);\n formats = DeltaOp.attributes.diff(curFormats, prevFormats) || {};\n }\n this.quill.deleteText(range.index-1, 1, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index-1, 1, formats, Quill.sources.USER);\n }\n this.quill.selection.scrollIntoView();\n}\n\nfunction handleDelete(range) {\n if (range.index >= this.quill.getLength() - 1) return;\n this.quill.deleteText(range.index, 1, Quill.sources.USER);\n}\n\nfunction handleDeleteRange(range) {\n this.quill.deleteText(range, Quill.sources.USER);\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.quill.selection.scrollIntoView();\n}\n\nfunction handleEnter(range, context) {\n if (range.length > 0) {\n this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n }\n let lineFormats = Object.keys(context.format).reduce(function(lineFormats, format) {\n if (Parchment.query(format, Parchment.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n lineFormats[format] = context.format[format];\n }\n return lineFormats;\n }, {});\n this.quill.insertText(range.index, '\\n', lineFormats, Quill.sources.USER);\n this.quill.selection.scrollIntoView();\n Object.keys(context.format).forEach((name) => {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'link') return;\n this.quill.format(name, context.format[name], Quill.sources.USER);\n });\n}\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: Keyboard.keys.TAB,\n shiftKey: !indent,\n format: {'code-block': true },\n handler: function(range) {\n let CodeBlock = Parchment.query('code-block');\n let index = range.index, length = range.length;\n let [block, offset] = this.quill.scroll.descendant(CodeBlock, index);\n if (block == null) return;\n let scrollOffset = this.quill.scroll.offset(block);\n let start = block.newlineIndex(offset, true) + 1;\n let end = block.newlineIndex(scrollOffset + offset + length);\n let lines = block.domNode.textContent.slice(start, end).split('\\n');\n offset = 0;\n lines.forEach((line, i) => {\n if (indent) {\n block.insertAt(start + offset, CodeBlock.TAB);\n offset += CodeBlock.TAB.length;\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.startsWith(CodeBlock.TAB)) {\n block.deleteAt(start + offset, CodeBlock.TAB.length);\n offset -= CodeBlock.TAB.length;\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n offset += line.length + 1;\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n }\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0].toUpperCase(),\n shortKey: true,\n handler: function(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n }\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n return normalize({ key: binding });\n }\n if (typeof binding === 'object') {\n binding = clone(binding, false);\n }\n if (typeof binding.key === 'string') {\n if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n binding.key = Keyboard.keys[binding.key.toUpperCase()];\n } else if (binding.key.length === 1) {\n binding.key = binding.key.toUpperCase().charCodeAt(0);\n } else {\n return null;\n }\n }\n return binding;\n}\n\n\nexport default Keyboard;\n\n\n\n// WEBPACK FOOTER //\n// ./modules/keyboard.js","import Parchment from 'parchment';\n\nclass IdentAttributor extends Parchment.Attributor.Class {\n add(node, value) {\n if (value === '+1' || value === '-1') {\n let indent = this.value(node) || 0;\n value = (value === '+1' ? (indent + 1) : (indent - 1));\n }\n if (value === 0) {\n this.remove(node);\n return true;\n } else {\n return super.add(node, value);\n }\n }\n\n value(node) {\n return parseInt(super.value(node)) || undefined; // Don't return NaN\n }\n}\n\nlet IndentClass = new IdentAttributor('indent', 'ql-indent', {\n scope: Parchment.Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n});\n\nexport { IndentClass };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/indent.js","import Block from '../blots/block';\n\n\nclass Blockquote extends Block {}\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\n\nexport default Blockquote;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/blockquote.js","import Block from '../blots/block';\n\n\nclass Header extends Block {\n static formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\n\nexport default Header;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/header.js","import Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Container from '../blots/container';\n\n\nclass ListItem extends Block {\n static formats(domNode) {\n return domNode.tagName === this.tagName ? undefined : super.formats(domNode);\n }\n\n format(name, value) {\n if (name === List.blotName && !value) {\n this.replaceWith(Parchment.create(this.statics.scope));\n } else {\n super.format(name, value);\n }\n }\n\n remove() {\n if (this.prev == null && this.next == null) {\n this.parent.remove();\n } else {\n super.remove();\n }\n }\n\n replaceWith(name, value) {\n this.parent.isolate(this.offset(this.parent), this.length());\n if (name === this.parent.statics.blotName) {\n this.parent.replaceWith(name, value);\n return this;\n } else {\n this.parent.unwrap();\n return super.replaceWith(name, value);\n }\n }\n}\nListItem.blotName = 'list-item';\nListItem.tagName = 'LI';\n\n\nclass List extends Container {\n static create(value) {\n if (value === 'ordered') {\n value = 'OL';\n } else if (value === 'bullet') {\n value = 'UL';\n }\n return super.create(value);\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'OL') return 'ordered';\n if (domNode.tagName === 'UL') return 'bullet';\n return undefined;\n }\n\n format(name, value) {\n if (this.children.length > 0) {\n this.children.tail.format(name, value);\n }\n }\n\n formats() {\n // We don't inherit from FormatBlot\n return { [this.statics.blotName]: this.statics.formats(this.domNode) };\n }\n\n insertBefore(blot, ref) {\n if (blot instanceof ListItem) {\n super.insertBefore(blot, ref);\n } else {\n let index = ref == null ? this.length() : ref.offset(this);\n let after = this.split(index);\n after.parent.insertBefore(blot, after);\n }\n }\n\n optimize() {\n super.optimize();\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n next.domNode.tagName === this.domNode.tagName) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n if (target.statics.blotName !== this.statics.blotName) {\n let item = Parchment.create(this.statics.defaultChild);\n target.moveChildren(item);\n this.appendChild(item);\n }\n super.replace(target);\n }\n}\nList.blotName = 'list';\nList.scope = Parchment.Scope.BLOCK_BLOT;\nList.tagName = ['OL', 'UL'];\nList.defaultChild = 'list-item';\nList.allowedChildren = [ListItem];\n\n\nexport { ListItem, List as default };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/list.js","import Inline from '../blots/inline';\n\nclass Bold extends Inline {\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize() {\n super.optimize();\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexport default Bold;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/bold.js","import Bold from './bold';\n\nclass Italic extends Bold { }\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexport default Italic;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/italic.js","import Inline from '../blots/inline';\n\n\nclass Link extends Inline {\n static create(value) {\n let node = super.create(value);\n value = this.sanitize(value);\n node.setAttribute('href', value);\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url) {\n return sanitize(url, ['http', 'https', 'mailto']) ? url : this.SANITIZED_URL;\n }\n\n format(name, value) {\n if (name !== this.statics.blotName || !value) return super.format(name, value);\n value = this.constructor.sanitize(value);\n this.domNode.setAttribute('href', value);\n }\n}\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\n\n\nfunction sanitize(url, protocols) {\n let anchor = document.createElement('a');\n anchor.href = url;\n let protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\n\nexport { Link as default, sanitize };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/link.js","import Inline from '../blots/inline';\n\nclass Script extends Inline {\n static create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n } else if (value === 'sub') {\n return document.createElement('sub');\n } else {\n return super.create(value);\n }\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexport default Script;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/script.js","import Inline from '../blots/inline';\n\nclass Strike extends Inline { }\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexport default Strike;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/strike.js","import Inline from '../blots/inline';\n\nclass Underline extends Inline { }\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexport default Underline;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/underline.js","import Embed from '../blots/embed';\nimport { sanitize } from '../formats/link';\n\nconst ATTRIBUTES = [\n 'alt',\n 'height',\n 'width'\n];\n\n\nclass Image extends Embed {\n static create(value) {\n let node = super.create(value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static sanitize(url) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\n\nexport default Image;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/image.js","import { BlockEmbed } from '../blots/block';\nimport Link from '../formats/link';\n\nconst ATTRIBUTES = [\n 'height',\n 'width'\n];\n\n\nclass Video extends BlockEmbed {\n static create(value) {\n let node = super.create(value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static sanitize(url) {\n return Link.sanitize(url);\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\n\nexport default Video;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/video.js","import Embed from '../blots/embed';\nimport Quill from '../core/quill';\n\n\nclass FormulaBlot extends Embed {\n static create(value) {\n let node = super.create(value);\n if (typeof value === 'string') {\n window.katex.render(value, node);\n node.setAttribute('data-value', value);\n }\n node.setAttribute('contenteditable', false);\n return node;\n }\n\n static value(domNode) {\n return domNode.getAttribute('data-value');\n }\n\n index() {\n return 1;\n }\n}\nFormulaBlot.blotName = 'formula';\nFormulaBlot.className = 'ql-formula';\nFormulaBlot.tagName = 'SPAN';\n\n\nfunction Formula() {\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n Quill.register(FormulaBlot, true);\n}\n\n\nexport { FormulaBlot, Formula as default };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/formula.js","import Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\nimport CodeBlock from '../formats/code';\n\n\nclass SyntaxCodeBlock extends CodeBlock {\n replaceWith(block) {\n this.domNode.textContent = this.domNode.textContent;\n this.attach();\n super.replaceWith(block);\n }\n\n highlight(highlight) {\n if (this.cachedHTML !== this.domNode.innerHTML) {\n let text = this.domNode.textContent;\n if (text.trim().length > 0 || this.cachedHTML == null) {\n this.domNode.innerHTML = highlight(text);\n this.attach();\n }\n this.cachedHTML = this.domNode.innerHTML;\n }\n }\n}\nSyntaxCodeBlock.className = 'ql-syntax';\n\n\nlet CodeToken = new Parchment.Attributor.Class('token', 'hljs', {\n scope: Parchment.Scope.INLINE\n});\n\n\nclass Syntax extends Module {\n constructor(quill, options) {\n super(quill, options);\n if (typeof this.options.highlight !== 'function') {\n throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');\n }\n Quill.register(CodeToken, true);\n Quill.register(SyntaxCodeBlock, true);\n let timer = null;\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n if (timer != null) return;\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, 100);\n });\n this.highlight();\n }\n\n highlight() {\n if (this.quill.selection.composing) return;\n let range = this.quill.getSelection();\n this.quill.scroll.descendants(SyntaxCodeBlock).forEach((code) => {\n code.highlight(this.options.highlight);\n });\n this.quill.update(Quill.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n }\n }\n}\nSyntax.DEFAULTS = {\n highlight: (function() {\n if (window.hljs == null) return null;\n return function(text) {\n let result = window.hljs.highlightAuto(text);\n return result.value;\n };\n })()\n};\n\n\nexport { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default};\n\n\n\n// WEBPACK FOOTER //\n// ./modules/syntax.js","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nlet debug = logger('quill:toolbar');\n\n\nclass Toolbar extends Module {\n constructor(quill, options) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n let container = document.createElement('div');\n addControls(container, this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n return debug.error('Container required for toolbar', this.options);\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n Object.keys(this.options.handlers).forEach((format) => {\n this.addHandler(format, this.options.handlers[format]);\n });\n [].forEach.call(this.container.querySelectorAll('button, select'), (input) => {\n this.attach(input);\n });\n this.quill.on(Quill.events.EDITOR_CHANGE, (type, range) => {\n if (type === Quill.events.SELECTION_CHANGE) {\n this.update(range);\n }\n });\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n let [range, ] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n\n attach(input) {\n let format = [].find.call(input.classList, (className) => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (this.handlers[format] == null) {\n if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n debug.warn('ignoring attaching to disabled format', format, input);\n return;\n }\n if (Parchment.query(format) == null) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n }\n let eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, (e) => {\n let value;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n let selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n let [range, ] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (Parchment.query(format).prototype instanceof Parchment.Embed) {\n value = prompt(`Enter ${format}`);\n if (!value) return;\n this.quill.updateContents(new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ [format]: value })\n , Quill.sources.USER);\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n // TODO use weakmap\n this.controls.push([format, input]);\n }\n\n update(range) {\n let formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(function(pair) {\n let [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\\\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else {\n if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n let isActive = formats[format] === input.getAttribute('value') ||\n (formats[format] != null && formats[format].toString() === input.getAttribute('value')) ||\n (formats[format] == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\n\nfunction addButton(container, format, value) {\n let input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add('ql-' + format);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(function(controls) {\n let group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(function(control) {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n let format = Object.keys(control)[0];\n let value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n let input = document.createElement('select');\n input.classList.add('ql-' + format);\n values.forEach(function(value) {\n let option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean: function() {\n let range = this.quill.getSelection();\n if (range == null) return;\n if (range.length == 0) {\n let formats = this.quill.getFormat();\n Object.keys(formats).forEach((name) => {\n // Clean functionality in existing apps only clean inline formats\n if (Parchment.query(name, Parchment.Scope.INLINE) != null) {\n this.quill.format(name, false);\n }\n });\n } else {\n this.quill.removeFormat(range, Quill.sources.USER);\n }\n },\n direction: function(value) {\n let align = this.quill.getFormat()['align'];\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n link: function(value) {\n if (value === true) {\n value = prompt('Enter link URL:');\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n indent: function(value) {\n let range = this.quill.getSelection();\n let formats = this.quill.getFormat(range);\n let indent = parseInt(formats.indent || 0);\n if (value === '+1' || value === '-1') {\n let modifier = (value === '+1') ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n }\n }\n}\n\n\nexport { Toolbar as default, addControls };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/toolbar.js","module.exports = {\n 'align': {\n '' : require('../assets/icons/align-left.svg'),\n 'center' : require('../assets/icons/align-center.svg'),\n 'right' : require('../assets/icons/align-right.svg'),\n 'justify' : require('../assets/icons/align-justify.svg')\n },\n 'background': require('../assets/icons/background.svg'),\n 'blockquote': require('../assets/icons/blockquote.svg'),\n 'bold' : require('../assets/icons/bold.svg'),\n 'clean' : require('../assets/icons/clean.svg'),\n 'code' : require('../assets/icons/code.svg'),\n 'code-block': require('../assets/icons/code.svg'),\n 'color' : require('../assets/icons/color.svg'),\n 'direction' : {\n '' : require('../assets/icons/direction-ltr.svg'),\n 'rtl' : require('../assets/icons/direction-rtl.svg')\n },\n 'float': {\n 'center' : require('../assets/icons/float-center.svg'),\n 'full' : require('../assets/icons/float-full.svg'),\n 'left' : require('../assets/icons/float-left.svg'),\n 'right' : require('../assets/icons/float-right.svg')\n },\n 'formula' : require('../assets/icons/formula.svg'),\n 'header': {\n '1' : require('../assets/icons/header.svg'),\n '2' : require('../assets/icons/header-2.svg')\n },\n 'italic' : require('../assets/icons/italic.svg'),\n 'image' : require('../assets/icons/image.svg'),\n 'indent': {\n '+1' : require('../assets/icons/indent.svg'),\n '-1' : require('../assets/icons/outdent.svg')\n },\n 'link' : require('../assets/icons/link.svg'),\n 'list': {\n 'ordered' : require('../assets/icons/list-ordered.svg'),\n 'bullet' : require('../assets/icons/list-bullet.svg')\n },\n 'script': {\n 'sub' : require('../assets/icons/subscript.svg'),\n 'super' : require('../assets/icons/superscript.svg'),\n },\n 'strike' : require('../assets/icons/strike.svg'),\n 'underline' : require('../assets/icons/underline.svg'),\n 'video' : require('../assets/icons/video.svg')\n};\n\n\n\n// WEBPACK FOOTER //\n// ./ui/icons.js","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-left.svg\n// module id = 73\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-center.svg\n// module id = 74\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-right.svg\n// module id = 75\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-justify.svg\n// module id = 76\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/background.svg\n// module id = 77\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/blockquote.svg\n// module id = 78\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/bold.svg\n// module id = 79\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/clean.svg\n// module id = 80\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/code.svg\n// module id = 81\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/color.svg\n// module id = 82\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/direction-ltr.svg\n// module id = 83\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/direction-rtl.svg\n// module id = 84\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-center.svg\n// module id = 85\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-full.svg\n// module id = 86\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-left.svg\n// module id = 87\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-right.svg\n// module id = 88\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/formula.svg\n// module id = 89\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/header.svg\n// module id = 90\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/header-2.svg\n// module id = 91\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/italic.svg\n// module id = 92\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/image.svg\n// module id = 93\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/indent.svg\n// module id = 94\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/outdent.svg\n// module id = 95\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/link.svg\n// module id = 96\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-ordered.svg\n// module id = 97\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-bullet.svg\n// module id = 98\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/subscript.svg\n// module id = 99\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/superscript.svg\n// module id = 100\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/strike.svg\n// module id = 101\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/underline.svg\n// module id = 102\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/video.svg\n// module id = 103\n// module chunks = 0","import DropdownIcon from '../assets/icons/dropdown.svg';\n\n\nclass Picker {\n constructor(select) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n this.select.parentNode.insertBefore(this.container, this.select);\n this.label.addEventListener('click', () => {\n this.container.classList.toggle('ql-expanded');\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n buildItem(option) {\n let item = document.createElement('span');\n item.classList.add('ql-picker-item');\n if (option.hasAttribute('value')) {\n item.setAttribute('data-value', option.getAttribute('value'));\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n return item;\n }\n\n buildLabel() {\n let label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = DropdownIcon;\n this.container.appendChild(label);\n return label;\n }\n\n buildOptions() {\n let options = document.createElement('span');\n options.classList.add('ql-picker-options');\n [].slice.call(this.select.options).forEach((option) => {\n let item = this.buildItem(option);\n options.appendChild(item);\n if (option.hasAttribute('selected')) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n\n buildPicker() {\n [].slice.call(this.select.attributes).forEach((item) => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n\n close() {\n this.container.classList.remove('ql-expanded');\n }\n\n selectItem(item, trigger = false) {\n let selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item != null) {\n item.classList.add('ql-selected');\n this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);\n if (item.hasAttribute('data-value')) {\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n if (typeof Event === 'function') {\n this.select.dispatchEvent(new Event('change'));\n } else if (typeof Event === 'object') { // IE11\n let event = document.createEvent('Event');\n event.initEvent('change', true, true);\n this.select.dispatchEvent(event);\n }\n this.close();\n }\n } else {\n this.label.removeAttribute('data-value');\n this.label.removeAttribute('data-label');\n }\n }\n\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n let item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex];\n option = this.select.options[this.select.selectedIndex];\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n let isActive = option != null && option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n\n\nexport default Picker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/picker.js","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/dropdown.svg\n// module id = 105\n// module chunks = 0","import Picker from './picker';\n\n\nclass ColorPicker extends Picker {\n constructor(select, label) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n [].slice.call(this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function(item) {\n item.classList.add('ql-primary');\n });\n }\n\n buildItem(option) {\n let item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n let colorLabel = this.label.querySelector('.ql-color-label');\n let value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n\n\nexport default ColorPicker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/color-picker.js","import Picker from './picker';\n\n\nclass IconPicker extends Picker {\n constructor(select, icons) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n [].forEach.call(this.container.querySelectorAll('.ql-picker-item'), (item) => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n });\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n item = item || this.defaultItem;\n this.label.innerHTML = item.innerHTML;\n }\n}\n\n\nexport default IconPicker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/icon-picker.js","class Tooltip {\n constructor(quill, boundsContainer) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n this.root.innerHTML = this.constructor.TEMPLATE;\n let offset = parseInt(window.getComputedStyle(this.root).marginTop);\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = (-1*this.quill.root.scrollTop) + offset + 'px';\n this.checkBounds();\n });\n this.hide();\n }\n\n checkBounds() {\n this.root.classList.toggle('ql-out-top', this.root.offsetTop <= 0);\n this.root.classList.remove('ql-out-bottom');\n this.root.classList.toggle('ql-out-bottom', this.root.offsetTop + this.root.offsetHeight >= this.quill.root.offsetHeight);\n }\n\n hide() {\n this.root.classList.add('ql-hidden');\n }\n\n position(reference) {\n let left = reference.left + reference.width/2 - this.root.offsetWidth/2;\n let top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = left + 'px';\n this.root.style.top = top + 'px';\n let containerBounds = this.boundsContainer.getBoundingClientRect();\n let rootBounds = this.root.getBoundingClientRect();\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = (left + shift) + 'px';\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = (left + shift) + 'px';\n }\n this.checkBounds();\n return shift;\n }\n\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n\n\nexport default Tooltip;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/tooltip.js","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\n\nconst TOOLBAR_CONFIG = [\n ['bold', 'italic', 'link'],\n [{ header: 1 }, { header: 2 }, 'blockquote']\n];\n\nclass BubbleTheme extends BaseTheme {\n constructor(quill, options) {\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n\n extendToolbar(toolbar) {\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), icons);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), icons);\n }\n}\nBubbleTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function(value) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n }\n }\n }\n }\n});\n\n\nclass BubbleTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.quill.on(Emitter.events.EDITOR_CHANGE, (type, range) => {\n if (type !== Emitter.events.SELECTION_CHANGE) return;\n if (range != null && range.length > 0) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = this.root.offsetWidth + 'px';\n let lines = this.quill.scroll.lines(range.index, range.length);\n if (lines.length === 1) {\n this.position(this.quill.getBounds(range));\n } else {\n let lastLine = lines[lines.length - 1];\n let index = lastLine.offset(this.quill.scroll);\n let length = Math.min(lastLine.length() - 1, range.index + range.length - index);\n let bounds = this.quill.getBounds(new Range(index, length));\n this.position(bounds);\n }\n } else if (document.activeElement !== this.textbox && this.quill.hasFocus()) {\n this.hide();\n }\n });\n }\n\n listen() {\n super.listen();\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(Emitter.events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n let range = this.quill.getSelection();\n if (range != null) {\n this.position(this.quill.getBounds(range));\n }\n }, 1);\n });\n }\n\n cancel() {\n this.show();\n }\n\n position(reference) {\n let shift = super.position(reference);\n let arrow = this.root.querySelector('.ql-tooltip-arrow');\n arrow.style.marginLeft = '';\n if (shift === 0) return shift;\n arrow.style.marginLeft = (-1*shift - arrow.offsetWidth/2) + 'px';\n }\n}\nBubbleTooltip.TEMPLATE = [\n '',\n '
    ',\n '',\n '',\n '
    '\n].join('');\n\n\nexport { BubbleTooltip, BubbleTheme as default };\n\n\n\n// WEBPACK FOOTER //\n// ./themes/bubble.js","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Emitter from '../core/emitter';\nimport Keyboard from '../modules/keyboard';\nimport Theme from '../core/theme';\nimport ColorPicker from '../ui/color-picker';\nimport IconPicker from '../ui/icon-picker';\nimport Picker from '../ui/picker';\nimport Tooltip from '../ui/tooltip';\n\n\nconst ALIGNS = [ false, 'center', 'right', 'justify' ];\n\nconst COLORS = [\n \"#000000\", \"#e60000\", \"#ff9900\", \"#ffff00\", \"#008a00\", \"#0066cc\", \"#9933ff\",\n \"#ffffff\", \"#facccc\", \"#ffebcc\", \"#ffffcc\", \"#cce8cc\", \"#cce0f5\", \"#ebd6ff\",\n \"#bbbbbb\", \"#f06666\", \"#ffc266\", \"#ffff66\", \"#66b966\", \"#66a3e0\", \"#c285ff\",\n \"#888888\", \"#a10000\", \"#b26b00\", \"#b2b200\", \"#006100\", \"#0047b2\", \"#6b24b2\",\n \"#444444\", \"#5c0000\", \"#663d00\", \"#666600\", \"#003700\", \"#002966\", \"#3d1466\"\n];\n\nconst FONTS = [ false, 'serif', 'monospace' ];\n\nconst HEADERS = [ '1', '2', '3', false ];\n\nconst SIZES = [ 'small', false, 'large', 'huge' ];\n\n\nclass BaseTheme extends Theme {\n constructor(quill, options) {\n super(quill, options);\n let listener = (e) => {\n if (!document.body.contains(quill.root)) {\n return document.body.removeEventListener('click', listener);\n }\n if (this.tooltip != null && !this.tooltip.root.contains(e.target) &&\n document.activeElement !== this.tooltip.textbox && !this.quill.hasFocus()) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach(function(picker) {\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n document.body.addEventListener('click', listener);\n }\n\n addModule(name) {\n let module = super.addModule(name);\n if (name === 'toolbar') {\n this.extendToolbar(module);\n }\n return module;\n }\n\n buildButtons(buttons, icons) {\n buttons.forEach((button) => {\n let className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach((name) => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n button.innerHTML = icons[name][''] + icons[name]['rtl'];\n } else if (typeof icons[name] === 'string') {\n button.innerHTML = icons[name];\n } else {\n let value = button.value || '';\n if (value != null && icons[name][value]) {\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n\n buildPickers(selects, icons) {\n this.pickers = selects.map((select) => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n return new IconPicker(select, icons.align);\n } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {\n let format = select.classList.contains('ql-background') ? 'background' : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');\n }\n return new ColorPicker(select, icons[format]);\n } else {\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new Picker(select);\n }\n });\n let update = () => {\n this.pickers.forEach(function(picker) {\n picker.update();\n });\n };\n this.quill.on(Emitter.events.SELECTION_CHANGE, update)\n .on(Emitter.events.SCROLL_OPTIMIZE, update);\n }\n}\nBaseTheme.DEFAULTS = extend(true, {}, Theme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula: function() {\n this.quill.theme.tooltip.edit('formula');\n },\n image: function() {\n let fileInput = this.container.querySelector('input.ql-image[type=file]');\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon, image/svg+xml');\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n if (fileInput.files != null && fileInput.files[0] != null) {\n let reader = new FileReader();\n reader.onload = (e) => {\n let range = this.quill.getSelection(true);\n this.quill.updateContents(new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ image: e.target.result })\n , Emitter.sources.USER);\n fileInput.value = \"\";\n }\n reader.readAsDataURL(fileInput.files[0]);\n }\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video: function() {\n this.quill.theme.tooltip.edit('video');\n }\n }\n }\n }\n});\n\n\nclass BaseTooltip extends Tooltip {\n constructor(quill, boundsContainer) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n\n listen() {\n this.textbox.addEventListener('keydown', (event) => {\n if (Keyboard.match(event, 'enter')) {\n this.save();\n event.preventDefault();\n } else if (Keyboard.match(event, 'escape')) {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n\n cancel() {\n this.hide();\n }\n\n edit(mode = 'link', preview = null) {\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n this.position(this.quill.getBounds(this.quill.selection.savedRange));\n this.textbox.select();\n this.textbox.setAttribute('placeholder', this.textbox.getAttribute(`data-${mode}`) || '');\n this.root.setAttribute('data-mode', mode);\n }\n\n restoreFocus() {\n let scrollTop = this.quill.root.scrollTop;\n this.quill.focus();\n this.quill.root.scrollTop = scrollTop;\n }\n\n save() {\n let value = this.textbox.value;\n switch(this.root.getAttribute('data-mode')) {\n case 'link': {\n let scrollTop = this.quill.root.scrollTop;\n if (this.linkRange) {\n this.quill.formatText(this.linkRange, 'link', value, Emitter.sources.USER);\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, Emitter.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video': {\n let match = value.match(/^(https?):\\/\\/(www\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/) ||\n value.match(/^(https?):\\/\\/(www\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n value = match[1] + '://www.youtube.com/embed/' + match[3] + '?showinfo=0';\n } else if (match = value.match(/^(https?):\\/\\/(www\\.)?vimeo\\.com\\/(\\d+)/)) { // eslint-disable-line no-cond-assign\n value = match[1] + '://player.vimeo.com/video/' + match[3] + '/';\n }\n } // eslint-disable-next-line no-fallthrough\n case 'formula': {\n let range = this.quill.getSelection(true);\n let index = range.index + range.length;\n if (range != null) {\n this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, Emitter.sources.USER);\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER);\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER);\n }\n break;\n }\n default:\n }\n this.textbox.value = '';\n this.hide();\n }\n}\n\n\nfunction fillSelect(select, values, defaultValue = false) {\n values.forEach(function(value) {\n let option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', value);\n }\n select.appendChild(option);\n });\n}\n\n\nexport { BaseTooltip, BaseTheme as default };\n\n\n\n// WEBPACK FOOTER //\n// ./themes/base.js","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport LinkBlot from '../formats/link';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\n\nconst TOOLBAR_CONFIG = [\n [{ header: ['1', '2', '3', false] }],\n ['bold', 'italic', 'underline', 'link'],\n [{ list: 'ordered' }, { list: 'bullet' }],\n ['clean']\n];\n\nclass SnowTheme extends BaseTheme {\n constructor(quill, options) {\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n\n extendToolbar(toolbar) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), icons);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), icons);\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function(range, context) {\n toolbar.handlers['link'].call(toolbar, !context.format.link);\n });\n }\n }\n}\nSnowTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function(value) {\n if (value) {\n let range = this.quill.getSelection();\n if (range == null || range.length == 0) return;\n let preview = this.quill.getText(range);\n if (/^\\S+@\\S+\\.\\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {\n preview = 'mailto:' + preview;\n }\n let tooltip = this.quill.theme.tooltip;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n }\n }\n }\n }\n});\n\n\nclass SnowTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.preview = this.root.querySelector('a.ql-preview');\n }\n\n listen() {\n super.listen();\n this.root.querySelector('a.ql-action').addEventListener('click', (event) => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n this.root.querySelector('a.ql-remove').addEventListener('click', (event) => {\n if (this.linkRange != null) {\n this.restoreFocus();\n this.quill.formatText(this.linkRange, 'link', false, Emitter.sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(Emitter.events.SELECTION_CHANGE, (range) => {\n if (range == null) return;\n if (range.length === 0) {\n let [link, offset] = this.quill.scroll.descendant(LinkBlot, range.index);\n if (link != null) {\n this.linkRange = new Range(range.index - offset, link.length());\n let preview = LinkBlot.formats(link.domNode);\n this.preview.textContent = preview;\n this.preview.setAttribute('href', preview);\n this.show();\n this.position(this.quill.getBounds(this.linkRange));\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.hide();\n });\n }\n\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\nSnowTooltip.TEMPLATE = [\n '',\n '',\n '',\n ''\n].join('');\n\n\nexport default SnowTheme;\n\n\n\n// WEBPACK FOOTER //\n// ./themes/snow.js","var pSlice = Array.prototype.slice;\nvar objectKeys = require('./lib/keys.js');\nvar isArguments = require('./lib/is_arguments.js');\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n if (!opts) opts = {};\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected, opts);\n }\n}\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n}\n\nfunction objEquiv(a, b, opts) {\n var i, key;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n var ka = objectKeys(a),\n kb = objectKeys(b);\n } catch (e) {//happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) return false;\n }\n return typeof a === typeof b;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../delta/~/deep-equal/index.js\n// module id = 22\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///quill.min.js","webpack:///webpack/bootstrap bc1e3bc04ac5f71cbeee","webpack:///./node_modules/parchment/src/parchment.ts","webpack:///./node_modules/parchment/src/registry.ts","webpack:///./node_modules/extend/index.js","webpack:///./blots/block.js","webpack:///./node_modules/quill-delta/lib/delta.js","webpack:///./blots/inline.js","webpack:///./core/quill.js","webpack:///./core/module.js","webpack:///./blots/text.js","webpack:///./core/emitter.js","webpack:///./core/logger.js","webpack:///./node_modules/parchment/src/attributor/attributor.ts","webpack:///./node_modules/deep-equal/index.js","webpack:///./formats/code.js","webpack:///./blots/break.js","webpack:///./formats/link.js","webpack:///./ui/picker.js","webpack:///./node_modules/parchment/src/blot/abstract/container.ts","webpack:///./node_modules/parchment/src/blot/abstract/format.ts","webpack:///./node_modules/parchment/src/blot/abstract/leaf.ts","webpack:///./node_modules/quill-delta/lib/op.js","webpack:///./node_modules/clone/clone.js","webpack:///./core/selection.js","webpack:///./blots/container.js","webpack:///./formats/color.js","webpack:///./modules/keyboard.js","webpack:///./ui/icons.js","webpack:///./node_modules/parchment/src/blot/abstract/shadow.ts","webpack:///./node_modules/parchment/src/attributor/store.ts","webpack:///./node_modules/parchment/src/attributor/class.ts","webpack:///./node_modules/parchment/src/attributor/style.ts","webpack:///./blots/cursor.js","webpack:///./core/theme.js","webpack:///./blots/embed.js","webpack:///./formats/align.js","webpack:///./formats/background.js","webpack:///./formats/direction.js","webpack:///./formats/font.js","webpack:///./formats/size.js","webpack:///./formats/bold.js","webpack:///./assets/icons/code.svg","webpack:///./ui/color-picker.js","webpack:///./ui/icon-picker.js","webpack:///./ui/tooltip.js","webpack:///./themes/base.js","webpack:///./quill.js","webpack:///./core.js","webpack:///./node_modules/parchment/src/collection/linked-list.ts","webpack:///./node_modules/parchment/src/blot/scroll.ts","webpack:///./node_modules/parchment/src/blot/inline.ts","webpack:///./node_modules/parchment/src/blot/block.ts","webpack:///./node_modules/parchment/src/blot/embed.ts","webpack:///./node_modules/parchment/src/blot/text.ts","webpack:///./core/polyfill.js","webpack:///./node_modules/fast-diff/diff.js","webpack:///./node_modules/deep-equal/lib/keys.js","webpack:///./node_modules/deep-equal/lib/is_arguments.js","webpack:///./core/editor.js","webpack:///./node_modules/eventemitter3/index.js","webpack:///./blots/scroll.js","webpack:///./modules/clipboard.js","webpack:///./modules/history.js","webpack:///./formats/indent.js","webpack:///./formats/blockquote.js","webpack:///./formats/header.js","webpack:///./formats/list.js","webpack:///./formats/italic.js","webpack:///./formats/script.js","webpack:///./formats/strike.js","webpack:///./formats/underline.js","webpack:///./formats/image.js","webpack:///./formats/video.js","webpack:///./modules/formula.js","webpack:///./modules/syntax.js","webpack:///./modules/toolbar.js","webpack:///./assets/icons/align-left.svg","webpack:///./assets/icons/align-center.svg","webpack:///./assets/icons/align-right.svg","webpack:///./assets/icons/align-justify.svg","webpack:///./assets/icons/background.svg","webpack:///./assets/icons/blockquote.svg","webpack:///./assets/icons/bold.svg","webpack:///./assets/icons/clean.svg","webpack:///./assets/icons/color.svg","webpack:///./assets/icons/direction-ltr.svg","webpack:///./assets/icons/direction-rtl.svg","webpack:///./assets/icons/float-center.svg","webpack:///./assets/icons/float-full.svg","webpack:///./assets/icons/float-left.svg","webpack:///./assets/icons/float-right.svg","webpack:///./assets/icons/formula.svg","webpack:///./assets/icons/header.svg","webpack:///./assets/icons/header-2.svg","webpack:///./assets/icons/italic.svg","webpack:///./assets/icons/image.svg","webpack:///./assets/icons/indent.svg","webpack:///./assets/icons/outdent.svg","webpack:///./assets/icons/link.svg","webpack:///./assets/icons/list-ordered.svg","webpack:///./assets/icons/list-bullet.svg","webpack:///./assets/icons/list-check.svg","webpack:///./assets/icons/subscript.svg","webpack:///./assets/icons/superscript.svg","webpack:///./assets/icons/strike.svg","webpack:///./assets/icons/underline.svg","webpack:///./assets/icons/video.svg","webpack:///./assets/icons/dropdown.svg","webpack:///./themes/bubble.js","webpack:///./themes/snow.js"],"names":["root","factory","exports","module","define","amd","self","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","value","container_1","format_1","leaf_1","scroll_1","inline_1","block_1","embed_1","text_1","attributor_1","class_1","style_1","store_1","Registry","Parchment","Scope","create","find","query","register","Container","default","Format","Leaf","Embed","Scroll","Block","Inline","Text","Attributor","Attribute","Class","Style","Store","input","match","ParchmentError","BlotClass","Node","TEXT_NODE","node","bubble","DATA_KEY","blot","parentNode","scope","ANY","types","attributes","LEVEL","BLOCK","INLINE","HTMLElement","names","getAttribute","split","classes","tags","tagName","TYPE","Definitions","_i","arguments","length","map","Definition","blotName","attrName","keyName","className","Array","isArray","toUpperCase","tagNames","forEach","tag","__extends","extendStatics","setPrototypeOf","__proto__","b","__","constructor","_super","message","_this","Error","hasOwn","toStr","toString","arr","isPlainObject","obj","hasOwnConstructor","hasIsPrototypeOf","key","extend","options","src","copy","copyIsArray","clone","target","deep","_interopRequireDefault","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","writable","bubbleFormats","formats","undefined","_extend2","parent","statics","BlockEmbed","_createClass","defineProperties","props","descriptor","protoProps","staticProps","_get","receiver","Function","desc","getOwnPropertyDescriptor","getPrototypeOf","_extend","_quillDelta","_quillDelta2","_parchment","_parchment2","_break","_break2","_inline","_inline2","_text","_text2","_Parchment$Embed","apply","domNode","insert","values","attribute","BLOCK_ATTRIBUTE","index","format","def","endsWith","block","insertBefore","next","insertAt","slice","BLOCK_BLOT","_Parchment$Block","_this2","cache","delta","descendants","reduce","leaf","Math","min","lines","text","shift","children","tail","line","ref","head","remove","context","child","force","defaultChild","allowedChildren","diff","equal","op","NULL_CHARACTER","String","fromCharCode","Delta","ops","newOp","keys","push","delete","retain","lastOp","unshift","splice","chop","pop","filter","predicate","partition","passed","failed","initial","changeLength","elem","start","end","Infinity","iter","iterator","hasNext","nextOp","compose","other","thisIter","otherIter","peekType","peekLength","thisOp","otherOp","concat","strings","prep","join","diffResult","component","opLength","INSERT","DELETE","EQUAL","eachLine","newline","peek","indexOf","transform","priority","transformPosition","offset","nextType","_Parchment$Inline","compare","BLOT","isolate","wrap","moveChildren","selfIndex","order","otherIndex","_defineProperty","expandConfig","container","userConfig","clipboard","keyboard","history","theme","Quill","DEFAULTS","import","_theme2","themeConfig","config","moduleNames","moduleConfig","moduleClass","debug","error","toolbar","document","querySelector","modify","modifier","source","strict","isEnabled","_emitter4","sources","USER","range","getSelection","oldDelta","editor","change","shiftRange","setSelection","SILENT","_emitter","args","events","TEXT_CHANGE","emitter","emit","EDITOR_CHANGE","_emitter2","overload","_typeof","API","_map","pos","_map2","_slicedToArray","_map3","max","_map4","_selection","Range","Symbol","sliceIterator","_arr","_n","_d","_e","_s","done","err","_editor","_editor2","_emitter3","_module","_module2","_selection2","_logger","_logger2","_theme","html","innerHTML","trim","classList","add","__quill","addContainer","setAttribute","scrollingContainer","scroll","whitelist","selection","addModule","init","on","type","toggle","isBlank","SCROLL_UPDATE","mutations","lastRange","update","contents","convert","setContents","clear","placeholder","readOnly","disable","limit","level","imports","path","overwrite","warn","startsWith","refNode","createElement","setRange","_this3","_overload","_overload2","deleteText","enable","enabled","scrollTop","focus","scrollIntoView","_this4","formatLine","formatText","_this5","_overload3","_overload4","_this6","_overload5","_overload6","bounds","getBounds","containerBounds","getBoundingClientRect","bottom","top","height","left","right","width","getLength","_overload7","_overload8","getContents","getFormat","Number","MAX_VALUE","getRange","_overload9","_overload10","getText","hasFocus","embed","_this7","insertEmbed","_this8","_overload11","_overload12","insertText","contains","off","once","dangerouslyPasteHTML","_this9","_overload13","_overload14","removeFormat","_this10","deleted","applied","applyDelta","_overload15","_overload16","_this11","version","parchment","core/module","core/theme","Module","quill","TextBlot","_Parchment$Text","_eventemitter","_eventemitter2","eventName","addEventListener","_len","_key","querySelectorAll","_node$__quill$emitter","handleDOM","Emitter","_EventEmitter","listeners","log","event","_len2","_key2","_ref","handler","SCROLL_BEFORE_UPDATE","SCROLL_OPTIMIZE","SELECTION_CHANGE","method","levels","_console","console","namespace","ns","logger","bind","newLevel","attributeBit","ATTRIBUTE","item","canAdd","replace","removeAttribute","isUndefinedOrNull","isBuffer","x","objEquiv","a","opts","isArguments","pSlice","deepEqual","ka","objectKeys","kb","e","sort","actual","expected","Date","getTime","Code","_block","_block2","_Inline","CodeBlock","_Block","textContent","frag","_descendant","descendant","_descendant2","deleteAt","nextNewline","newlineIndex","prevNewline","isolateLength","formatAt","_descendant3","_descendant4","searchIndex","lastIndexOf","appendChild","prev","optimize","removeChild","unwrap","TAB","Break","sanitize","url","protocols","anchor","href","protocol","Link","PROTOCOL_WHITELIST","SANITIZED_URL","toggleAriaAttribute","element","_keyboard","_keyboard2","_dropdown","_dropdown2","optionsCounter","Picker","select","buildPicker","style","display","label","togglePicker","keyCode","ENTER","ESCAPE","escape","preventDefault","option","tabIndex","hasAttribute","selectItem","id","buildItem","selected","buildLabel","buildOptions","close","setTimeout","trigger","selectedIndex","Event","dispatchEvent","createEvent","initEvent","isActive","makeBlot","childNodes","replaceChild","attach","linked_list_1","shadow_1","ContainerBlot","build","reverse","forEachAt","criteria","_a","lengthLeft","detach","childBlot","refBlot","some","insertInto","memo","targetParent","inclusive","position","after","addedNodes","removedNodes","mutation","body","compareDocumentPosition","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_FOLLOWING","nextSibling","FormatBlot","toLowerCase","replaceWith","replacement","wrapper","move","LeafBlot","INLINE_BLOT","Iterator","lib","keepNull","retOp","substr","_instanceof","circular","depth","includeNonEnumerable","_clone","proto","nativeMap","nativeSet","nativePromise","resolve","reject","then","__isArray","__isRegExp","RegExp","__getRegExpFlags","lastIndex","__isDate","useBuffer","Buffer","allParents","allChildren","keyChild","valueChild","set","entryChild","attrs","getOwnPropertySymbols","symbols","symbol","allPropertyNames","getOwnPropertyNames","propertyName","__objToStr","re","flags","global","ignoreCase","multiline","Map","_","Set","Promise","clonePrototype","_toConsumableArray","arr2","from","_clone2","_deepEqual","_deepEqual2","Selection","composing","mouseDown","cursor","savedRange","handleComposition","handleDragging","listenDOM","native","getNativeRange","textNode","setNativeRange","ignored","_context$range","startNode","startOffset","endNode","endOffset","restore","nativeRange","collapsed","data","scrollLength","_scroll$leaf","_scroll$leaf2","_leaf$position","_leaf$position2","createRange","setStart","_scroll$leaf3","_scroll$leaf4","_leaf$position3","_leaf$position4","setEnd","side","rect","rangeCount","getRangeAt","normalizeNative","info","normalized","normalizedToRange","activeElement","positions","indexes","_position","startContainer","endContainer","lastChild","_scroll$leaf5","_scroll$leaf6","_leaf$position5","_leaf$position6","_scroll$line","_scroll$line2","first","last","_scroll$line3","scrollBounds","removeAllRanges","addRange","blur","rangeToNative","oldRange","_getRange","_getRange2","_Parchment$Container","ColorStyle","ColorClass","ColorAttributor","_Parchment$Attributor","parseInt","makeEmbedArrowHandler","shiftKey","_ref3","where","Keyboard","LEFT","altKey","RIGHT","_quill$getLeaf3","getLeaf","_quill2","handleBackspace","_quill$getLine11","getLine","_quill$getLine12","_quill$getLine13","_quill$getLine14","curFormats","prevFormats","_op2","test","prefix","handleDelete","suffix","nextLength","_quill$getLine15","_quill$getLine16","_quill$getLine17","_quill$getLine18","nextFormats","handleDeleteRange","getLines","firstFormats","lastFormats","handleEnter","lineFormats","makeCodeBlockHandler","indent","code-block","_quill$scroll$descend","_quill$scroll$descend2","scrollIndex","getIndex","makeFormatHandler","shortKey","normalize","binding","charCodeAt","SHORTKEY","_op","_quill","navigator","platform","_Module","bindings","addBinding","metaKey","ctrlKey","userAgent","BACKSPACE","listen","evt","which","defaultPrevented","_quill$getLine","_quill$getLine2","_quill$getLeaf","_quill$getLeaf2","leafStart","offsetStart","_ref2","leafEnd","offsetEnd","prefixText","suffixText","curContext","empty","every","UP","DOWN","bold","italic","underline","outdent","outdent backspace","list","indent code-block","outdent code-block","remove tab","tab","cutoff","updateContents","list empty enter","checklist enter","_quill$getLine3","_quill$getLine4","header enter","_quill$getLine5","_quill$getLine6","header","list autofill","_quill$getLine7","_quill$getLine8","code exit","_quill$getLine9","_quill$getLine10","embed left","embed left shift","embed right","embed right shift","align","","center","justify","background","blockquote","clean","code","color","direction","rtl","float","full","formula","1","2","image","+1","-1","link","ordered","bullet","check","script","sub","super","strike","video","ShadowBlot","cloneNode","parentBlot","refDomNode","AttributorStore","styles","attr","ClassAttributor","result","camelize","parts","rest","part","StyleAttributor","Cursor","createTextNode","CONTENTS","_length","restoreText","Theme","themes","GUARD_TEXT","contentNode","childNode","leftGuard","rightGuard","prevLength","AlignStyle","AlignClass","AlignAttribute","BackgroundStyle","BackgroundClass","_color","DirectionStyle","DirectionClass","DirectionAttribute","FontClass","FontStyle","FontStyleAttributor","SizeStyle","SizeClass","Bold","_picker","_picker2","ColorPicker","_Picker","backgroundColor","colorLabel","stroke","fill","IconPicker","icons","defaultItem","Tooltip","boundsContainer","TEMPLATE","marginTop","hide","reference","offsetWidth","rootBounds","verticalShift","extractVideoUrl","fillSelect","defaultValue","BaseTooltip","_colorPicker","_colorPicker2","_iconPicker","_iconPicker2","_tooltip","_tooltip2","ALIGNS","COLORS","FONTS","HEADERS","SIZES","BaseTheme","_Theme","listener","removeEventListener","tooltip","textbox","pickers","picker","extendToolbar","buttons","button","selects","handlers","edit","fileInput","files","reader","FileReader","onload","readAsDataURL","click","_Tooltip","save","cancel","mode","preview","linkRange","restoreFocus","_core","_core2","_align","_direction","_indent","_blockquote","_blockquote2","_header","_header2","_list","_list2","_background","_font","_size","_bold","_bold2","_italic","_italic2","_link","_link2","_script","_script2","_strike","_strike2","_underline","_underline2","_image","_image2","_video","_video2","_code","_code2","_formula","_formula2","_syntax","_syntax2","_toolbar","_toolbar2","_icons","_icons2","_bubble","_bubble2","_snow","_snow2","attributors/attribute/direction","attributors/class/align","attributors/class/background","attributors/class/color","attributors/class/direction","attributors/class/font","attributors/class/size","attributors/style/align","attributors/style/background","attributors/style/color","attributors/style/direction","attributors/style/font","attributors/style/size","formats/align","formats/direction","formats/indent","IndentClass","formats/background","formats/color","formats/font","formats/size","formats/blockquote","formats/code-block","formats/header","formats/list","formats/bold","formats/code","formats/italic","formats/link","formats/script","formats/strike","formats/underline","formats/image","formats/video","formats/list/item","ListItem","modules/formula","modules/syntax","modules/toolbar","themes/bubble","themes/snow","ui/icons","ui/picker","ui/icon-picker","ui/color-picker","ui/tooltip","_container","_container2","_cursor","_cursor2","_embed","_embed2","_scroll","_scroll2","_clipboard","_clipboard2","_history","_history2","blots/block","blots/block/embed","blots/break","blots/container","blots/cursor","blots/embed","blots/inline","blots/scroll","blots/text","modules/clipboard","modules/history","modules/keyboard","LinkedList","append","nodes","cur","curNode","ret","callback","curIndex","curLength","OBSERVER_CONFIG","characterData","characterDataOldValue","childList","subtree","ScrollBlot","observer","MutationObserver","observe","disconnect","records","takeRecords","mark","markParent","remaining","previousSibling","grandChild","isEqual","obj1","obj2","prop","InlineBlot","BlockBlot","EmbedBlot","splitText","_toggle","DOMTokenList","token","searchString","subjectString","isFinite","floor","thisArg","execCommand","diff_main","text1","text2","cursor_pos","DIFF_EQUAL","commonlength","diff_commonPrefix","commonprefix","substring","diff_commonSuffix","commonsuffix","diffs","diff_compute_","diff_cleanupMerge","fix_cursor","fix_emoji","DIFF_INSERT","DIFF_DELETE","longtext","shorttext","hm","diff_halfMatch_","text1_a","text1_b","text2_a","text2_b","mid_common","diffs_a","diffs_b","diff_bisect_","text1_length","text2_length","max_d","ceil","v_offset","v_length","v1","v2","front","k1start","k1end","k2start","k2end","k1","x1","k1_offset","y1","charAt","k2_offset","x2","diff_bisectSplit_","k2","y2","y","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","pointerend","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","j","best_common","prefixLength","suffixLength","hm1","hm2","pointer","count_delete","count_insert","text_delete","text_insert","changes","cursor_normalize_diff","current_pos","next_pos","split_pos","d_left","d_right","norm","ndiffs","cursor_pointer","d_next","merge_tuples","compact","starts_with_pair_end","str","fixed_diffs","left_d","right_d","shim","supported","unsupported","propertyIsEnumerable","supportsArgumentsClass","combineFormats","combined","merged","normalizeDelta","ASCII","Editor","getDelta","consumeNextNewline","batchStart","_line$descendant","_line$descendant2","batchEnd","lengthRemaining","lineLength","codeIndex","codeLength","leaves","_path","formatsArr","blots","_scroll$line4","cursorIndex","textBlot","oldValue","oldText","newText","Events","EE","fn","EventEmitter","_events","_eventsCount","has","eventNames","exists","available","ee","a1","a2","a3","a4","a5","len","removeListener","removeAllListeners","addListener","setMaxListeners","prefixed","isLine","_Parchment$Scroll","batch","_line","_line2","_line3","_line4","applyFormat","_extend3","computeStyle","nodeType","ELEMENT_NODE","window","getComputedStyle","deltaEndsWith","endText","traverse","elementMatchers","textMatchers","matcher","childrenDelta","DOM_KEY","matchAlias","matchAttributor","ATTRIBUTE_ATTRIBUTORS","STYLE_ATTRIBUTORS","matchBlot","matchBreak","matchIgnore","matchIndent","matchNewline","matchSpacing","nextElementSibling","nodeHeight","offsetHeight","parseFloat","marginBottom","offsetTop","matchStyles","fontStyle","fontWeight","textIndent","matchText","whiteSpace","replacer","collapse","CLIPBOARD_CONFIG","Clipboard","onPaste","matchers","selector","matchVisual","addMatcher","innerText","_prepareMatching","prepareMatching","_prepareMatching2","paste","pair","_pair","endsWithNewlineChange","getLastChangeIndex","deleteLength","changeIndex","History","lastRecorded","ignoreChange","userOnly","record","undo","redo","dest","stack","changeDelta","undoDelta","timestamp","now","delay","maxStack","IdentAttributor","Blockquote","Header","List","_Container","listEventHandler","Italic","_Bold","Script","Strike","Underline","ATTRIBUTES","Image","Video","_BlockEmbed","FormulaBlot","_Embed","katex","render","throwOnError","errorColor","Formula","CodeToken","SyntaxCodeBlock","_CodeBlock","highlight","cachedText","Syntax","timer","clearTimeout","interval","hljs","highlightAuto","addButton","addControls","groups","controls","group","control","addSelect","Toolbar","_ret","addHandler","_this$quill$selection","_this$quill$selection2","_quill$selection$getR","_quill$selection$getR2","prompt","BubbleTooltip","_base","_base2","TOOLBAR_CONFIG","BubbleTheme","_BaseTheme","buildButtons","buildPickers","_BaseTooltip","show","lastLine","arrow","marginLeft","SnowTheme","SnowTooltip"],"mappings":";;;;;;CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,S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iB,SAEP37B,KAAK+c,MAAM5F,GAAG7C,EAAAtR,QAAQiR,OAAOqK,iBAAkB,SAAC/K,EAAOwb,EAAU9b,GAC/D,GAAa,MAATM,EAAJ,CACA,GAAqB,IAAjBA,EAAM7N,QAAgBuN,IAAWqB,EAAAtR,QAAQqQ,QAAQC,KAAM,IAAAye,GACpCnZ,EAAKmE,MAAMjG,OAAOmK,WAAlB6e,EAAA98B,QAAuCuQ,EAAMpI,OADT6mB,EAAAnd,EAAAkd,EAAA,GACpD0F,EADoDzF,EAAA,GAC9ClhB,EAD8CkhB,EAAA,EAEzD,IAAY,MAARyF,EAAc,CAChB7e,EAAK6lB,UAAY,GAAAxpB,GAAAC,MAAU3B,EAAMpI,MAAQ2F,EAAQ2mB,EAAK/xB,SACtD,IAAI84B,GAAUsB,EAAA98B,QAAS+F,QAAQ0uB,EAAK3sB,QAKpC,OAJA8N,GAAK4lB,QAAQ1d,YAAc0d,EAC3B5lB,EAAK4lB,QAAQ5nB,aAAa,OAAQ4nB,GAClC5lB,EAAK4hC,WACL5hC,GAAK2N,SAAS3N,EAAKmE,MAAMhD,UAAUnB,EAAK6lB,wBAInC7lB,GAAK6lB,SAEd7lB,GAAK+iB,a9GmmWPj0B,IAAK,OACL/F,MAAO,W8G/lWPgI,EAAAkxC,EAAAt5C,UAAAmF,WAAA5F,OAAAkJ,eAAA6wC,EAAAt5C,WAAA,OAAAvB,MAAAO,KAAAP,MACAA,KAAKP,KAAK4f,gBAAgB,iB9GomWrBw7B,GACPb,EAAM7d,Y8GlmWR0e,GAAYpf,UACV,gEACA,mGACA,4BACA,6BACAzrB,KAAK,I9GimWPrQ,EAAQqD,Q8G9lWO43C,K9GimWM","file":"quill.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","/*!\n * Quill Editor v1.3.6\n * https://quilljs.com/\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 45);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = __webpack_require__(17);\nvar format_1 = __webpack_require__(18);\nvar leaf_1 = __webpack_require__(19);\nvar scroll_1 = __webpack_require__(48);\nvar inline_1 = __webpack_require__(49);\nvar block_1 = __webpack_require__(50);\nvar embed_1 = __webpack_require__(51);\nvar text_1 = __webpack_require__(52);\nvar attributor_1 = __webpack_require__(11);\nvar class_1 = __webpack_require__(29);\nvar style_1 = __webpack_require__(30);\nvar store_1 = __webpack_require__(28);\nvar Registry = __webpack_require__(1);\nvar Parchment = {\n Scope: Registry.Scope,\n create: Registry.create,\n find: Registry.find,\n query: Registry.query,\n register: Registry.register,\n Container: container_1.default,\n Format: format_1.default,\n Leaf: leaf_1.default,\n Embed: embed_1.default,\n Scroll: scroll_1.default,\n Block: block_1.default,\n Inline: inline_1.default,\n Text: text_1.default,\n Attributor: {\n Attribute: attributor_1.default,\n Class: class_1.default,\n Style: style_1.default,\n Store: store_1.default,\n },\n};\nexports.default = Parchment;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ParchmentError = /** @class */ (function (_super) {\n __extends(ParchmentError, _super);\n function ParchmentError(message) {\n var _this = this;\n message = '[Parchment] ' + message;\n _this = _super.call(this, message) || this;\n _this.message = message;\n _this.name = _this.constructor.name;\n return _this;\n }\n return ParchmentError;\n}(Error));\nexports.ParchmentError = ParchmentError;\nvar attributes = {};\nvar classes = {};\nvar tags = {};\nvar types = {};\nexports.DATA_KEY = '__blot';\nvar Scope;\n(function (Scope) {\n Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n})(Scope = exports.Scope || (exports.Scope = {}));\nfunction create(input, value) {\n var match = query(input);\n if (match == null) {\n throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n }\n var BlotClass = match;\n var node = \n // @ts-ignore\n input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value);\n return new BlotClass(node, value);\n}\nexports.create = create;\nfunction find(node, bubble) {\n if (bubble === void 0) { bubble = false; }\n if (node == null)\n return null;\n // @ts-ignore\n if (node[exports.DATA_KEY] != null)\n return node[exports.DATA_KEY].blot;\n if (bubble)\n return find(node.parentNode, bubble);\n return null;\n}\nexports.find = find;\nfunction query(query, scope) {\n if (scope === void 0) { scope = Scope.ANY; }\n var match;\n if (typeof query === 'string') {\n match = types[query] || attributes[query];\n // @ts-ignore\n }\n else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) {\n match = types['text'];\n }\n else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = types['block'];\n }\n else if (query & Scope.LEVEL & Scope.INLINE) {\n match = types['inline'];\n }\n }\n else if (query instanceof HTMLElement) {\n var names = (query.getAttribute('class') || '').split(/\\s+/);\n for (var i in names) {\n match = classes[names[i]];\n if (match)\n break;\n }\n match = match || tags[query.tagName];\n }\n if (match == null)\n return null;\n // @ts-ignore\n if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)\n return match;\n return null;\n}\nexports.query = query;\nfunction register() {\n var Definitions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n Definitions[_i] = arguments[_i];\n }\n if (Definitions.length > 1) {\n return Definitions.map(function (d) {\n return register(d);\n });\n }\n var Definition = Definitions[0];\n if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n throw new ParchmentError('Invalid definition');\n }\n else if (Definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n types[Definition.blotName || Definition.attrName] = Definition;\n if (typeof Definition.keyName === 'string') {\n attributes[Definition.keyName] = Definition;\n }\n else {\n if (Definition.className != null) {\n classes[Definition.className] = Definition;\n }\n if (Definition.tagName != null) {\n if (Array.isArray(Definition.tagName)) {\n Definition.tagName = Definition.tagName.map(function (tagName) {\n return tagName.toUpperCase();\n });\n }\n else {\n Definition.tagName = Definition.tagName.toUpperCase();\n }\n var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n tagNames.forEach(function (tag) {\n if (tags[tag] == null || Definition.className == null) {\n tags[tag] = Definition;\n }\n });\n }\n }\n return Definition;\n}\nexports.register = register;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = target[name];\n\t\t\t\tcopy = options[name];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\ttarget[name] = extend(deep, clone, copy);\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.BlockEmbed = exports.bubbleFormats = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _break = __webpack_require__(14);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar NEWLINE_LENGTH = 1;\n\nvar BlockEmbed = function (_Parchment$Embed) {\n _inherits(BlockEmbed, _Parchment$Embed);\n\n function BlockEmbed() {\n _classCallCheck(this, BlockEmbed);\n\n return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments));\n }\n\n _createClass(BlockEmbed, [{\n key: 'attach',\n value: function attach() {\n _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this);\n this.attributes = new _parchment2.default.Attributor.Store(this.domNode);\n }\n }, {\n key: 'delta',\n value: function delta() {\n return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values()));\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n this.format(name, value);\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n var block = _parchment2.default.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def);\n }\n }\n }]);\n\n return BlockEmbed;\n}(_parchment2.default.Embed);\n\nBlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\n\nvar Block = function (_Parchment$Block) {\n _inherits(Block, _Parchment$Block);\n\n function Block(domNode) {\n _classCallCheck(this, Block);\n\n var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode));\n\n _this2.cache = {};\n return _this2;\n }\n\n _createClass(Block, [{\n key: 'delta',\n value: function delta() {\n if (this.cache.delta == null) {\n this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) {\n if (leaf.length() === 0) {\n return delta;\n } else {\n return delta.insert(leaf.value(), bubbleFormats(leaf));\n }\n }, new _quillDelta2.default()).insert('\\n', bubbleFormats(this));\n }\n return this.cache.delta;\n }\n }, {\n key: 'deleteAt',\n value: function deleteAt(index, length) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length);\n this.cache = {};\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value);\n }\n this.cache = {};\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def);\n if (value.length === 0) return;\n var lines = value.split('\\n');\n var text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n var block = this;\n lines.reduce(function (index, line) {\n block = block.split(index, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n }, {\n key: 'insertBefore',\n value: function insertBefore(blot, ref) {\n var head = this.children.head;\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref);\n if (head instanceof _break2.default) {\n head.remove();\n }\n this.cache = {};\n }\n }, {\n key: 'length',\n value: function length() {\n if (this.cache.length == null) {\n this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n }, {\n key: 'moveChildren',\n value: function moveChildren(target, ref) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref);\n this.cache = {};\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context);\n this.cache = {};\n }\n }, {\n key: 'path',\n value: function path(index) {\n return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true);\n }\n }, {\n key: 'removeChild',\n value: function removeChild(child) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child);\n this.cache = {};\n }\n }, {\n key: 'split',\n value: function split(index) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n var clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n } else {\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n } else {\n var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force);\n this.cache = {};\n return next;\n }\n }\n }]);\n\n return Block;\n}(_parchment2.default.Block);\n\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = 'break';\nBlock.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default];\n\nfunction bubbleFormats(blot) {\n var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = (0, _extend2.default)(formats, blot.formats());\n }\n if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats);\n}\n\nexports.bubbleFormats = bubbleFormats;\nexports.BlockEmbed = BlockEmbed;\nexports.default = Block;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar diff = __webpack_require__(54);\nvar equal = __webpack_require__(12);\nvar extend = __webpack_require__(2);\nvar op = __webpack_require__(20);\n\n\nvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\n\nvar Delta = function (ops) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n};\n\n\nDelta.prototype.insert = function (text, attributes) {\n var newOp = {};\n if (text.length === 0) return this;\n newOp.insert = text;\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype['delete'] = function (length) {\n if (length <= 0) return this;\n return this.push({ 'delete': length });\n};\n\nDelta.prototype.retain = function (length, attributes) {\n if (length <= 0) return this;\n var newOp = { retain: length };\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype.push = function (newOp) {\n var index = this.ops.length;\n var lastOp = this.ops[index - 1];\n newOp = extend(true, {}, newOp);\n if (typeof lastOp === 'object') {\n if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {\n this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (equal(newOp.attributes, lastOp.attributes)) {\n if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n};\n\nDelta.prototype.chop = function () {\n var lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n};\n\nDelta.prototype.filter = function (predicate) {\n return this.ops.filter(predicate);\n};\n\nDelta.prototype.forEach = function (predicate) {\n this.ops.forEach(predicate);\n};\n\nDelta.prototype.map = function (predicate) {\n return this.ops.map(predicate);\n};\n\nDelta.prototype.partition = function (predicate) {\n var passed = [], failed = [];\n this.forEach(function(op) {\n var target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n};\n\nDelta.prototype.reduce = function (predicate, initial) {\n return this.ops.reduce(predicate, initial);\n};\n\nDelta.prototype.changeLength = function () {\n return this.reduce(function (length, elem) {\n if (elem.insert) {\n return length + op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n};\n\nDelta.prototype.length = function () {\n return this.reduce(function (length, elem) {\n return length + op.length(elem);\n }, 0);\n};\n\nDelta.prototype.slice = function (start, end) {\n start = start || 0;\n if (typeof end !== 'number') end = Infinity;\n var ops = [];\n var iter = op.iterator(this.ops);\n var index = 0;\n while (index < end && iter.hasNext()) {\n var nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += op.length(nextOp);\n }\n return new Delta(ops);\n};\n\n\nDelta.prototype.compose = function (other) {\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (typeof otherOp.retain === 'number') {\n var newOp = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length;\n } else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n if (attributes) newOp.attributes = attributes;\n delta.push(newOp);\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.concat = function (other) {\n var delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n};\n\nDelta.prototype.diff = function (other, index) {\n if (this.ops === other.ops) {\n return new Delta();\n }\n var strings = [this, other].map(function (delta) {\n return delta.map(function (op) {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n var prep = (delta === other) ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n }).join('');\n });\n var delta = new Delta();\n var diffResult = diff(strings[0], strings[1], index);\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n diffResult.forEach(function (component) {\n var length = component[1].length;\n while (length > 0) {\n var opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n delta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n delta['delete'](opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n var thisOp = thisIter.next(opLength);\n var otherOp = otherIter.next(opLength);\n if (equal(thisOp.insert, otherOp.insert)) {\n delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));\n } else {\n delta.push(otherOp)['delete'](opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return delta.chop();\n};\n\nDelta.prototype.eachLine = function (predicate, newline) {\n newline = newline || '\\n';\n var iter = op.iterator(this.ops);\n var line = new Delta();\n var i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') return;\n var thisOp = iter.peek();\n var start = op.length(thisOp) - iter.peekLength();\n var index = typeof thisOp.insert === 'string' ?\n thisOp.insert.indexOf(newline, start) - start : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n};\n\nDelta.prototype.transform = function (other, priority) {\n priority = !!priority;\n if (typeof other === 'number') {\n return this.transformPosition(other, priority);\n }\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {\n delta.retain(op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (thisOp['delete']) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp['delete']) {\n delta.push(otherOp);\n } else {\n // We retain either their retain or insert\n delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.transformPosition = function (index, priority) {\n priority = !!priority;\n var thisIter = op.iterator(this.ops);\n var offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n var length = thisIter.peekLength();\n var nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n};\n\n\nmodule.exports = Delta;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Inline = function (_Parchment$Inline) {\n _inherits(Inline, _Parchment$Inline);\n\n function Inline() {\n _classCallCheck(this, Inline);\n\n return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments));\n }\n\n _createClass(Inline, [{\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) {\n var blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value);\n }\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context);\n if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n var parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n }], [{\n key: 'compare',\n value: function compare(self, other) {\n var selfIndex = Inline.order.indexOf(self);\n var otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n } else if (self === other) {\n return 0;\n } else if (self < other) {\n return -1;\n } else {\n return 1;\n }\n }\n }]);\n\n return Inline;\n}(_parchment2.default.Inline);\n\nInline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = ['cursor', 'inline', // Must be lower\n'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher\n];\n\nexports.default = Inline;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.overload = exports.expandConfig = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\n__webpack_require__(53);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _editor = __webpack_require__(57);\n\nvar _editor2 = _interopRequireDefault(_editor);\n\nvar _emitter3 = __webpack_require__(9);\n\nvar _emitter4 = _interopRequireDefault(_emitter3);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _selection = __webpack_require__(22);\n\nvar _selection2 = _interopRequireDefault(_selection);\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _theme = __webpack_require__(32);\n\nvar _theme2 = _interopRequireDefault(_theme);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar debug = (0, _logger2.default)('quill');\n\nvar Quill = function () {\n _createClass(Quill, null, [{\n key: 'debug',\n value: function debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n _logger2.default.level(limit);\n }\n }, {\n key: 'find',\n value: function find(node) {\n return node.__quill || _parchment2.default.find(node);\n }\n }, {\n key: 'import',\n value: function _import(name) {\n if (this.imports[name] == null) {\n debug.error('Cannot import ' + name + '. Are you sure it was registered?');\n }\n return this.imports[name];\n }\n }, {\n key: 'register',\n value: function register(path, target) {\n var _this = this;\n\n var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof path !== 'string') {\n var name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register('formats/' + name, path, target);\n } else {\n Object.keys(path).forEach(function (key) {\n _this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn('Overwriting ' + path + ' with', target);\n }\n this.imports[path] = target;\n if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') {\n _parchment2.default.register(target);\n } else if (path.startsWith('modules') && typeof target.register === 'function') {\n target.register();\n }\n }\n }\n }]);\n\n function Quill(container) {\n var _this2 = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Quill);\n\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n var html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n this.container.__quill = this;\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new _emitter4.default();\n this.scroll = _parchment2.default.create(this.root, {\n emitter: this.emitter,\n whitelist: this.options.formats\n });\n this.editor = new _editor2.default(this.scroll);\n this.selection = new _selection2.default(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options);\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.theme.init();\n this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) {\n if (type === _emitter4.default.events.TEXT_CHANGE) {\n _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank());\n }\n });\n this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) {\n var range = _this2.selection.lastRange;\n var index = range && range.length === 0 ? range.index : undefined;\n modify.call(_this2, function () {\n return _this2.editor.update(null, mutations, index);\n }, source);\n });\n var contents = this.clipboard.convert('
    ' + html + '


    ');\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n }\n\n _createClass(Quill, [{\n key: 'addContainer',\n value: function addContainer(container) {\n var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (typeof container === 'string') {\n var className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n }, {\n key: 'blur',\n value: function blur() {\n this.selection.setRange(null);\n }\n }, {\n key: 'deleteText',\n value: function deleteText(index, length, source) {\n var _this3 = this;\n\n var _overload = overload(index, length, source);\n\n var _overload2 = _slicedToArray(_overload, 4);\n\n index = _overload2[0];\n length = _overload2[1];\n source = _overload2[3];\n\n return modify.call(this, function () {\n return _this3.editor.deleteText(index, length);\n }, source, index, -1 * length);\n }\n }, {\n key: 'disable',\n value: function disable() {\n this.enable(false);\n }\n }, {\n key: 'enable',\n value: function enable() {\n var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n }, {\n key: 'focus',\n value: function focus() {\n var scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n var _this4 = this;\n\n var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;\n\n return modify.call(this, function () {\n var range = _this4.getSelection(true);\n var change = new _quillDelta2.default();\n if (range == null) {\n return change;\n } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {\n change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value));\n } else if (range.length === 0) {\n _this4.selection.format(name, value);\n return change;\n } else {\n change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value));\n }\n _this4.setSelection(range, _emitter4.default.sources.SILENT);\n return change;\n }, source);\n }\n }, {\n key: 'formatLine',\n value: function formatLine(index, length, name, value, source) {\n var _this5 = this;\n\n var formats = void 0;\n\n var _overload3 = overload(index, length, name, value, source);\n\n var _overload4 = _slicedToArray(_overload3, 4);\n\n index = _overload4[0];\n length = _overload4[1];\n formats = _overload4[2];\n source = _overload4[3];\n\n return modify.call(this, function () {\n return _this5.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n }, {\n key: 'formatText',\n value: function formatText(index, length, name, value, source) {\n var _this6 = this;\n\n var formats = void 0;\n\n var _overload5 = overload(index, length, name, value, source);\n\n var _overload6 = _slicedToArray(_overload5, 4);\n\n index = _overload6[0];\n length = _overload6[1];\n formats = _overload6[2];\n source = _overload6[3];\n\n return modify.call(this, function () {\n return _this6.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n }, {\n key: 'getBounds',\n value: function getBounds(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var bounds = void 0;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n var containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n }, {\n key: 'getContents',\n value: function getContents() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload7 = overload(index, length);\n\n var _overload8 = _slicedToArray(_overload7, 2);\n\n index = _overload8[0];\n length = _overload8[1];\n\n return this.editor.getContents(index, length);\n }\n }, {\n key: 'getFormat',\n value: function getFormat() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n } else {\n return this.editor.getFormat(index.index, index.length);\n }\n }\n }, {\n key: 'getIndex',\n value: function getIndex(blot) {\n return blot.offset(this.scroll);\n }\n }, {\n key: 'getLength',\n value: function getLength() {\n return this.scroll.length();\n }\n }, {\n key: 'getLeaf',\n value: function getLeaf(index) {\n return this.scroll.leaf(index);\n }\n }, {\n key: 'getLine',\n value: function getLine(index) {\n return this.scroll.line(index);\n }\n }, {\n key: 'getLines',\n value: function getLines() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n } else {\n return this.scroll.lines(index, length);\n }\n }\n }, {\n key: 'getModule',\n value: function getModule(name) {\n return this.theme.modules[name];\n }\n }, {\n key: 'getSelection',\n value: function getSelection() {\n var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n }, {\n key: 'getText',\n value: function getText() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload9 = overload(index, length);\n\n var _overload10 = _slicedToArray(_overload9, 2);\n\n index = _overload10[0];\n length = _overload10[1];\n\n return this.editor.getText(index, length);\n }\n }, {\n key: 'hasFocus',\n value: function hasFocus() {\n return this.selection.hasFocus();\n }\n }, {\n key: 'insertEmbed',\n value: function insertEmbed(index, embed, value) {\n var _this7 = this;\n\n var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n\n return modify.call(this, function () {\n return _this7.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n }, {\n key: 'insertText',\n value: function insertText(index, text, name, value, source) {\n var _this8 = this;\n\n var formats = void 0;\n\n var _overload11 = overload(index, 0, name, value, source);\n\n var _overload12 = _slicedToArray(_overload11, 4);\n\n index = _overload12[0];\n formats = _overload12[2];\n source = _overload12[3];\n\n return modify.call(this, function () {\n return _this8.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n }, {\n key: 'isEnabled',\n value: function isEnabled() {\n return !this.container.classList.contains('ql-disabled');\n }\n }, {\n key: 'off',\n value: function off() {\n return this.emitter.off.apply(this.emitter, arguments);\n }\n }, {\n key: 'on',\n value: function on() {\n return this.emitter.on.apply(this.emitter, arguments);\n }\n }, {\n key: 'once',\n value: function once() {\n return this.emitter.once.apply(this.emitter, arguments);\n }\n }, {\n key: 'pasteHTML',\n value: function pasteHTML(index, html, source) {\n this.clipboard.dangerouslyPasteHTML(index, html, source);\n }\n }, {\n key: 'removeFormat',\n value: function removeFormat(index, length, source) {\n var _this9 = this;\n\n var _overload13 = overload(index, length, source);\n\n var _overload14 = _slicedToArray(_overload13, 4);\n\n index = _overload14[0];\n length = _overload14[1];\n source = _overload14[3];\n\n return modify.call(this, function () {\n return _this9.editor.removeFormat(index, length);\n }, source, index);\n }\n }, {\n key: 'scrollIntoView',\n value: function scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }, {\n key: 'setContents',\n value: function setContents(delta) {\n var _this10 = this;\n\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\n return modify.call(this, function () {\n delta = new _quillDelta2.default(delta);\n var length = _this10.getLength();\n var deleted = _this10.editor.deleteText(0, length);\n var applied = _this10.editor.applyDelta(delta);\n var lastOp = applied.ops[applied.ops.length - 1];\n if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\\n') {\n _this10.editor.deleteText(_this10.getLength() - 1, 1);\n applied.delete(1);\n }\n var ret = deleted.compose(applied);\n return ret;\n }, source);\n }\n }, {\n key: 'setSelection',\n value: function setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n var _overload15 = overload(index, length, source);\n\n var _overload16 = _slicedToArray(_overload15, 4);\n\n index = _overload16[0];\n length = _overload16[1];\n source = _overload16[3];\n\n this.selection.setRange(new _selection.Range(index, length), source);\n if (source !== _emitter4.default.sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n }, {\n key: 'setText',\n value: function setText(text) {\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\n var delta = new _quillDelta2.default().insert(text);\n return this.setContents(delta, source);\n }\n }, {\n key: 'update',\n value: function update() {\n var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;\n\n var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n return change;\n }\n }, {\n key: 'updateContents',\n value: function updateContents(delta) {\n var _this11 = this;\n\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\n return modify.call(this, function () {\n delta = new _quillDelta2.default(delta);\n return _this11.editor.applyDelta(delta, source);\n }, source, true);\n }\n }]);\n\n return Quill;\n}();\n\nQuill.DEFAULTS = {\n bounds: null,\n formats: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n scrollingContainer: null,\n strict: true,\n theme: 'default'\n};\nQuill.events = _emitter4.default.events;\nQuill.sources = _emitter4.default.sources;\n// eslint-disable-next-line no-undef\nQuill.version = false ? 'dev' : \"1.3.6\";\n\nQuill.imports = {\n 'delta': _quillDelta2.default,\n 'parchment': _parchment2.default,\n 'core/module': _module2.default,\n 'core/theme': _theme2.default\n};\n\nfunction expandConfig(container, userConfig) {\n userConfig = (0, _extend2.default)(true, {\n container: container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true\n }\n }, userConfig);\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = _theme2.default;\n } else {\n userConfig.theme = Quill.import('themes/' + userConfig.theme);\n if (userConfig.theme == null) {\n throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?');\n }\n }\n var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(function (config) {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(function (module) {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n var moduleConfig = moduleNames.reduce(function (config, name) {\n var moduleClass = Quill.import('modules/' + name);\n if (moduleClass == null) {\n debug.error('Cannot load ' + name + ' module. Are you sure you registered it?');\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(function (key) {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n }, {});\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n var formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value, value = name, name = length, length = index.length, index = index.index;\n } else {\n length = index.length, index = index.index;\n }\n } else if (typeof length !== 'number') {\n source = value, value = name, name = length, length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || _emitter4.default.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n var start = void 0,\n end = void 0;\n if (index instanceof _quillDelta2.default) {\n var _map = [range.index, range.index + range.length].map(function (pos) {\n return index.transformPosition(pos, source !== _emitter4.default.sources.USER);\n });\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n } else {\n var _map3 = [range.index, range.index + range.length].map(function (pos) {\n if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos;\n if (length >= 0) {\n return pos + length;\n } else {\n return Math.max(index, pos + length);\n }\n });\n\n var _map4 = _slicedToArray(_map3, 2);\n\n start = _map4[0];\n end = _map4[1];\n }\n return new _selection.Range(start, end - start);\n}\n\nexports.expandConfig = expandConfig;\nexports.overload = overload;\nexports.default = Quill;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Module = function Module(quill) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Module);\n\n this.quill = quill;\n this.options = options;\n};\n\nModule.DEFAULTS = {};\n\nexports.default = Module;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TextBlot = function (_Parchment$Text) {\n _inherits(TextBlot, _Parchment$Text);\n\n function TextBlot() {\n _classCallCheck(this, TextBlot);\n\n return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments));\n }\n\n return TextBlot;\n}(_parchment2.default.Text);\n\nexports.default = TextBlot;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _eventemitter = __webpack_require__(58);\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:events');\n\nvar EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach(function (eventName) {\n document.addEventListener(eventName, function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) {\n // TODO use WeakMap\n if (node.__quill && node.__quill.emitter) {\n var _node$__quill$emitter;\n\n (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args);\n }\n });\n });\n});\n\nvar Emitter = function (_EventEmitter) {\n _inherits(Emitter, _EventEmitter);\n\n function Emitter() {\n _classCallCheck(this, Emitter);\n\n var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this));\n\n _this.listeners = {};\n _this.on('error', debug.error);\n return _this;\n }\n\n _createClass(Emitter, [{\n key: 'emit',\n value: function emit() {\n debug.log.apply(debug, arguments);\n _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments);\n }\n }, {\n key: 'handleDOM',\n value: function handleDOM(event) {\n for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n (this.listeners[event.type] || []).forEach(function (_ref) {\n var node = _ref.node,\n handler = _ref.handler;\n\n if (event.target === node || node.contains(event.target)) {\n handler.apply(undefined, [event].concat(args));\n }\n });\n }\n }, {\n key: 'listenDOM',\n value: function listenDOM(eventName, node, handler) {\n if (!this.listeners[eventName]) {\n this.listeners[eventName] = [];\n }\n this.listeners[eventName].push({ node: node, handler: handler });\n }\n }]);\n\n return Emitter;\n}(_eventemitter2.default);\n\nEmitter.events = {\n EDITOR_CHANGE: 'editor-change',\n SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n SCROLL_OPTIMIZE: 'scroll-optimize',\n SCROLL_UPDATE: 'scroll-update',\n SELECTION_CHANGE: 'selection-change',\n TEXT_CHANGE: 'text-change'\n};\nEmitter.sources = {\n API: 'api',\n SILENT: 'silent',\n USER: 'user'\n};\n\nexports.default = Emitter;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar levels = ['error', 'warn', 'log', 'info'];\nvar level = 'warn';\n\nfunction debug(method) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n var _console;\n\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n (_console = console)[method].apply(_console, args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce(function (logger, method) {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\ndebug.level = namespace.level = function (newLevel) {\n level = newLevel;\n};\n\nexports.default = namespace;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = __webpack_require__(1);\nvar Attributor = /** @class */ (function () {\n function Attributor(attrName, keyName, options) {\n if (options === void 0) { options = {}; }\n this.attrName = attrName;\n this.keyName = keyName;\n var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n if (options.scope != null) {\n // Ignore type bits, force attribute bit\n this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n }\n else {\n this.scope = Registry.Scope.ATTRIBUTE;\n }\n if (options.whitelist != null)\n this.whitelist = options.whitelist;\n }\n Attributor.keys = function (node) {\n return [].map.call(node.attributes, function (item) {\n return item.name;\n });\n };\n Attributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.setAttribute(this.keyName, value);\n return true;\n };\n Attributor.prototype.canAdd = function (node, value) {\n var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n if (match == null)\n return false;\n if (this.whitelist == null)\n return true;\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n }\n else {\n return this.whitelist.indexOf(value) > -1;\n }\n };\n Attributor.prototype.remove = function (node) {\n node.removeAttribute(this.keyName);\n };\n Attributor.prototype.value = function (node) {\n var value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n };\n return Attributor;\n}());\nexports.default = Attributor;\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar pSlice = Array.prototype.slice;\nvar objectKeys = __webpack_require__(55);\nvar isArguments = __webpack_require__(56);\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n if (!opts) opts = {};\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected, opts);\n }\n}\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n}\n\nfunction objEquiv(a, b, opts) {\n var i, key;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n var ka = objectKeys(a),\n kb = objectKeys(b);\n } catch (e) {//happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) return false;\n }\n return typeof a === typeof b;\n}\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.Code = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Code = function (_Inline) {\n _inherits(Code, _Inline);\n\n function Code() {\n _classCallCheck(this, Code);\n\n return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments));\n }\n\n return Code;\n}(_inline2.default);\n\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\nvar CodeBlock = function (_Block) {\n _inherits(CodeBlock, _Block);\n\n function CodeBlock() {\n _classCallCheck(this, CodeBlock);\n\n return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments));\n }\n\n _createClass(CodeBlock, [{\n key: 'delta',\n value: function delta() {\n var _this3 = this;\n\n var text = this.domNode.textContent;\n if (text.endsWith('\\n')) {\n // Should always be true\n text = text.slice(0, -1);\n }\n return text.split('\\n').reduce(function (delta, frag) {\n return delta.insert(frag).insert('\\n', _this3.formats());\n }, new _quillDelta2.default());\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n if (name === this.statics.blotName && value) return;\n\n var _descendant = this.descendant(_text2.default, this.length() - 1),\n _descendant2 = _slicedToArray(_descendant, 1),\n text = _descendant2[0];\n\n if (text != null) {\n text.deleteAt(text.length() - 1, 1);\n }\n _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value);\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n if (length === 0) return;\n if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) {\n return;\n }\n var nextNewline = this.newlineIndex(index);\n if (nextNewline < 0 || nextNewline >= index + length) return;\n var prevNewline = this.newlineIndex(index, true) + 1;\n var isolateLength = nextNewline - prevNewline + 1;\n var blot = this.isolate(prevNewline, isolateLength);\n var next = blot.next;\n blot.format(name, value);\n if (next instanceof CodeBlock) {\n next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n }\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (def != null) return;\n\n var _descendant3 = this.descendant(_text2.default, index),\n _descendant4 = _slicedToArray(_descendant3, 2),\n text = _descendant4[0],\n offset = _descendant4[1];\n\n text.insertAt(offset, value);\n }\n }, {\n key: 'length',\n value: function length() {\n var length = this.domNode.textContent.length;\n if (!this.domNode.textContent.endsWith('\\n')) {\n return length + 1;\n }\n return length;\n }\n }, {\n key: 'newlineIndex',\n value: function newlineIndex(searchIndex) {\n var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!reverse) {\n var offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n return offset > -1 ? searchIndex + offset : -1;\n } else {\n return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n }\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n if (!this.domNode.textContent.endsWith('\\n')) {\n this.appendChild(_parchment2.default.create('text', '\\n'));\n }\n _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context);\n var next = this.next;\n if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n next.optimize(context);\n next.moveChildren(this);\n next.remove();\n }\n }\n }, {\n key: 'replace',\n value: function replace(target) {\n _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target);\n [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) {\n var blot = _parchment2.default.find(node);\n if (blot == null) {\n node.parentNode.removeChild(node);\n } else if (blot instanceof _parchment2.default.Embed) {\n blot.remove();\n } else {\n blot.unwrap();\n }\n });\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n }, {\n key: 'formats',\n value: function formats() {\n return true;\n }\n }]);\n\n return CodeBlock;\n}(_block2.default);\n\nCodeBlock.blotName = 'code-block';\nCodeBlock.tagName = 'PRE';\nCodeBlock.TAB = ' ';\n\nexports.Code = Code;\nexports.default = CodeBlock;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Break = function (_Parchment$Embed) {\n _inherits(Break, _Parchment$Embed);\n\n function Break() {\n _classCallCheck(this, Break);\n\n return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments));\n }\n\n _createClass(Break, [{\n key: 'insertInto',\n value: function insertInto(parent, ref) {\n if (parent.children.length === 0) {\n _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref);\n } else {\n this.remove();\n }\n }\n }, {\n key: 'length',\n value: function length() {\n return 0;\n }\n }, {\n key: 'value',\n value: function value() {\n return '';\n }\n }], [{\n key: 'value',\n value: function value() {\n return undefined;\n }\n }]);\n\n return Break;\n}(_parchment2.default.Embed);\n\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\nexports.default = Break;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.sanitize = exports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Link = function (_Inline) {\n _inherits(Link, _Inline);\n\n function Link() {\n _classCallCheck(this, Link);\n\n return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments));\n }\n\n _createClass(Link, [{\n key: 'format',\n value: function format(name, value) {\n if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value);\n value = this.constructor.sanitize(value);\n this.domNode.setAttribute('href', value);\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value);\n value = this.sanitize(value);\n node.setAttribute('href', value);\n node.setAttribute('target', '_blank');\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n return domNode.getAttribute('href');\n }\n }, {\n key: 'sanitize',\n value: function sanitize(url) {\n return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n }]);\n\n return Link;\n}(_inline2.default);\n\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\nLink.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];\n\nfunction _sanitize(url, protocols) {\n var anchor = document.createElement('a');\n anchor.href = url;\n var protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\nexports.default = Link;\nexports.sanitize = _sanitize;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _keyboard = __webpack_require__(25);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\n\nvar _dropdown = __webpack_require__(106);\n\nvar _dropdown2 = _interopRequireDefault(_dropdown);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar optionsCounter = 0;\n\nfunction toggleAriaAttribute(element, attribute) {\n element.setAttribute(attribute, !(element.getAttribute(attribute) === 'true'));\n}\n\nvar Picker = function () {\n function Picker(select) {\n var _this = this;\n\n _classCallCheck(this, Picker);\n\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n this.select.parentNode.insertBefore(this.container, this.select);\n\n this.label.addEventListener('mousedown', function () {\n _this.togglePicker();\n });\n this.label.addEventListener('keydown', function (event) {\n switch (event.keyCode) {\n // Allows the \"Enter\" key to open the picker\n case _keyboard2.default.keys.ENTER:\n _this.togglePicker();\n break;\n\n // Allows the \"Escape\" key to close the picker\n case _keyboard2.default.keys.ESCAPE:\n _this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n _createClass(Picker, [{\n key: 'togglePicker',\n value: function togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n }, {\n key: 'buildItem',\n value: function buildItem(option) {\n var _this2 = this;\n\n var item = document.createElement('span');\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n\n item.classList.add('ql-picker-item');\n if (option.hasAttribute('value')) {\n item.setAttribute('data-value', option.getAttribute('value'));\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', function () {\n _this2.selectItem(item, true);\n });\n item.addEventListener('keydown', function (event) {\n switch (event.keyCode) {\n // Allows the \"Enter\" key to select an item\n case _keyboard2.default.keys.ENTER:\n _this2.selectItem(item, true);\n event.preventDefault();\n break;\n\n // Allows the \"Escape\" key to close the picker\n case _keyboard2.default.keys.ESCAPE:\n _this2.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n\n return item;\n }\n }, {\n key: 'buildLabel',\n value: function buildLabel() {\n var label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = _dropdown2.default;\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n }, {\n key: 'buildOptions',\n value: function buildOptions() {\n var _this3 = this;\n\n var options = document.createElement('span');\n options.classList.add('ql-picker-options');\n\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n options.tabIndex = '-1';\n\n // Need a unique id for aria-controls\n options.id = 'ql-picker-options-' + optionsCounter;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n\n this.options = options;\n\n [].slice.call(this.select.options).forEach(function (option) {\n var item = _this3.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n _this3.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n }, {\n key: 'buildPicker',\n value: function buildPicker() {\n var _this4 = this;\n\n [].slice.call(this.select.attributes).forEach(function (item) {\n _this4.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n }, {\n key: 'escape',\n value: function escape() {\n var _this5 = this;\n\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(function () {\n return _this5.label.focus();\n }, 1);\n }\n }, {\n key: 'close',\n value: function close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n this.options.setAttribute('aria-hidden', 'true');\n }\n }, {\n key: 'selectItem',\n value: function selectItem(item) {\n var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);\n if (item.hasAttribute('data-value')) {\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n if (typeof Event === 'function') {\n this.select.dispatchEvent(new Event('change'));\n } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') {\n // IE11\n var event = document.createEvent('Event');\n event.initEvent('change', true, true);\n this.select.dispatchEvent(event);\n }\n this.close();\n }\n }\n }, {\n key: 'update',\n value: function update() {\n var option = void 0;\n if (this.select.selectedIndex > -1) {\n var item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex];\n option = this.select.options[this.select.selectedIndex];\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n var isActive = option != null && option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n }]);\n\n return Picker;\n}();\n\nexports.default = Picker;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar linked_list_1 = __webpack_require__(47);\nvar shadow_1 = __webpack_require__(27);\nvar Registry = __webpack_require__(1);\nvar ContainerBlot = /** @class */ (function (_super) {\n __extends(ContainerBlot, _super);\n function ContainerBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.build();\n return _this;\n }\n ContainerBlot.prototype.appendChild = function (other) {\n this.insertBefore(other);\n };\n ContainerBlot.prototype.attach = function () {\n _super.prototype.attach.call(this);\n this.children.forEach(function (child) {\n child.attach();\n });\n };\n ContainerBlot.prototype.build = function () {\n var _this = this;\n this.children = new linked_list_1.default();\n // Need to be reversed for if DOM nodes already in order\n [].slice\n .call(this.domNode.childNodes)\n .reverse()\n .forEach(function (node) {\n try {\n var child = makeBlot(node);\n _this.insertBefore(child, _this.children.head || undefined);\n }\n catch (err) {\n if (err instanceof Registry.ParchmentError)\n return;\n else\n throw err;\n }\n });\n };\n ContainerBlot.prototype.deleteAt = function (index, length) {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.deleteAt(offset, length);\n });\n };\n ContainerBlot.prototype.descendant = function (criteria, index) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n return [child, offset];\n }\n else if (child instanceof ContainerBlot) {\n return child.descendant(criteria, offset);\n }\n else {\n return [null, -1];\n }\n };\n ContainerBlot.prototype.descendants = function (criteria, index, length) {\n if (index === void 0) { index = 0; }\n if (length === void 0) { length = Number.MAX_VALUE; }\n var descendants = [];\n var lengthLeft = length;\n this.children.forEachAt(index, length, function (child, index, length) {\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n descendants.push(child);\n }\n if (child instanceof ContainerBlot) {\n descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return descendants;\n };\n ContainerBlot.prototype.detach = function () {\n this.children.forEach(function (child) {\n child.detach();\n });\n _super.prototype.detach.call(this);\n };\n ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.formatAt(offset, length, name, value);\n });\n };\n ContainerBlot.prototype.insertAt = function (index, value, def) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if (child) {\n child.insertAt(offset, value, def);\n }\n else {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n this.appendChild(blot);\n }\n };\n ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n if (this.statics.allowedChildren != null &&\n !this.statics.allowedChildren.some(function (child) {\n return childBlot instanceof child;\n })) {\n throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n }\n childBlot.insertInto(this, refBlot);\n };\n ContainerBlot.prototype.length = function () {\n return this.children.reduce(function (memo, child) {\n return memo + child.length();\n }, 0);\n };\n ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n this.children.forEach(function (child) {\n targetParent.insertBefore(child, refNode);\n });\n };\n ContainerBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n var child = Registry.create(this.statics.defaultChild);\n this.appendChild(child);\n child.optimize(context);\n }\n else {\n this.remove();\n }\n }\n };\n ContainerBlot.prototype.path = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n var position = [[this, index]];\n if (child instanceof ContainerBlot) {\n return position.concat(child.path(offset, inclusive));\n }\n else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n };\n ContainerBlot.prototype.removeChild = function (child) {\n this.children.remove(child);\n };\n ContainerBlot.prototype.replace = function (target) {\n if (target instanceof ContainerBlot) {\n target.moveChildren(this);\n }\n _super.prototype.replace.call(this, target);\n };\n ContainerBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = this.clone();\n this.parent.insertBefore(after, this.next);\n this.children.forEachAt(index, this.length(), function (child, offset, length) {\n child = child.split(offset, force);\n after.appendChild(child);\n });\n return after;\n };\n ContainerBlot.prototype.unwrap = function () {\n this.moveChildren(this.parent, this.next);\n this.remove();\n };\n ContainerBlot.prototype.update = function (mutations, context) {\n var _this = this;\n var addedNodes = [];\n var removedNodes = [];\n mutations.forEach(function (mutation) {\n if (mutation.target === _this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach(function (node) {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (node.parentNode != null &&\n // @ts-ignore\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return;\n }\n var blot = Registry.find(node);\n if (blot == null)\n return;\n if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n blot.detach();\n }\n });\n addedNodes\n .filter(function (node) {\n return node.parentNode == _this.domNode;\n })\n .sort(function (a, b) {\n if (a === b)\n return 0;\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach(function (node) {\n var refBlot = null;\n if (node.nextSibling != null) {\n refBlot = Registry.find(node.nextSibling);\n }\n var blot = makeBlot(node);\n if (blot.next != refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(_this);\n }\n _this.insertBefore(blot, refBlot || undefined);\n }\n });\n };\n return ContainerBlot;\n}(shadow_1.default));\nfunction makeBlot(node) {\n var blot = Registry.find(node);\n if (blot == null) {\n try {\n blot = Registry.create(node);\n }\n catch (e) {\n blot = Registry.create(Registry.Scope.INLINE);\n [].slice.call(node.childNodes).forEach(function (child) {\n // @ts-ignore\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n }\n }\n return blot;\n}\nexports.default = ContainerBlot;\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(11);\nvar store_1 = __webpack_require__(28);\nvar container_1 = __webpack_require__(17);\nvar Registry = __webpack_require__(1);\nvar FormatBlot = /** @class */ (function (_super) {\n __extends(FormatBlot, _super);\n function FormatBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.attributes = new store_1.default(_this.domNode);\n return _this;\n }\n FormatBlot.formats = function (domNode) {\n if (typeof this.tagName === 'string') {\n return true;\n }\n else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n };\n FormatBlot.prototype.format = function (name, value) {\n var format = Registry.query(name);\n if (format instanceof attributor_1.default) {\n this.attributes.attribute(format, value);\n }\n else if (value) {\n if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n this.replaceWith(name, value);\n }\n }\n };\n FormatBlot.prototype.formats = function () {\n var formats = this.attributes.values();\n var format = this.statics.formats(this.domNode);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n };\n FormatBlot.prototype.replaceWith = function (name, value) {\n var replacement = _super.prototype.replaceWith.call(this, name, value);\n this.attributes.copy(replacement);\n return replacement;\n };\n FormatBlot.prototype.update = function (mutations, context) {\n var _this = this;\n _super.prototype.update.call(this, mutations, context);\n if (mutations.some(function (mutation) {\n return mutation.target === _this.domNode && mutation.type === 'attributes';\n })) {\n this.attributes.build();\n }\n };\n FormatBlot.prototype.wrap = function (name, value) {\n var wrapper = _super.prototype.wrap.call(this, name, value);\n if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n };\n return FormatBlot;\n}(container_1.default));\nexports.default = FormatBlot;\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar shadow_1 = __webpack_require__(27);\nvar Registry = __webpack_require__(1);\nvar LeafBlot = /** @class */ (function (_super) {\n __extends(LeafBlot, _super);\n function LeafBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LeafBlot.value = function (domNode) {\n return true;\n };\n LeafBlot.prototype.index = function (node, offset) {\n if (this.domNode === node ||\n this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return Math.min(offset, 1);\n }\n return -1;\n };\n LeafBlot.prototype.position = function (index, inclusive) {\n var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n if (index > 0)\n offset += 1;\n return [this.parent.domNode, offset];\n };\n LeafBlot.prototype.value = function () {\n return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;\n var _a;\n };\n LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n return LeafBlot;\n}(shadow_1.default));\nexports.default = LeafBlot;\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar equal = __webpack_require__(12);\nvar extend = __webpack_require__(2);\n\n\nvar lib = {\n attributes: {\n compose: function (a, b, keepNull) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = extend(true, {}, b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce(function (copy, key) {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (var key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n diff: function(a, b) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {\n if (!equal(a[key], b[key])) {\n attributes[key] = b[key] === undefined ? null : b[key];\n }\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n transform: function (a, b, priority) {\n if (typeof a !== 'object') return b;\n if (typeof b !== 'object') return undefined;\n if (!priority) return b; // b simply overwrites us without priority\n var attributes = Object.keys(b).reduce(function (attributes, key) {\n if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n },\n\n iterator: function (ops) {\n return new Iterator(ops);\n },\n\n length: function (op) {\n if (typeof op['delete'] === 'number') {\n return op['delete'];\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n};\n\n\nfunction Iterator(ops) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n};\n\nIterator.prototype.hasNext = function () {\n return this.peekLength() < Infinity;\n};\n\nIterator.prototype.next = function (length) {\n if (!length) length = Infinity;\n var nextOp = this.ops[this.index];\n if (nextOp) {\n var offset = this.offset;\n var opLength = lib.length(nextOp)\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp['delete'] === 'number') {\n return { 'delete': length };\n } else {\n var retOp = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n};\n\nIterator.prototype.peek = function () {\n return this.ops[this.index];\n};\n\nIterator.prototype.peekLength = function () {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return lib.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n};\n\nIterator.prototype.peekType = function () {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index]['delete'] === 'number') {\n return 'delete';\n } else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n};\n\n\nmodule.exports = lib;\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\nvar clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.Range = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _clone = __webpack_require__(21);\n\nvar _clone2 = _interopRequireDefault(_clone);\n\nvar _deepEqual = __webpack_require__(12);\n\nvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\nvar _emitter3 = __webpack_require__(9);\n\nvar _emitter4 = _interopRequireDefault(_emitter3);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar debug = (0, _logger2.default)('quill:selection');\n\nvar Range = function Range(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n _classCallCheck(this, Range);\n\n this.index = index;\n this.length = length;\n};\n\nvar Selection = function () {\n function Selection(scroll, emitter) {\n var _this = this;\n\n _classCallCheck(this, Selection);\n\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n this.cursor = _parchment2.default.create('cursor', this);\n // savedRange is last non-null range\n this.lastRange = this.savedRange = new Range(0, 0);\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, function () {\n if (!_this.mouseDown) {\n setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1);\n }\n });\n this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) {\n if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) {\n _this.update(_emitter4.default.sources.SILENT);\n }\n });\n this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () {\n if (!_this.hasFocus()) return;\n var native = _this.getNativeRange();\n if (native == null) return;\n if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle\n // TODO unclear if this has negative side effects\n _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () {\n try {\n _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);\n } catch (ignored) {}\n });\n });\n this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) {\n if (context.range) {\n var _context$range = context.range,\n startNode = _context$range.startNode,\n startOffset = _context$range.startOffset,\n endNode = _context$range.endNode,\n endOffset = _context$range.endOffset;\n\n _this.setNativeRange(startNode, startOffset, endNode, endOffset);\n }\n });\n this.update(_emitter4.default.sources.SILENT);\n }\n\n _createClass(Selection, [{\n key: 'handleComposition',\n value: function handleComposition() {\n var _this2 = this;\n\n this.root.addEventListener('compositionstart', function () {\n _this2.composing = true;\n });\n this.root.addEventListener('compositionend', function () {\n _this2.composing = false;\n if (_this2.cursor.parent) {\n var range = _this2.cursor.restore();\n if (!range) return;\n setTimeout(function () {\n _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);\n }, 1);\n }\n });\n }\n }, {\n key: 'handleDragging',\n value: function handleDragging() {\n var _this3 = this;\n\n this.emitter.listenDOM('mousedown', document.body, function () {\n _this3.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, function () {\n _this3.mouseDown = false;\n _this3.update(_emitter4.default.sources.USER);\n });\n }\n }, {\n key: 'focus',\n value: function focus() {\n if (this.hasFocus()) return;\n this.root.focus();\n this.setRange(this.savedRange);\n }\n }, {\n key: 'format',\n value: function format(_format, value) {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return;\n this.scroll.update();\n var nativeRange = this.getNativeRange();\n if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n var blot = _parchment2.default.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof _parchment2.default.Leaf) {\n var after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(_format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n }, {\n key: 'getBounds',\n value: function getBounds(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n var node = void 0,\n _scroll$leaf = this.scroll.leaf(index),\n _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2),\n leaf = _scroll$leaf2[0],\n offset = _scroll$leaf2[1];\n if (leaf == null) return null;\n\n var _leaf$position = leaf.position(offset, true);\n\n var _leaf$position2 = _slicedToArray(_leaf$position, 2);\n\n node = _leaf$position2[0];\n offset = _leaf$position2[1];\n\n var range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n\n var _scroll$leaf3 = this.scroll.leaf(index + length);\n\n var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2);\n\n leaf = _scroll$leaf4[0];\n offset = _scroll$leaf4[1];\n\n if (leaf == null) return null;\n\n var _leaf$position3 = leaf.position(offset, true);\n\n var _leaf$position4 = _slicedToArray(_leaf$position3, 2);\n\n node = _leaf$position4[0];\n offset = _leaf$position4[1];\n\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n } else {\n var side = 'left';\n var rect = void 0;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0\n };\n }\n }\n }, {\n key: 'getNativeRange',\n value: function getNativeRange() {\n var selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n var nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n var range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n }, {\n key: 'getRange',\n value: function getRange() {\n var normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n var range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n }, {\n key: 'hasFocus',\n value: function hasFocus() {\n return document.activeElement === this.root;\n }\n }, {\n key: 'normalizedToRange',\n value: function normalizedToRange(range) {\n var _this4 = this;\n\n var positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n var indexes = positions.map(function (position) {\n var _position = _slicedToArray(position, 2),\n node = _position[0],\n offset = _position[1];\n\n var blot = _parchment2.default.find(node, true);\n var index = blot.offset(_this4.scroll);\n if (offset === 0) {\n return index;\n } else if (blot instanceof _parchment2.default.Container) {\n return index + blot.length();\n } else {\n return index + blot.index(node, offset);\n }\n });\n var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1);\n var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes)));\n return new Range(start, end - start);\n }\n }, {\n key: 'normalizeNative',\n value: function normalizeNative(nativeRange) {\n if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) {\n return null;\n }\n var range = {\n start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange\n };\n [range.start, range.end].forEach(function (position) {\n var node = position.node,\n offset = position.offset;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n } else {\n break;\n }\n }\n position.node = node, position.offset = offset;\n });\n return range;\n }\n }, {\n key: 'rangeToNative',\n value: function rangeToNative(range) {\n var _this5 = this;\n\n var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n var args = [];\n var scrollLength = this.scroll.length();\n indexes.forEach(function (index, i) {\n index = Math.min(scrollLength - 1, index);\n var node = void 0,\n _scroll$leaf5 = _this5.scroll.leaf(index),\n _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2),\n leaf = _scroll$leaf6[0],\n offset = _scroll$leaf6[1];\n var _leaf$position5 = leaf.position(offset, i !== 0);\n\n var _leaf$position6 = _slicedToArray(_leaf$position5, 2);\n\n node = _leaf$position6[0];\n offset = _leaf$position6[1];\n\n args.push(node, offset);\n });\n if (args.length < 2) {\n args = args.concat(args);\n }\n return args;\n }\n }, {\n key: 'scrollIntoView',\n value: function scrollIntoView(scrollingContainer) {\n var range = this.lastRange;\n if (range == null) return;\n var bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n var limit = this.scroll.length() - 1;\n\n var _scroll$line = this.scroll.line(Math.min(range.index, limit)),\n _scroll$line2 = _slicedToArray(_scroll$line, 1),\n first = _scroll$line2[0];\n\n var last = first;\n if (range.length > 0) {\n var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit));\n\n var _scroll$line4 = _slicedToArray(_scroll$line3, 1);\n\n last = _scroll$line4[0];\n }\n if (first == null || last == null) return;\n var scrollBounds = scrollingContainer.getBoundingClientRect();\n if (bounds.top < scrollBounds.top) {\n scrollingContainer.scrollTop -= scrollBounds.top - bounds.top;\n } else if (bounds.bottom > scrollBounds.bottom) {\n scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom;\n }\n }\n }, {\n key: 'setNativeRange',\n value: function setNativeRange(startNode, startOffset) {\n var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode;\n var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset;\n var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n return;\n }\n var selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n var native = (this.getNativeRange() || {}).native;\n if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) {\n\n if (startNode.tagName == \"BR\") {\n startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);\n startNode = startNode.parentNode;\n }\n if (endNode.tagName == \"BR\") {\n endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);\n endNode = endNode.parentNode;\n }\n var range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n }\n }\n }, {\n key: 'setRange',\n value: function setRange(range) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;\n\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n var args = this.rangeToNative(range);\n this.setNativeRange.apply(this, _toConsumableArray(args).concat([force]));\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n }, {\n key: 'update',\n value: function update() {\n var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;\n\n var oldRange = this.lastRange;\n\n var _getRange = this.getRange(),\n _getRange2 = _slicedToArray(_getRange, 2),\n lastRange = _getRange2[0],\n nativeRange = _getRange2[1];\n\n this.lastRange = lastRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) {\n var _emitter;\n\n if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n this.cursor.restore();\n }\n var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n }\n }]);\n\n return Selection;\n}();\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode;\n } catch (e) {\n return false;\n }\n // IE11 has bug with Text nodes\n // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n if (descendant instanceof Text) {\n descendant = descendant.parentNode;\n }\n return parent.contains(descendant);\n}\n\nexports.Range = Range;\nexports.default = Selection;\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Container = function (_Parchment$Container) {\n _inherits(Container, _Parchment$Container);\n\n function Container() {\n _classCallCheck(this, Container);\n\n return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments));\n }\n\n return Container;\n}(_parchment2.default.Container);\n\nContainer.allowedChildren = [_block2.default, _block.BlockEmbed, Container];\n\nexports.default = Container;\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ColorAttributor = function (_Parchment$Attributor) {\n _inherits(ColorAttributor, _Parchment$Attributor);\n\n function ColorAttributor() {\n _classCallCheck(this, ColorAttributor);\n\n return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments));\n }\n\n _createClass(ColorAttributor, [{\n key: 'value',\n value: function value(domNode) {\n var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n return '#' + value.split(',').map(function (component) {\n return ('00' + parseInt(component).toString(16)).slice(-2);\n }).join('');\n }\n }]);\n\n return ColorAttributor;\n}(_parchment2.default.Attributor.Style);\n\nvar ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', {\n scope: _parchment2.default.Scope.INLINE\n});\nvar ColorStyle = new ColorAttributor('color', 'color', {\n scope: _parchment2.default.Scope.INLINE\n});\n\nexports.ColorAttributor = ColorAttributor;\nexports.ColorClass = ColorClass;\nexports.ColorStyle = ColorStyle;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SHORTKEY = exports.default = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _clone = __webpack_require__(21);\n\nvar _clone2 = _interopRequireDefault(_clone);\n\nvar _deepEqual = __webpack_require__(12);\n\nvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _op = __webpack_require__(20);\n\nvar _op2 = _interopRequireDefault(_op);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:keyboard');\n\nvar SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\nvar Keyboard = function (_Module) {\n _inherits(Keyboard, _Module);\n\n _createClass(Keyboard, null, [{\n key: 'match',\n value: function match(evt, binding) {\n binding = normalize(binding);\n if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) {\n return !!binding[key] !== evt[key] && binding[key] !== null;\n })) {\n return false;\n }\n return binding.key === (evt.which || evt.keyCode);\n }\n }]);\n\n function Keyboard(quill, options) {\n _classCallCheck(this, Keyboard);\n\n var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options));\n\n _this.bindings = {};\n Object.keys(_this.options.bindings).forEach(function (name) {\n if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) {\n return;\n }\n if (_this.options.bindings[name]) {\n _this.addBinding(_this.options.bindings[name]);\n }\n });\n _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {});\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace);\n _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete);\n } else {\n _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);\n }\n _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace);\n _this.listen();\n return _this;\n }\n\n _createClass(Keyboard, [{\n key: 'addBinding',\n value: function addBinding(key) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var binding = normalize(key);\n if (binding == null || binding.key == null) {\n return debug.warn('Attempted to add invalid keyboard binding', binding);\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler: handler };\n }\n binding = (0, _extend2.default)(binding, context, handler);\n this.bindings[binding.key] = this.bindings[binding.key] || [];\n this.bindings[binding.key].push(binding);\n }\n }, {\n key: 'listen',\n value: function listen() {\n var _this2 = this;\n\n this.quill.root.addEventListener('keydown', function (evt) {\n if (evt.defaultPrevented) return;\n var which = evt.which || evt.keyCode;\n var bindings = (_this2.bindings[which] || []).filter(function (binding) {\n return Keyboard.match(evt, binding);\n });\n if (bindings.length === 0) return;\n var range = _this2.quill.getSelection();\n if (range == null || !_this2.quill.hasFocus()) return;\n\n var _quill$getLine = _this2.quill.getLine(range.index),\n _quill$getLine2 = _slicedToArray(_quill$getLine, 2),\n line = _quill$getLine2[0],\n offset = _quill$getLine2[1];\n\n var _quill$getLeaf = _this2.quill.getLeaf(range.index),\n _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2),\n leafStart = _quill$getLeaf2[0],\n offsetStart = _quill$getLeaf2[1];\n\n var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length),\n _ref2 = _slicedToArray(_ref, 2),\n leafEnd = _ref2[0],\n offsetEnd = _ref2[1];\n\n var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : '';\n var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : '';\n var curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: _this2.quill.getFormat(range),\n offset: offset,\n prefix: prefixText,\n suffix: suffixText\n };\n var prevented = bindings.some(function (binding) {\n if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n if (binding.empty != null && binding.empty !== curContext.empty) return false;\n if (binding.offset != null && binding.offset !== curContext.offset) return false;\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(function (name) {\n return curContext.format[name] == null;\n })) {\n return false;\n }\n } else if (_typeof(binding.format) === 'object') {\n // all formats must match\n if (!Object.keys(binding.format).every(function (name) {\n if (binding.format[name] === true) return curContext.format[name] != null;\n if (binding.format[name] === false) return curContext.format[name] == null;\n return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]);\n })) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n return binding.handler.call(_this2, range, curContext) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n }]);\n\n return Keyboard;\n}(_module2.default);\n\nKeyboard.keys = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n DELETE: 46\n};\n\nKeyboard.DEFAULTS = {\n bindings: {\n 'bold': makeFormatHandler('bold'),\n 'italic': makeFormatHandler('italic'),\n 'underline': makeFormatHandler('underline'),\n 'indent': {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: Keyboard.keys.TAB,\n format: ['blockquote', 'indent', 'list'],\n handler: function handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', _quill2.default.sources.USER);\n }\n },\n 'outdent': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler: function handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', _quill2.default.sources.USER);\n }\n },\n 'outdent backspace': {\n key: Keyboard.keys.BACKSPACE,\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler: function handler(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', _quill2.default.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, _quill2.default.sources.USER);\n }\n }\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler: function handler(range) {\n this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);\n }\n },\n 'tab': {\n key: Keyboard.keys.TAB,\n handler: function handler(range) {\n this.quill.history.cutoff();\n var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\\t');\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n }\n },\n 'list empty enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['list'],\n empty: true,\n handler: function handler(range, context) {\n this.quill.format('list', false, _quill2.default.sources.USER);\n if (context.format.indent) {\n this.quill.format('indent', false, _quill2.default.sources.USER);\n }\n }\n },\n 'checklist enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: { list: 'checked' },\n handler: function handler(range) {\n var _quill$getLine3 = this.quill.getLine(range.index),\n _quill$getLine4 = _slicedToArray(_quill$getLine3, 2),\n line = _quill$getLine4[0],\n offset = _quill$getLine4[1];\n\n var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' });\n var delta = new _quillDelta2.default().retain(range.index).insert('\\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'header enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler: function handler(range, context) {\n var _quill$getLine5 = this.quill.getLine(range.index),\n _quill$getLine6 = _slicedToArray(_quill$getLine5, 2),\n line = _quill$getLine6[0],\n offset = _quill$getLine6[1];\n\n var delta = new _quillDelta2.default().retain(range.index).insert('\\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null });\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'list autofill': {\n key: ' ',\n collapsed: true,\n format: { list: false },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler: function handler(range, context) {\n var length = context.prefix.length;\n\n var _quill$getLine7 = this.quill.getLine(range.index),\n _quill$getLine8 = _slicedToArray(_quill$getLine7, 2),\n line = _quill$getLine8[0],\n offset = _quill$getLine8[1];\n\n if (offset > length) return true;\n var value = void 0;\n switch (context.prefix.trim()) {\n case '[]':case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-':case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', _quill2.default.sources.USER);\n this.quill.history.cutoff();\n var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value });\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT);\n }\n },\n 'code exit': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['code-block'],\n prefix: /\\n\\n$/,\n suffix: /^\\s+$/,\n handler: function handler(range) {\n var _quill$getLine9 = this.quill.getLine(range.index),\n _quill$getLine10 = _slicedToArray(_quill$getLine9, 2),\n line = _quill$getLine10[0],\n offset = _quill$getLine10[1];\n\n var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1);\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n }\n },\n 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false),\n 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true),\n 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),\n 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)\n }\n};\n\nfunction makeEmbedArrowHandler(key, shiftKey) {\n var _ref3;\n\n var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix';\n return _ref3 = {\n key: key,\n shiftKey: shiftKey,\n altKey: null\n }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) {\n var index = range.index;\n if (key === Keyboard.keys.RIGHT) {\n index += range.length + 1;\n }\n\n var _quill$getLeaf3 = this.quill.getLeaf(index),\n _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1),\n leaf = _quill$getLeaf4[0];\n\n if (!(leaf instanceof _parchment2.default.Embed)) return true;\n if (key === Keyboard.keys.LEFT) {\n if (shiftKey) {\n this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER);\n } else {\n this.quill.setSelection(range.index - 1, _quill2.default.sources.USER);\n }\n } else {\n if (shiftKey) {\n this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER);\n } else {\n this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER);\n }\n }\n return false;\n }), _ref3;\n}\n\nfunction handleBackspace(range, context) {\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n\n var _quill$getLine11 = this.quill.getLine(range.index),\n _quill$getLine12 = _slicedToArray(_quill$getLine11, 1),\n line = _quill$getLine12[0];\n\n var formats = {};\n if (context.offset === 0) {\n var _quill$getLine13 = this.quill.getLine(range.index - 1),\n _quill$getLine14 = _slicedToArray(_quill$getLine13, 1),\n prev = _quill$getLine14[0];\n\n if (prev != null && prev.length() > 1) {\n var curFormats = line.formats();\n var prevFormats = this.quill.getFormat(range.index - 1, 1);\n formats = _op2.default.attributes.diff(curFormats, prevFormats) || {};\n }\n }\n // Check for astral symbols\n var length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix) ? 2 : 1;\n this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER);\n }\n this.quill.focus();\n}\n\nfunction handleDelete(range, context) {\n // Check for astral symbols\n var length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix) ? 2 : 1;\n if (range.index >= this.quill.getLength() - length) return;\n var formats = {},\n nextLength = 0;\n\n var _quill$getLine15 = this.quill.getLine(range.index),\n _quill$getLine16 = _slicedToArray(_quill$getLine15, 1),\n line = _quill$getLine16[0];\n\n if (context.offset >= line.length() - 1) {\n var _quill$getLine17 = this.quill.getLine(range.index + 1),\n _quill$getLine18 = _slicedToArray(_quill$getLine17, 1),\n next = _quill$getLine18[0];\n\n if (next) {\n var curFormats = line.formats();\n var nextFormats = this.quill.getFormat(range.index, 1);\n formats = _op2.default.attributes.diff(curFormats, nextFormats) || {};\n nextLength = next.length();\n }\n }\n this.quill.deleteText(range.index, length, _quill2.default.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER);\n }\n}\n\nfunction handleDeleteRange(range) {\n var lines = this.quill.getLines(range);\n var formats = {};\n if (lines.length > 1) {\n var firstFormats = lines[0].formats();\n var lastFormats = lines[lines.length - 1].formats();\n formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {};\n }\n this.quill.deleteText(range, _quill2.default.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER);\n }\n this.quill.setSelection(range.index, _quill2.default.sources.SILENT);\n this.quill.focus();\n}\n\nfunction handleEnter(range, context) {\n var _this3 = this;\n\n if (range.length > 0) {\n this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n }\n var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) {\n if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n lineFormats[format] = context.format[format];\n }\n return lineFormats;\n }, {});\n this.quill.insertText(range.index, '\\n', lineFormats, _quill2.default.sources.USER);\n // Earlier scroll.deleteAt might have messed up our selection,\n // so insertText's built in selection preservation is not reliable\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n this.quill.focus();\n Object.keys(context.format).forEach(function (name) {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'link') return;\n _this3.quill.format(name, context.format[name], _quill2.default.sources.USER);\n });\n}\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: Keyboard.keys.TAB,\n shiftKey: !indent,\n format: { 'code-block': true },\n handler: function handler(range) {\n var CodeBlock = _parchment2.default.query('code-block');\n var index = range.index,\n length = range.length;\n\n var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index),\n _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),\n block = _quill$scroll$descend2[0],\n offset = _quill$scroll$descend2[1];\n\n if (block == null) return;\n var scrollIndex = this.quill.getIndex(block);\n var start = block.newlineIndex(offset, true) + 1;\n var end = block.newlineIndex(scrollIndex + offset + length);\n var lines = block.domNode.textContent.slice(start, end).split('\\n');\n offset = 0;\n lines.forEach(function (line, i) {\n if (indent) {\n block.insertAt(start + offset, CodeBlock.TAB);\n offset += CodeBlock.TAB.length;\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.startsWith(CodeBlock.TAB)) {\n block.deleteAt(start + offset, CodeBlock.TAB.length);\n offset -= CodeBlock.TAB.length;\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n offset += line.length + 1;\n });\n this.quill.update(_quill2.default.sources.USER);\n this.quill.setSelection(index, length, _quill2.default.sources.SILENT);\n }\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0].toUpperCase(),\n shortKey: true,\n handler: function handler(range, context) {\n this.quill.format(format, !context.format[format], _quill2.default.sources.USER);\n }\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n return normalize({ key: binding });\n }\n if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') {\n binding = (0, _clone2.default)(binding, false);\n }\n if (typeof binding.key === 'string') {\n if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n binding.key = Keyboard.keys[binding.key.toUpperCase()];\n } else if (binding.key.length === 1) {\n binding.key = binding.key.toUpperCase().charCodeAt(0);\n } else {\n return null;\n }\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\nexports.default = Keyboard;\nexports.SHORTKEY = SHORTKEY;\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = {\n 'align': {\n '': __webpack_require__(75),\n 'center': __webpack_require__(76),\n 'right': __webpack_require__(77),\n 'justify': __webpack_require__(78)\n },\n 'background': __webpack_require__(79),\n 'blockquote': __webpack_require__(80),\n 'bold': __webpack_require__(81),\n 'clean': __webpack_require__(82),\n 'code': __webpack_require__(40),\n 'code-block': __webpack_require__(40),\n 'color': __webpack_require__(83),\n 'direction': {\n '': __webpack_require__(84),\n 'rtl': __webpack_require__(85)\n },\n 'float': {\n 'center': __webpack_require__(86),\n 'full': __webpack_require__(87),\n 'left': __webpack_require__(88),\n 'right': __webpack_require__(89)\n },\n 'formula': __webpack_require__(90),\n 'header': {\n '1': __webpack_require__(91),\n '2': __webpack_require__(92)\n },\n 'italic': __webpack_require__(93),\n 'image': __webpack_require__(94),\n 'indent': {\n '+1': __webpack_require__(95),\n '-1': __webpack_require__(96)\n },\n 'link': __webpack_require__(97),\n 'list': {\n 'ordered': __webpack_require__(98),\n 'bullet': __webpack_require__(99),\n 'check': __webpack_require__(100)\n },\n 'script': {\n 'sub': __webpack_require__(101),\n 'super': __webpack_require__(102)\n },\n 'strike': __webpack_require__(103),\n 'underline': __webpack_require__(104),\n 'video': __webpack_require__(105)\n};\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = __webpack_require__(1);\nvar ShadowBlot = /** @class */ (function () {\n function ShadowBlot(domNode) {\n this.domNode = domNode;\n // @ts-ignore\n this.domNode[Registry.DATA_KEY] = { blot: this };\n }\n Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n // Hack for accessing inherited static methods\n get: function () {\n return this.constructor;\n },\n enumerable: true,\n configurable: true\n });\n ShadowBlot.create = function (value) {\n if (this.tagName == null) {\n throw new Registry.ParchmentError('Blot definition missing tagName');\n }\n var node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value).toString() === value) {\n value = parseInt(value);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n }\n else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n }\n else {\n node = document.createElement(this.tagName[0]);\n }\n }\n else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n };\n ShadowBlot.prototype.attach = function () {\n if (this.parent != null) {\n this.scroll = this.parent.scroll;\n }\n };\n ShadowBlot.prototype.clone = function () {\n var domNode = this.domNode.cloneNode(false);\n return Registry.create(domNode);\n };\n ShadowBlot.prototype.detach = function () {\n if (this.parent != null)\n this.parent.removeChild(this);\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY];\n };\n ShadowBlot.prototype.deleteAt = function (index, length) {\n var blot = this.isolate(index, length);\n blot.remove();\n };\n ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n var blot = this.isolate(index, length);\n if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n }\n else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n var parent = Registry.create(this.statics.scope);\n blot.wrap(parent);\n parent.format(name, value);\n }\n };\n ShadowBlot.prototype.insertAt = function (index, value, def) {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n var ref = this.split(index);\n this.parent.insertBefore(blot, ref);\n };\n ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n if (refBlot === void 0) { refBlot = null; }\n if (this.parent != null) {\n this.parent.children.remove(this);\n }\n var refDomNode = null;\n parentBlot.children.insertBefore(this, refBlot);\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (this.domNode.parentNode != parentBlot.domNode ||\n this.domNode.nextSibling != refDomNode) {\n parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n }\n this.parent = parentBlot;\n this.attach();\n };\n ShadowBlot.prototype.isolate = function (index, length) {\n var target = this.split(index);\n target.split(length);\n return target;\n };\n ShadowBlot.prototype.length = function () {\n return 1;\n };\n ShadowBlot.prototype.offset = function (root) {\n if (root === void 0) { root = this.parent; }\n if (this.parent == null || this == root)\n return 0;\n return this.parent.children.offset(this) + this.parent.offset(root);\n };\n ShadowBlot.prototype.optimize = function (context) {\n // TODO clean up once we use WeakMap\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY] != null) {\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY].mutations;\n }\n };\n ShadowBlot.prototype.remove = function () {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n };\n ShadowBlot.prototype.replace = function (target) {\n if (target.parent == null)\n return;\n target.parent.insertBefore(this, target.next);\n target.remove();\n };\n ShadowBlot.prototype.replaceWith = function (name, value) {\n var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n replacement.replace(this);\n return replacement;\n };\n ShadowBlot.prototype.split = function (index, force) {\n return index === 0 ? this : this.next;\n };\n ShadowBlot.prototype.update = function (mutations, context) {\n // Nothing to do by default\n };\n ShadowBlot.prototype.wrap = function (name, value) {\n var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next);\n }\n wrapper.appendChild(this);\n return wrapper;\n };\n ShadowBlot.blotName = 'abstract';\n return ShadowBlot;\n}());\nexports.default = ShadowBlot;\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(11);\nvar class_1 = __webpack_require__(29);\nvar style_1 = __webpack_require__(30);\nvar Registry = __webpack_require__(1);\nvar AttributorStore = /** @class */ (function () {\n function AttributorStore(domNode) {\n this.attributes = {};\n this.domNode = domNode;\n this.build();\n }\n AttributorStore.prototype.attribute = function (attribute, value) {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n }\n else {\n delete this.attributes[attribute.attrName];\n }\n }\n }\n else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n };\n AttributorStore.prototype.build = function () {\n var _this = this;\n this.attributes = {};\n var attributes = attributor_1.default.keys(this.domNode);\n var classes = class_1.default.keys(this.domNode);\n var styles = style_1.default.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(function (name) {\n var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n if (attr instanceof attributor_1.default) {\n _this.attributes[attr.attrName] = attr;\n }\n });\n };\n AttributorStore.prototype.copy = function (target) {\n var _this = this;\n Object.keys(this.attributes).forEach(function (key) {\n var value = _this.attributes[key].value(_this.domNode);\n target.format(key, value);\n });\n };\n AttributorStore.prototype.move = function (target) {\n var _this = this;\n this.copy(target);\n Object.keys(this.attributes).forEach(function (key) {\n _this.attributes[key].remove(_this.domNode);\n });\n this.attributes = {};\n };\n AttributorStore.prototype.values = function () {\n var _this = this;\n return Object.keys(this.attributes).reduce(function (attributes, name) {\n attributes[name] = _this.attributes[name].value(_this.domNode);\n return attributes;\n }, {});\n };\n return AttributorStore;\n}());\nexports.default = AttributorStore;\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(11);\nfunction match(node, prefix) {\n var className = node.getAttribute('class') || '';\n return className.split(/\\s+/).filter(function (name) {\n return name.indexOf(prefix + \"-\") === 0;\n });\n}\nvar ClassAttributor = /** @class */ (function (_super) {\n __extends(ClassAttributor, _super);\n function ClassAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ClassAttributor.keys = function (node) {\n return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n return name\n .split('-')\n .slice(0, -1)\n .join('-');\n });\n };\n ClassAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n this.remove(node);\n node.classList.add(this.keyName + \"-\" + value);\n return true;\n };\n ClassAttributor.prototype.remove = function (node) {\n var matches = match(node, this.keyName);\n matches.forEach(function (name) {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n };\n ClassAttributor.prototype.value = function (node) {\n var result = match(node, this.keyName)[0] || '';\n var value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n };\n return ClassAttributor;\n}(attributor_1.default));\nexports.default = ClassAttributor;\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(11);\nfunction camelize(name) {\n var parts = name.split('-');\n var rest = parts\n .slice(1)\n .map(function (part) {\n return part[0].toUpperCase() + part.slice(1);\n })\n .join('');\n return parts[0] + rest;\n}\nvar StyleAttributor = /** @class */ (function (_super) {\n __extends(StyleAttributor, _super);\n function StyleAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StyleAttributor.keys = function (node) {\n return (node.getAttribute('style') || '').split(';').map(function (value) {\n var arr = value.split(':');\n return arr[0].trim();\n });\n };\n StyleAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n // @ts-ignore\n node.style[camelize(this.keyName)] = value;\n return true;\n };\n StyleAttributor.prototype.remove = function (node) {\n // @ts-ignore\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n };\n StyleAttributor.prototype.value = function (node) {\n // @ts-ignore\n var value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n };\n return StyleAttributor;\n}(attributor_1.default));\nexports.default = StyleAttributor;\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Cursor = function (_Parchment$Embed) {\n _inherits(Cursor, _Parchment$Embed);\n\n _createClass(Cursor, null, [{\n key: 'value',\n value: function value() {\n return undefined;\n }\n }]);\n\n function Cursor(domNode, selection) {\n _classCallCheck(this, Cursor);\n\n var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode));\n\n _this.selection = selection;\n _this.textNode = document.createTextNode(Cursor.CONTENTS);\n _this.domNode.appendChild(_this.textNode);\n _this._length = 0;\n return _this;\n }\n\n _createClass(Cursor, [{\n key: 'detach',\n value: function detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n if (this._length !== 0) {\n return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value);\n }\n var target = this,\n index = 0;\n while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this._length = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this._length = 0;\n }\n }\n }, {\n key: 'index',\n value: function index(node, offset) {\n if (node === this.textNode) return 0;\n return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset);\n }\n }, {\n key: 'length',\n value: function length() {\n return this._length;\n }\n }, {\n key: 'position',\n value: function position() {\n return [this.textNode, this.textNode.data.length];\n }\n }, {\n key: 'remove',\n value: function remove() {\n _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this);\n this.parent = null;\n }\n }, {\n key: 'restore',\n value: function restore() {\n if (this.selection.composing || this.parent == null) return;\n var textNode = this.textNode;\n var range = this.selection.getNativeRange();\n var restoreText = void 0,\n start = void 0,\n end = void 0;\n if (range != null && range.start.node === textNode && range.end.node === textNode) {\n var _ref = [textNode, range.start.offset, range.end.offset];\n restoreText = _ref[0];\n start = _ref[1];\n end = _ref[2];\n }\n // Link format will insert text outside of anchor tag\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n if (this.textNode.data !== Cursor.CONTENTS) {\n var text = this.textNode.data.split(Cursor.CONTENTS).join('');\n if (this.next instanceof _text2.default) {\n restoreText = this.next.domNode;\n this.next.insertAt(0, text);\n this.textNode.data = Cursor.CONTENTS;\n } else {\n this.textNode.data = text;\n this.parent.insertBefore(_parchment2.default.create(this.textNode), this);\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n }\n }\n this.remove();\n if (start != null) {\n var _map = [start, end].map(function (offset) {\n return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n });\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n\n return {\n startNode: restoreText,\n startOffset: start,\n endNode: restoreText,\n endOffset: end\n };\n }\n }\n }, {\n key: 'update',\n value: function update(mutations, context) {\n var _this2 = this;\n\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this2.textNode;\n })) {\n var range = this.restore();\n if (range) context.range = range;\n }\n }\n }, {\n key: 'value',\n value: function value() {\n return '';\n }\n }]);\n\n return Cursor;\n}(_parchment2.default.Embed);\n\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = '\\uFEFF'; // Zero width no break space\n\n\nexports.default = Cursor;\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Theme = function () {\n function Theme(quill, options) {\n _classCallCheck(this, Theme);\n\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n _createClass(Theme, [{\n key: 'init',\n value: function init() {\n var _this = this;\n\n Object.keys(this.options.modules).forEach(function (name) {\n if (_this.modules[name] == null) {\n _this.addModule(name);\n }\n });\n }\n }, {\n key: 'addModule',\n value: function addModule(name) {\n var moduleClass = this.quill.constructor.import('modules/' + name);\n this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n return this.modules[name];\n }\n }]);\n\n return Theme;\n}();\n\nTheme.DEFAULTS = {\n modules: {}\n};\nTheme.themes = {\n 'default': Theme\n};\n\nexports.default = Theme;\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar GUARD_TEXT = '\\uFEFF';\n\nvar Embed = function (_Parchment$Embed) {\n _inherits(Embed, _Parchment$Embed);\n\n function Embed(node) {\n _classCallCheck(this, Embed);\n\n var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node));\n\n _this.contentNode = document.createElement('span');\n _this.contentNode.setAttribute('contenteditable', false);\n [].slice.call(_this.domNode.childNodes).forEach(function (childNode) {\n _this.contentNode.appendChild(childNode);\n });\n _this.leftGuard = document.createTextNode(GUARD_TEXT);\n _this.rightGuard = document.createTextNode(GUARD_TEXT);\n _this.domNode.appendChild(_this.leftGuard);\n _this.domNode.appendChild(_this.contentNode);\n _this.domNode.appendChild(_this.rightGuard);\n return _this;\n }\n\n _createClass(Embed, [{\n key: 'index',\n value: function index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset);\n }\n }, {\n key: 'restore',\n value: function restore(node) {\n var range = void 0,\n textNode = void 0;\n var text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof _text2.default) {\n var prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(_parchment2.default.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof _text2.default) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(_parchment2.default.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n }, {\n key: 'update',\n value: function update(mutations, context) {\n var _this2 = this;\n\n mutations.forEach(function (mutation) {\n if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) {\n var range = _this2.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n }]);\n\n return Embed;\n}(_parchment2.default.Embed);\n\nexports.default = Embed;\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar config = {\n scope: _parchment2.default.Scope.BLOCK,\n whitelist: ['right', 'center', 'justify']\n};\n\nvar AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config);\nvar AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config);\nvar AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config);\n\nexports.AlignAttribute = AlignAttribute;\nexports.AlignClass = AlignClass;\nexports.AlignStyle = AlignStyle;\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.BackgroundStyle = exports.BackgroundClass = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _color = __webpack_require__(24);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', {\n scope: _parchment2.default.Scope.INLINE\n});\nvar BackgroundStyle = new _color.ColorAttributor('background', 'background-color', {\n scope: _parchment2.default.Scope.INLINE\n});\n\nexports.BackgroundClass = BackgroundClass;\nexports.BackgroundStyle = BackgroundStyle;\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar config = {\n scope: _parchment2.default.Scope.BLOCK,\n whitelist: ['rtl']\n};\n\nvar DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config);\nvar DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config);\nvar DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config);\n\nexports.DirectionAttribute = DirectionAttribute;\nexports.DirectionClass = DirectionClass;\nexports.DirectionStyle = DirectionStyle;\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.FontClass = exports.FontStyle = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar config = {\n scope: _parchment2.default.Scope.INLINE,\n whitelist: ['serif', 'monospace']\n};\n\nvar FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config);\n\nvar FontStyleAttributor = function (_Parchment$Attributor) {\n _inherits(FontStyleAttributor, _Parchment$Attributor);\n\n function FontStyleAttributor() {\n _classCallCheck(this, FontStyleAttributor);\n\n return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments));\n }\n\n _createClass(FontStyleAttributor, [{\n key: 'value',\n value: function value(node) {\n return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/[\"']/g, '');\n }\n }]);\n\n return FontStyleAttributor;\n}(_parchment2.default.Attributor.Style);\n\nvar FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexports.FontStyle = FontStyle;\nexports.FontClass = FontClass;\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SizeStyle = exports.SizeClass = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', {\n scope: _parchment2.default.Scope.INLINE,\n whitelist: ['small', 'large', 'huge']\n});\nvar SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', {\n scope: _parchment2.default.Scope.INLINE,\n whitelist: ['10px', '18px', '32px']\n});\n\nexports.SizeClass = SizeClass;\nexports.SizeStyle = SizeStyle;\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Bold = function (_Inline) {\n _inherits(Bold, _Inline);\n\n function Bold() {\n _classCallCheck(this, Bold);\n\n return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments));\n }\n\n _createClass(Bold, [{\n key: 'optimize',\n value: function optimize(context) {\n _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n }], [{\n key: 'create',\n value: function create() {\n return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this);\n }\n }, {\n key: 'formats',\n value: function formats() {\n return true;\n }\n }]);\n\n return Bold;\n}(_inline2.default);\n\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexports.default = Bold;\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _picker = __webpack_require__(16);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ColorPicker = function (_Picker) {\n _inherits(ColorPicker, _Picker);\n\n function ColorPicker(select, label) {\n _classCallCheck(this, ColorPicker);\n\n var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select));\n\n _this.label.innerHTML = label;\n _this.container.classList.add('ql-color-picker');\n [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) {\n item.classList.add('ql-primary');\n });\n return _this;\n }\n\n _createClass(ColorPicker, [{\n key: 'buildItem',\n value: function buildItem(option) {\n var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n }, {\n key: 'selectItem',\n value: function selectItem(item, trigger) {\n _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger);\n var colorLabel = this.label.querySelector('.ql-color-label');\n var value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n }]);\n\n return ColorPicker;\n}(_picker2.default);\n\nexports.default = ColorPicker;\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _picker = __webpack_require__(16);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar IconPicker = function (_Picker) {\n _inherits(IconPicker, _Picker);\n\n function IconPicker(select, icons) {\n _classCallCheck(this, IconPicker);\n\n var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select));\n\n _this.container.classList.add('ql-icon-picker');\n [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n });\n _this.defaultItem = _this.container.querySelector('.ql-selected');\n _this.selectItem(_this.defaultItem);\n return _this;\n }\n\n _createClass(IconPicker, [{\n key: 'selectItem',\n value: function selectItem(item, trigger) {\n _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger);\n item = item || this.defaultItem;\n this.label.innerHTML = item.innerHTML;\n }\n }]);\n\n return IconPicker;\n}(_picker2.default);\n\nexports.default = IconPicker;\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Tooltip = function () {\n function Tooltip(quill, boundsContainer) {\n var _this = this;\n\n _classCallCheck(this, Tooltip);\n\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (this.quill.root === this.quill.scrollingContainer) {\n this.quill.root.addEventListener('scroll', function () {\n _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px';\n });\n }\n this.hide();\n }\n\n _createClass(Tooltip, [{\n key: 'hide',\n value: function hide() {\n this.root.classList.add('ql-hidden');\n }\n }, {\n key: 'position',\n value: function position(reference) {\n var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n // root.scrollTop should be 0 if scrollContainer !== root\n var top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = left + 'px';\n this.root.style.top = top + 'px';\n this.root.classList.remove('ql-flip');\n var containerBounds = this.boundsContainer.getBoundingClientRect();\n var rootBounds = this.root.getBoundingClientRect();\n var shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = left + shift + 'px';\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = left + shift + 'px';\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n var height = rootBounds.bottom - rootBounds.top;\n var verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = top - verticalShift + 'px';\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n }, {\n key: 'show',\n value: function show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n }]);\n\n return Tooltip;\n}();\n\nexports.default = Tooltip;\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.BaseTooltip = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _emitter = __webpack_require__(9);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _keyboard = __webpack_require__(25);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\n\nvar _theme = __webpack_require__(32);\n\nvar _theme2 = _interopRequireDefault(_theme);\n\nvar _colorPicker = __webpack_require__(41);\n\nvar _colorPicker2 = _interopRequireDefault(_colorPicker);\n\nvar _iconPicker = __webpack_require__(42);\n\nvar _iconPicker2 = _interopRequireDefault(_iconPicker);\n\nvar _picker = __webpack_require__(16);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nvar _tooltip = __webpack_require__(43);\n\nvar _tooltip2 = _interopRequireDefault(_tooltip);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ALIGNS = [false, 'center', 'right', 'justify'];\n\nvar 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\"];\n\nvar FONTS = [false, 'serif', 'monospace'];\n\nvar HEADERS = ['1', '2', '3', false];\n\nvar SIZES = ['small', false, 'large', 'huge'];\n\nvar BaseTheme = function (_Theme) {\n _inherits(BaseTheme, _Theme);\n\n function BaseTheme(quill, options) {\n _classCallCheck(this, BaseTheme);\n\n var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options));\n\n var listener = function listener(e) {\n if (!document.body.contains(quill.root)) {\n return document.body.removeEventListener('click', listener);\n }\n if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) {\n _this.tooltip.hide();\n }\n if (_this.pickers != null) {\n _this.pickers.forEach(function (picker) {\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n return _this;\n }\n\n _createClass(BaseTheme, [{\n key: 'addModule',\n value: function addModule(name) {\n var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name);\n if (name === 'toolbar') {\n this.extendToolbar(module);\n }\n return module;\n }\n }, {\n key: 'buildButtons',\n value: function buildButtons(buttons, icons) {\n buttons.forEach(function (button) {\n var className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach(function (name) {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n button.innerHTML = icons[name][''] + icons[name]['rtl'];\n } else if (typeof icons[name] === 'string') {\n button.innerHTML = icons[name];\n } else {\n var value = button.value || '';\n if (value != null && icons[name][value]) {\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n }, {\n key: 'buildPickers',\n value: function buildPickers(selects, icons) {\n var _this2 = this;\n\n this.pickers = selects.map(function (select) {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n return new _iconPicker2.default(select, icons.align);\n } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {\n var format = select.classList.contains('ql-background') ? 'background' : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');\n }\n return new _colorPicker2.default(select, icons[format]);\n } else {\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new _picker2.default(select);\n }\n });\n var update = function update() {\n _this2.pickers.forEach(function (picker) {\n picker.update();\n });\n };\n this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update);\n }\n }]);\n\n return BaseTheme;\n}(_theme2.default);\n\nBaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula: function formula() {\n this.quill.theme.tooltip.edit('formula');\n },\n image: function image() {\n var _this3 = this;\n\n var fileInput = this.container.querySelector('input.ql-image[type=file]');\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon');\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', function () {\n if (fileInput.files != null && fileInput.files[0] != null) {\n var reader = new FileReader();\n reader.onload = function (e) {\n var range = _this3.quill.getSelection(true);\n _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER);\n _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT);\n fileInput.value = \"\";\n };\n reader.readAsDataURL(fileInput.files[0]);\n }\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video: function video() {\n this.quill.theme.tooltip.edit('video');\n }\n }\n }\n }\n});\n\nvar BaseTooltip = function (_Tooltip) {\n _inherits(BaseTooltip, _Tooltip);\n\n function BaseTooltip(quill, boundsContainer) {\n _classCallCheck(this, BaseTooltip);\n\n var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer));\n\n _this4.textbox = _this4.root.querySelector('input[type=\"text\"]');\n _this4.listen();\n return _this4;\n }\n\n _createClass(BaseTooltip, [{\n key: 'listen',\n value: function listen() {\n var _this5 = this;\n\n this.textbox.addEventListener('keydown', function (event) {\n if (_keyboard2.default.match(event, 'enter')) {\n _this5.save();\n event.preventDefault();\n } else if (_keyboard2.default.match(event, 'escape')) {\n _this5.cancel();\n event.preventDefault();\n }\n });\n }\n }, {\n key: 'cancel',\n value: function cancel() {\n this.hide();\n }\n }, {\n key: 'edit',\n value: function edit() {\n var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link';\n var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n this.position(this.quill.getBounds(this.quill.selection.savedRange));\n this.textbox.select();\n this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || '');\n this.root.setAttribute('data-mode', mode);\n }\n }, {\n key: 'restoreFocus',\n value: function restoreFocus() {\n var scrollTop = this.quill.scrollingContainer.scrollTop;\n this.quill.focus();\n this.quill.scrollingContainer.scrollTop = scrollTop;\n }\n }, {\n key: 'save',\n value: function save() {\n var value = this.textbox.value;\n switch (this.root.getAttribute('data-mode')) {\n case 'link':\n {\n var scrollTop = this.quill.root.scrollTop;\n if (this.linkRange) {\n this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER);\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, _emitter2.default.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video':\n {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula':\n {\n if (!value) break;\n var range = this.quill.getSelection(true);\n if (range != null) {\n var index = range.index + range.length;\n this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER);\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER);\n }\n this.quill.setSelection(index + 2, _emitter2.default.sources.USER);\n }\n break;\n }\n default:\n }\n this.textbox.value = '';\n this.hide();\n }\n }]);\n\n return BaseTooltip;\n}(_tooltip2.default);\n\nfunction extractVideoUrl(url) {\n var match = url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0';\n }\n if (match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/)) {\n // eslint-disable-line no-cond-assign\n return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/';\n }\n return url;\n}\n\nfunction fillSelect(select, values) {\n var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n values.forEach(function (value) {\n var option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', value);\n }\n select.appendChild(option);\n });\n}\n\nexports.BaseTooltip = BaseTooltip;\nexports.default = BaseTheme;\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _core = __webpack_require__(46);\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _align = __webpack_require__(34);\n\nvar _direction = __webpack_require__(36);\n\nvar _indent = __webpack_require__(62);\n\nvar _blockquote = __webpack_require__(63);\n\nvar _blockquote2 = _interopRequireDefault(_blockquote);\n\nvar _header = __webpack_require__(64);\n\nvar _header2 = _interopRequireDefault(_header);\n\nvar _list = __webpack_require__(65);\n\nvar _list2 = _interopRequireDefault(_list);\n\nvar _background = __webpack_require__(35);\n\nvar _color = __webpack_require__(24);\n\nvar _font = __webpack_require__(37);\n\nvar _size = __webpack_require__(38);\n\nvar _bold = __webpack_require__(39);\n\nvar _bold2 = _interopRequireDefault(_bold);\n\nvar _italic = __webpack_require__(66);\n\nvar _italic2 = _interopRequireDefault(_italic);\n\nvar _link = __webpack_require__(15);\n\nvar _link2 = _interopRequireDefault(_link);\n\nvar _script = __webpack_require__(67);\n\nvar _script2 = _interopRequireDefault(_script);\n\nvar _strike = __webpack_require__(68);\n\nvar _strike2 = _interopRequireDefault(_strike);\n\nvar _underline = __webpack_require__(69);\n\nvar _underline2 = _interopRequireDefault(_underline);\n\nvar _image = __webpack_require__(70);\n\nvar _image2 = _interopRequireDefault(_image);\n\nvar _video = __webpack_require__(71);\n\nvar _video2 = _interopRequireDefault(_video);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _formula = __webpack_require__(72);\n\nvar _formula2 = _interopRequireDefault(_formula);\n\nvar _syntax = __webpack_require__(73);\n\nvar _syntax2 = _interopRequireDefault(_syntax);\n\nvar _toolbar = __webpack_require__(74);\n\nvar _toolbar2 = _interopRequireDefault(_toolbar);\n\nvar _icons = __webpack_require__(26);\n\nvar _icons2 = _interopRequireDefault(_icons);\n\nvar _picker = __webpack_require__(16);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nvar _colorPicker = __webpack_require__(41);\n\nvar _colorPicker2 = _interopRequireDefault(_colorPicker);\n\nvar _iconPicker = __webpack_require__(42);\n\nvar _iconPicker2 = _interopRequireDefault(_iconPicker);\n\nvar _tooltip = __webpack_require__(43);\n\nvar _tooltip2 = _interopRequireDefault(_tooltip);\n\nvar _bubble = __webpack_require__(107);\n\nvar _bubble2 = _interopRequireDefault(_bubble);\n\nvar _snow = __webpack_require__(108);\n\nvar _snow2 = _interopRequireDefault(_snow);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_core2.default.register({\n 'attributors/attribute/direction': _direction.DirectionAttribute,\n\n 'attributors/class/align': _align.AlignClass,\n 'attributors/class/background': _background.BackgroundClass,\n 'attributors/class/color': _color.ColorClass,\n 'attributors/class/direction': _direction.DirectionClass,\n 'attributors/class/font': _font.FontClass,\n 'attributors/class/size': _size.SizeClass,\n\n 'attributors/style/align': _align.AlignStyle,\n 'attributors/style/background': _background.BackgroundStyle,\n 'attributors/style/color': _color.ColorStyle,\n 'attributors/style/direction': _direction.DirectionStyle,\n 'attributors/style/font': _font.FontStyle,\n 'attributors/style/size': _size.SizeStyle\n}, true);\n\n_core2.default.register({\n 'formats/align': _align.AlignClass,\n 'formats/direction': _direction.DirectionClass,\n 'formats/indent': _indent.IndentClass,\n\n 'formats/background': _background.BackgroundStyle,\n 'formats/color': _color.ColorStyle,\n 'formats/font': _font.FontClass,\n 'formats/size': _size.SizeClass,\n\n 'formats/blockquote': _blockquote2.default,\n 'formats/code-block': _code2.default,\n 'formats/header': _header2.default,\n 'formats/list': _list2.default,\n\n 'formats/bold': _bold2.default,\n 'formats/code': _code.Code,\n 'formats/italic': _italic2.default,\n 'formats/link': _link2.default,\n 'formats/script': _script2.default,\n 'formats/strike': _strike2.default,\n 'formats/underline': _underline2.default,\n\n 'formats/image': _image2.default,\n 'formats/video': _video2.default,\n\n 'formats/list/item': _list.ListItem,\n\n 'modules/formula': _formula2.default,\n 'modules/syntax': _syntax2.default,\n 'modules/toolbar': _toolbar2.default,\n\n 'themes/bubble': _bubble2.default,\n 'themes/snow': _snow2.default,\n\n 'ui/icons': _icons2.default,\n 'ui/picker': _picker2.default,\n 'ui/icon-picker': _iconPicker2.default,\n 'ui/color-picker': _colorPicker2.default,\n 'ui/tooltip': _tooltip2.default\n}, true);\n\nexports.default = _core2.default;\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _break = __webpack_require__(14);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _container = __webpack_require__(23);\n\nvar _container2 = _interopRequireDefault(_container);\n\nvar _cursor = __webpack_require__(31);\n\nvar _cursor2 = _interopRequireDefault(_cursor);\n\nvar _embed = __webpack_require__(33);\n\nvar _embed2 = _interopRequireDefault(_embed);\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nvar _scroll = __webpack_require__(59);\n\nvar _scroll2 = _interopRequireDefault(_scroll);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nvar _clipboard = __webpack_require__(60);\n\nvar _clipboard2 = _interopRequireDefault(_clipboard);\n\nvar _history = __webpack_require__(61);\n\nvar _history2 = _interopRequireDefault(_history);\n\nvar _keyboard = __webpack_require__(25);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_quill2.default.register({\n 'blots/block': _block2.default,\n 'blots/block/embed': _block.BlockEmbed,\n 'blots/break': _break2.default,\n 'blots/container': _container2.default,\n 'blots/cursor': _cursor2.default,\n 'blots/embed': _embed2.default,\n 'blots/inline': _inline2.default,\n 'blots/scroll': _scroll2.default,\n 'blots/text': _text2.default,\n\n 'modules/clipboard': _clipboard2.default,\n 'modules/history': _history2.default,\n 'modules/keyboard': _keyboard2.default\n});\n\n_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default);\n\nexports.default = _quill2.default;\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LinkedList = /** @class */ (function () {\n function LinkedList() {\n this.head = this.tail = null;\n this.length = 0;\n }\n LinkedList.prototype.append = function () {\n var nodes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodes[_i] = arguments[_i];\n }\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n };\n LinkedList.prototype.contains = function (node) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n if (cur === node)\n return true;\n }\n return false;\n };\n LinkedList.prototype.insertBefore = function (node, refNode) {\n if (!node)\n return;\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n }\n else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n }\n else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n };\n LinkedList.prototype.offset = function (target) {\n var index = 0, cur = this.head;\n while (cur != null) {\n if (cur === target)\n return index;\n index += cur.length();\n cur = cur.next;\n }\n return -1;\n };\n LinkedList.prototype.remove = function (node) {\n if (!this.contains(node))\n return;\n if (node.prev != null)\n node.prev.next = node.next;\n if (node.next != null)\n node.next.prev = node.prev;\n if (node === this.head)\n this.head = node.next;\n if (node === this.tail)\n this.tail = node.prev;\n this.length -= 1;\n };\n LinkedList.prototype.iterator = function (curNode) {\n if (curNode === void 0) { curNode = this.head; }\n // TODO use yield when we can\n return function () {\n var ret = curNode;\n if (curNode != null)\n curNode = curNode.next;\n return ret;\n };\n };\n LinkedList.prototype.find = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var cur, next = this.iterator();\n while ((cur = next())) {\n var length = cur.length();\n if (index < length ||\n (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) {\n return [cur, index];\n }\n index -= length;\n }\n return [null, 0];\n };\n LinkedList.prototype.forEach = function (callback) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n callback(cur);\n }\n };\n LinkedList.prototype.forEachAt = function (index, length, callback) {\n if (length <= 0)\n return;\n var _a = this.find(index), startNode = _a[0], offset = _a[1];\n var cur, curIndex = index - offset, next = this.iterator(startNode);\n while ((cur = next()) && curIndex < index + length) {\n var curLength = cur.length();\n if (index > curIndex) {\n callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n }\n else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n }\n };\n LinkedList.prototype.map = function (callback) {\n return this.reduce(function (memo, cur) {\n memo.push(callback(cur));\n return memo;\n }, []);\n };\n LinkedList.prototype.reduce = function (callback, memo) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n memo = callback(memo, cur);\n }\n return memo;\n };\n return LinkedList;\n}());\nexports.default = LinkedList;\n\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = __webpack_require__(17);\nvar Registry = __webpack_require__(1);\nvar OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\nvar MAX_OPTIMIZE_ITERATIONS = 100;\nvar ScrollBlot = /** @class */ (function (_super) {\n __extends(ScrollBlot, _super);\n function ScrollBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.scroll = _this;\n _this.observer = new MutationObserver(function (mutations) {\n _this.update(mutations);\n });\n _this.observer.observe(_this.domNode, OBSERVER_CONFIG);\n _this.attach();\n return _this;\n }\n ScrollBlot.prototype.detach = function () {\n _super.prototype.detach.call(this);\n this.observer.disconnect();\n };\n ScrollBlot.prototype.deleteAt = function (index, length) {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(function (child) {\n child.remove();\n });\n }\n else {\n _super.prototype.deleteAt.call(this, index, length);\n }\n };\n ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n this.update();\n _super.prototype.formatAt.call(this, index, length, name, value);\n };\n ScrollBlot.prototype.insertAt = function (index, value, def) {\n this.update();\n _super.prototype.insertAt.call(this, index, value, def);\n };\n ScrollBlot.prototype.optimize = function (mutations, context) {\n var _this = this;\n if (mutations === void 0) { mutations = []; }\n if (context === void 0) { context = {}; }\n _super.prototype.optimize.call(this, context);\n // We must modify mutations directly, cannot make copy and then modify\n var records = [].slice.call(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0)\n mutations.push(records.pop());\n // TODO use WeakMap\n var mark = function (blot, markParent) {\n if (markParent === void 0) { markParent = true; }\n if (blot == null || blot === _this)\n return;\n if (blot.domNode.parentNode == null)\n return;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [];\n }\n if (markParent)\n mark(blot.parent);\n };\n var optimize = function (blot) {\n // Post-order traversal\n if (\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY] == null ||\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations == null) {\n return;\n }\n if (blot instanceof container_1.default) {\n blot.children.forEach(optimize);\n }\n blot.optimize(context);\n };\n var remaining = mutations;\n for (var i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(Registry.find(mutation.previousSibling, false));\n [].forEach.call(mutation.addedNodes, function (node) {\n var child = Registry.find(node, false);\n mark(child, false);\n if (child instanceof container_1.default) {\n child.children.forEach(function (grandChild) {\n mark(grandChild, false);\n });\n }\n });\n }\n else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = [].slice.call(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0)\n mutations.push(records.pop());\n }\n };\n ScrollBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (context === void 0) { context = {}; }\n mutations = mutations || this.observer.takeRecords();\n // TODO use WeakMap\n mutations\n .map(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return null;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n return blot;\n }\n else {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n return null;\n }\n })\n .forEach(function (blot) {\n if (blot == null ||\n blot === _this ||\n //@ts-ignore\n blot.domNode[Registry.DATA_KEY] == null)\n return;\n // @ts-ignore\n blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);\n });\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY].mutations != null) {\n // @ts-ignore\n _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);\n }\n this.optimize(mutations, context);\n };\n ScrollBlot.blotName = 'scroll';\n ScrollBlot.defaultChild = 'block';\n ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n ScrollBlot.tagName = 'DIV';\n return ScrollBlot;\n}(container_1.default));\nexports.default = ScrollBlot;\n\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = __webpack_require__(18);\nvar Registry = __webpack_require__(1);\n// Shallow object comparison\nfunction isEqual(obj1, obj2) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length)\n return false;\n // @ts-ignore\n for (var prop in obj1) {\n // @ts-ignore\n if (obj1[prop] !== obj2[prop])\n return false;\n }\n return true;\n}\nvar InlineBlot = /** @class */ (function (_super) {\n __extends(InlineBlot, _super);\n function InlineBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n InlineBlot.formats = function (domNode) {\n if (domNode.tagName === InlineBlot.tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n InlineBlot.prototype.format = function (name, value) {\n var _this = this;\n if (name === this.statics.blotName && !value) {\n this.children.forEach(function (child) {\n if (!(child instanceof format_1.default)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n _this.attributes.copy(child);\n });\n this.unwrap();\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n InlineBlot.prototype.formatAt = function (index, length, name, value) {\n if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n var blot = this.isolate(index, length);\n blot.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n InlineBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n var formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n var next = this.next;\n if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n next.moveChildren(this);\n next.remove();\n }\n };\n InlineBlot.blotName = 'inline';\n InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n InlineBlot.tagName = 'SPAN';\n return InlineBlot;\n}(format_1.default));\nexports.default = InlineBlot;\n\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = __webpack_require__(18);\nvar Registry = __webpack_require__(1);\nvar BlockBlot = /** @class */ (function (_super) {\n __extends(BlockBlot, _super);\n function BlockBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BlockBlot.formats = function (domNode) {\n var tagName = Registry.query(BlockBlot.blotName).tagName;\n if (domNode.tagName === tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n BlockBlot.prototype.format = function (name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n return;\n }\n else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n BlockBlot.prototype.formatAt = function (index, length, name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n BlockBlot.prototype.insertAt = function (index, value, def) {\n if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n // Insert text or inline\n _super.prototype.insertAt.call(this, index, value, def);\n }\n else {\n var after = this.split(index);\n var blot = Registry.create(value, def);\n after.parent.insertBefore(blot, after);\n }\n };\n BlockBlot.prototype.update = function (mutations, context) {\n if (navigator.userAgent.match(/Trident/)) {\n this.build();\n }\n else {\n _super.prototype.update.call(this, mutations, context);\n }\n };\n BlockBlot.blotName = 'block';\n BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n BlockBlot.tagName = 'P';\n return BlockBlot;\n}(format_1.default));\nexports.default = BlockBlot;\n\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = __webpack_require__(19);\nvar EmbedBlot = /** @class */ (function (_super) {\n __extends(EmbedBlot, _super);\n function EmbedBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EmbedBlot.formats = function (domNode) {\n return undefined;\n };\n EmbedBlot.prototype.format = function (name, value) {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n };\n EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n EmbedBlot.prototype.formats = function () {\n return this.statics.formats(this.domNode);\n };\n return EmbedBlot;\n}(leaf_1.default));\nexports.default = EmbedBlot;\n\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = __webpack_require__(19);\nvar Registry = __webpack_require__(1);\nvar TextBlot = /** @class */ (function (_super) {\n __extends(TextBlot, _super);\n function TextBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.text = _this.statics.value(_this.domNode);\n return _this;\n }\n TextBlot.create = function (value) {\n return document.createTextNode(value);\n };\n TextBlot.value = function (domNode) {\n var text = domNode.data;\n // @ts-ignore\n if (text['normalize'])\n text = text['normalize']();\n return text;\n };\n TextBlot.prototype.deleteAt = function (index, length) {\n this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n };\n TextBlot.prototype.index = function (node, offset) {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n };\n TextBlot.prototype.insertAt = function (index, value, def) {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n }\n else {\n _super.prototype.insertAt.call(this, index, value, def);\n }\n };\n TextBlot.prototype.length = function () {\n return this.text.length;\n };\n TextBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n }\n else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), this.next.value());\n this.next.remove();\n }\n };\n TextBlot.prototype.position = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return [this.domNode, index];\n };\n TextBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = Registry.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next);\n this.text = this.statics.value(this.domNode);\n return after;\n };\n TextBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this.domNode;\n })) {\n this.text = this.statics.value(this.domNode);\n }\n };\n TextBlot.prototype.value = function () {\n return this.text;\n };\n TextBlot.blotName = 'text';\n TextBlot.scope = Registry.Scope.INLINE_BLOT;\n return TextBlot;\n}(leaf_1.default));\nexports.default = TextBlot;\n\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar elem = document.createElement('div');\nelem.classList.toggle('test-class', false);\nif (elem.classList.contains('test-class')) {\n var _toggle = DOMTokenList.prototype.toggle;\n DOMTokenList.prototype.toggle = function (token, force) {\n if (arguments.length > 1 && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n}\n\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function (searchString, position) {\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function (searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n}\n\nif (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, \"find\", {\n value: function value(predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n }\n });\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n // Disable resizing in Firefox\n document.execCommand(\"enableObjectResizing\", false, false);\n // Disable automatic linkifying in IE11\n document.execCommand(\"autoUrlDetect\", false, false);\n});\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports) {\n\n/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int} cursor_pos Expected edit position in text1 (optional)\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos) {\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n // Check cursor_pos within bounds\n if (cursor_pos < 0 || text1.length < cursor_pos) {\n cursor_pos = null;\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs);\n if (cursor_pos != null) {\n diffs = fix_cursor(diffs, cursor_pos);\n }\n diffs = fix_emoji(diffs);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [[DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n */\nfunction diff_cleanupMerge(diffs) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL,\n text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n if (count_delete === 0) {\n diffs.splice(pointer - count_insert,\n count_delete + count_insert, [DIFF_INSERT, text_insert]);\n } else if (count_insert === 0) {\n diffs.splice(pointer - count_delete,\n count_delete + count_insert, [DIFF_DELETE, text_delete]);\n } else {\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert, [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]);\n }\n pointer = pointer - count_delete - count_insert +\n (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n};\n\n\nvar diff = diff_main;\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n\n/*\n * Modify a diff such that the cursor position points to the start of a change:\n * E.g.\n * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)\n * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]\n * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)\n * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} A tuple [cursor location in the modified diff, modified diff]\n */\nfunction cursor_normalize_diff (diffs, cursor_pos) {\n if (cursor_pos === 0) {\n return [DIFF_EQUAL, diffs];\n }\n for (var current_pos = 0, i = 0; i < diffs.length; i++) {\n var d = diffs[i];\n if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {\n var next_pos = current_pos + d[1].length;\n if (cursor_pos === next_pos) {\n return [i + 1, diffs];\n } else if (cursor_pos < next_pos) {\n // copy to prevent side effects\n diffs = diffs.slice();\n // split d into two diff changes\n var split_pos = cursor_pos - current_pos;\n var d_left = [d[0], d[1].slice(0, split_pos)];\n var d_right = [d[0], d[1].slice(split_pos)];\n diffs.splice(i, 1, d_left, d_right);\n return [i + 1, diffs];\n } else {\n current_pos = next_pos;\n }\n }\n }\n throw new Error('cursor_pos is out of bounds!')\n}\n\n/*\n * Modify a diff such that the edit position is \"shifted\" to the proposed edit location (cursor_position).\n *\n * Case 1)\n * Check if a naive shift is possible:\n * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)\n * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result\n * Case 2)\n * Check if the following shifts are possible:\n * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']\n * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']\n * ^ ^\n * d d_next\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} Array of diff tuples\n */\nfunction fix_cursor (diffs, cursor_pos) {\n var norm = cursor_normalize_diff(diffs, cursor_pos);\n var ndiffs = norm[1];\n var cursor_pointer = norm[0];\n var d = ndiffs[cursor_pointer];\n var d_next = ndiffs[cursor_pointer + 1];\n\n if (d == null) {\n // Text was deleted from end of original string,\n // cursor is now out of bounds in new string\n return diffs;\n } else if (d[0] !== DIFF_EQUAL) {\n // A modification happened at the cursor location.\n // This is the expected outcome, so we can return the original diff.\n return diffs;\n } else {\n if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {\n // Case 1)\n // It is possible to perform a naive shift\n ndiffs.splice(cursor_pointer, 2, d_next, d)\n return merge_tuples(ndiffs, cursor_pointer, 2)\n } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {\n // Case 2)\n // d[1] is a prefix of d_next[1]\n // We can assume that d_next[0] !== 0, since d[0] === 0\n // Shift edit locations..\n ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);\n var suffix = d_next[1].slice(d[1].length);\n if (suffix.length > 0) {\n ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);\n }\n return merge_tuples(ndiffs, cursor_pointer, 3)\n } else {\n // Not possible to perform any modification\n return diffs;\n }\n }\n}\n\n/*\n * Check diff did not split surrogate pairs.\n * Ex. [0, '\\uD83D'], [-1, '\\uDC36'], [1, '\\uDC2F'] -> [-1, '\\uD83D\\uDC36'], [1, '\\uD83D\\uDC2F']\n * '\\uD83D\\uDC36' === '🐶', '\\uD83D\\uDC2F' === '🐯'\n *\n * @param {Array} diffs Array of diff tuples\n * @return {Array} Array of diff tuples\n */\nfunction fix_emoji (diffs) {\n var compact = false;\n var starts_with_pair_end = function(str) {\n return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF;\n }\n var ends_with_pair_start = function(str) {\n return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF;\n }\n for (var i = 2; i < diffs.length; i += 1) {\n if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) &&\n diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) &&\n diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) {\n compact = true;\n\n diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1];\n diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1];\n\n diffs[i-2][1] = diffs[i-2][1].slice(0, -1);\n }\n }\n if (!compact) {\n return diffs;\n }\n var fixed_diffs = [];\n for (var i = 0; i < diffs.length; i += 1) {\n if (diffs[i][1].length > 0) {\n fixed_diffs.push(diffs[i]);\n }\n }\n return fixed_diffs;\n}\n\n/*\n * Try to merge tuples with their neigbors in a given range.\n * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']\n *\n * @param {Array} diffs Array of diff tuples.\n * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).\n * @param {Int} length Number of consecutive elements to check.\n * @return {Array} Array of merged diff tuples.\n */\nfunction merge_tuples (diffs, start, length) {\n // Check from (start-1) to (start+length).\n for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {\n if (i + 1 < diffs.length) {\n var left_d = diffs[i];\n var right_d = diffs[i+1];\n if (left_d[0] === right_d[1]) {\n diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);\n }\n }\n }\n return diffs;\n}\n\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports) {\n\nexports = module.exports = typeof Object.keys === 'function'\n ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}\n\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports) {\n\nvar supportsArgumentsClass = (function(){\n return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n return object &&\n typeof object == 'object' &&\n typeof object.length == 'number' &&\n Object.prototype.hasOwnProperty.call(object, 'callee') &&\n !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n false;\n};\n\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _op = __webpack_require__(20);\n\nvar _op2 = _interopRequireDefault(_op);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _cursor = __webpack_require__(31);\n\nvar _cursor2 = _interopRequireDefault(_cursor);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _break = __webpack_require__(14);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _clone = __webpack_require__(21);\n\nvar _clone2 = _interopRequireDefault(_clone);\n\nvar _deepEqual = __webpack_require__(12);\n\nvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ASCII = /^[ -~]*$/;\n\nvar Editor = function () {\n function Editor(scroll) {\n _classCallCheck(this, Editor);\n\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n _createClass(Editor, [{\n key: 'applyDelta',\n value: function applyDelta(delta) {\n var _this = this;\n\n var consumeNextNewline = false;\n this.scroll.update();\n var scrollLength = this.scroll.length();\n this.scroll.batchStart();\n delta = normalizeDelta(delta);\n delta.reduce(function (index, op) {\n var length = op.retain || op.delete || op.insert.length || 1;\n var attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n var text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (index >= scrollLength && !text.endsWith('\\n')) {\n consumeNextNewline = true;\n }\n _this.scroll.insertAt(index, text);\n\n var _scroll$line = _this.scroll.line(index),\n _scroll$line2 = _slicedToArray(_scroll$line, 2),\n line = _scroll$line2[0],\n offset = _scroll$line2[1];\n\n var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line));\n if (line instanceof _block2.default) {\n var _line$descendant = line.descendant(_parchment2.default.Leaf, offset),\n _line$descendant2 = _slicedToArray(_line$descendant, 1),\n leaf = _line$descendant2[0];\n\n formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf));\n }\n attributes = _op2.default.attributes.diff(formats, attributes) || {};\n } else if (_typeof(op.insert) === 'object') {\n var key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n _this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach(function (name) {\n _this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n delta.reduce(function (index, op) {\n if (typeof op.delete === 'number') {\n _this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batchEnd();\n return this.update(delta);\n }\n }, {\n key: 'deleteText',\n value: function deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new _quillDelta2.default().retain(index).delete(length));\n }\n }, {\n key: 'formatLine',\n value: function formatLine(index, length) {\n var _this2 = this;\n\n var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n this.scroll.update();\n Object.keys(formats).forEach(function (format) {\n if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return;\n var lines = _this2.scroll.lines(index, Math.max(length, 1));\n var lengthRemaining = length;\n lines.forEach(function (line) {\n var lineLength = line.length();\n if (!(line instanceof _code2.default)) {\n line.format(format, formats[format]);\n } else {\n var codeIndex = index - line.offset(_this2.scroll);\n var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n line.formatAt(codeIndex, codeLength, format, formats[format]);\n }\n lengthRemaining -= lineLength;\n });\n });\n this.scroll.optimize();\n return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));\n }\n }, {\n key: 'formatText',\n value: function formatText(index, length) {\n var _this3 = this;\n\n var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n Object.keys(formats).forEach(function (format) {\n _this3.scroll.formatAt(index, length, format, formats[format]);\n });\n return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));\n }\n }, {\n key: 'getContents',\n value: function getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n }, {\n key: 'getDelta',\n value: function getDelta() {\n return this.scroll.lines().reduce(function (delta, line) {\n return delta.concat(line.delta());\n }, new _quillDelta2.default());\n }\n }, {\n key: 'getFormat',\n value: function getFormat(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var lines = [],\n leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(function (path) {\n var _path = _slicedToArray(path, 1),\n blot = _path[0];\n\n if (blot instanceof _block2.default) {\n lines.push(blot);\n } else if (blot instanceof _parchment2.default.Leaf) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length);\n }\n var formatsArr = [lines, leaves].map(function (blots) {\n if (blots.length === 0) return {};\n var formats = (0, _block.bubbleFormats)(blots.shift());\n while (Object.keys(formats).length > 0) {\n var blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats((0, _block.bubbleFormats)(blot), formats);\n }\n return formats;\n });\n return _extend2.default.apply(_extend2.default, formatsArr);\n }\n }, {\n key: 'getText',\n value: function getText(index, length) {\n return this.getContents(index, length).filter(function (op) {\n return typeof op.insert === 'string';\n }).map(function (op) {\n return op.insert;\n }).join('');\n }\n }, {\n key: 'insertEmbed',\n value: function insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value)));\n }\n }, {\n key: 'insertText',\n value: function insertText(index, text) {\n var _this4 = this;\n\n var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach(function (format) {\n _this4.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats)));\n }\n }, {\n key: 'isBlank',\n value: function isBlank() {\n if (this.scroll.children.length == 0) return true;\n if (this.scroll.children.length > 1) return false;\n var block = this.scroll.children.head;\n if (block.statics.blotName !== _block2.default.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof _break2.default;\n }\n }, {\n key: 'removeFormat',\n value: function removeFormat(index, length) {\n var text = this.getText(index, length);\n\n var _scroll$line3 = this.scroll.line(index + length),\n _scroll$line4 = _slicedToArray(_scroll$line3, 2),\n line = _scroll$line4[0],\n offset = _scroll$line4[1];\n\n var suffixLength = 0,\n suffix = new _quillDelta2.default();\n if (line != null) {\n if (!(line instanceof _code2.default)) {\n suffixLength = line.length() - offset;\n } else {\n suffixLength = line.newlineIndex(offset) - offset + 1;\n }\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n var contents = this.getContents(index, length + suffixLength);\n var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix));\n var delta = new _quillDelta2.default().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n }, {\n key: 'update',\n value: function update(change) {\n var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n\n var oldDelta = this.delta;\n if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) {\n // Optimization for character changes\n var textBlot = _parchment2.default.find(mutations[0].target);\n var formats = (0, _block.bubbleFormats)(textBlot);\n var index = textBlot.offset(this.scroll);\n var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, '');\n var oldText = new _quillDelta2.default().insert(oldValue);\n var newText = new _quillDelta2.default().insert(textBlot.value());\n var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex));\n change = diffDelta.reduce(function (delta, op) {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n } else {\n return delta.push(op);\n }\n }, new _quillDelta2.default());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, cursorIndex);\n }\n }\n return change;\n }\n }]);\n\n return Editor;\n}();\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce(function (merged, name) {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce(function (delta, op) {\n if (op.insert === 1) {\n var attributes = (0, _clone2.default)(op.attributes);\n delete attributes['image'];\n return delta.insert({ image: op.attributes.image }, attributes);\n }\n if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n op = (0, _clone2.default)(op);\n if (op.attributes.list) {\n op.attributes.list = 'ordered';\n } else {\n op.attributes.list = 'bullet';\n delete op.attributes.bullet;\n }\n }\n if (typeof op.insert === 'string') {\n var text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return delta.insert(text, op.attributes);\n }\n return delta.push(op);\n }, new _quillDelta2.default());\n}\n\nexports.default = Editor;\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports) {\n\n'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _emitter = __webpack_require__(9);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _break = __webpack_require__(14);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _container = __webpack_require__(23);\n\nvar _container2 = _interopRequireDefault(_container);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction isLine(blot) {\n return blot instanceof _block2.default || blot instanceof _block.BlockEmbed;\n}\n\nvar Scroll = function (_Parchment$Scroll) {\n _inherits(Scroll, _Parchment$Scroll);\n\n function Scroll(domNode, config) {\n _classCallCheck(this, Scroll);\n\n var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode));\n\n _this.emitter = config.emitter;\n if (Array.isArray(config.whitelist)) {\n _this.whitelist = config.whitelist.reduce(function (whitelist, format) {\n whitelist[format] = true;\n return whitelist;\n }, {});\n }\n // Some reason fixes composition issues with character languages in Windows/Chrome, Safari\n _this.domNode.addEventListener('DOMNodeInserted', function () {});\n _this.optimize();\n _this.enable();\n return _this;\n }\n\n _createClass(Scroll, [{\n key: 'batchStart',\n value: function batchStart() {\n this.batch = true;\n }\n }, {\n key: 'batchEnd',\n value: function batchEnd() {\n this.batch = false;\n this.optimize();\n }\n }, {\n key: 'deleteAt',\n value: function deleteAt(index, length) {\n var _line = this.line(index),\n _line2 = _slicedToArray(_line, 2),\n first = _line2[0],\n offset = _line2[1];\n\n var _line3 = this.line(index + length),\n _line4 = _slicedToArray(_line3, 1),\n last = _line4[0];\n\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) {\n this.optimize();\n return;\n }\n if (first instanceof _code2.default) {\n var newlineIndex = first.newlineIndex(first.length(), true);\n if (newlineIndex > -1) {\n first = first.split(newlineIndex + 1);\n if (first === last) {\n this.optimize();\n return;\n }\n }\n } else if (last instanceof _code2.default) {\n var _newlineIndex = last.newlineIndex(0);\n if (_newlineIndex > -1) {\n last.split(_newlineIndex + 1);\n }\n }\n var ref = last.children.head instanceof _break2.default ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n }, {\n key: 'enable',\n value: function enable() {\n var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n this.domNode.setAttribute('contenteditable', enabled);\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, format, value) {\n if (this.whitelist != null && !this.whitelist[format]) return;\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value);\n this.optimize();\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n if (index >= this.length()) {\n if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) {\n var blot = _parchment2.default.create(this.statics.defaultChild);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n value = value.slice(0, -1);\n }\n blot.insertAt(0, value, def);\n } else {\n var embed = _parchment2.default.create(value, def);\n this.appendChild(embed);\n }\n } else {\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def);\n }\n this.optimize();\n }\n }, {\n key: 'insertBefore',\n value: function insertBefore(blot, ref) {\n if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) {\n var wrapper = _parchment2.default.create(this.statics.defaultChild);\n wrapper.appendChild(blot);\n blot = wrapper;\n }\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref);\n }\n }, {\n key: 'leaf',\n value: function leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n }, {\n key: 'line',\n value: function line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n }, {\n key: 'lines',\n value: function lines() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n var getLines = function getLines(blot, index, length) {\n var lines = [],\n lengthLeft = length;\n blot.children.forEachAt(index, length, function (child, index, length) {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof _parchment2.default.Container) {\n lines = lines.concat(getLines(child, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return lines;\n };\n return getLines(this, index, length);\n }\n }, {\n key: 'optimize',\n value: function optimize() {\n var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (this.batch === true) return;\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n }, {\n key: 'path',\n value: function path(index) {\n return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self\n }\n }, {\n key: 'update',\n value: function update(mutations) {\n if (this.batch === true) return;\n var source = _emitter2.default.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations);\n }\n }\n }]);\n\n return Scroll;\n}(_parchment2.default.Scroll);\n\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = 'block';\nScroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default];\n\nexports.default = Scroll;\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extend2 = __webpack_require__(2);\n\nvar _extend3 = _interopRequireDefault(_extend2);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nvar _align = __webpack_require__(34);\n\nvar _background = __webpack_require__(35);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _color = __webpack_require__(24);\n\nvar _direction = __webpack_require__(36);\n\nvar _font = __webpack_require__(37);\n\nvar _size = __webpack_require__(38);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:clipboard');\n\nvar DOM_KEY = '__ql-matcher';\n\nvar CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]];\n\nvar ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nvar STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nvar Clipboard = function (_Module) {\n _inherits(Clipboard, _Module);\n\n function Clipboard(quill, options) {\n _classCallCheck(this, Clipboard);\n\n var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options));\n\n _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this));\n _this.container = _this.quill.addContainer('ql-clipboard');\n _this.container.setAttribute('contenteditable', true);\n _this.container.setAttribute('tabindex', -1);\n _this.matchers = [];\n CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n selector = _ref2[0],\n matcher = _ref2[1];\n\n if (!options.matchVisual && matcher === matchSpacing) return;\n _this.addMatcher(selector, matcher);\n });\n return _this;\n }\n\n _createClass(Clipboard, [{\n key: 'addMatcher',\n value: function addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n }, {\n key: 'convert',\n value: function convert(html) {\n if (typeof html === 'string') {\n this.container.innerHTML = html.replace(/\\>\\r?\\n +\\<'); // Remove spaces between tags\n return this.convert();\n }\n var formats = this.quill.getFormat(this.quill.selection.savedRange.index);\n if (formats[_code2.default.blotName]) {\n var text = this.container.innerText;\n this.container.innerHTML = '';\n return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName]));\n }\n\n var _prepareMatching = this.prepareMatching(),\n _prepareMatching2 = _slicedToArray(_prepareMatching, 2),\n elementMatchers = _prepareMatching2[0],\n textMatchers = _prepareMatching2[1];\n\n var delta = traverse(this.container, elementMatchers, textMatchers);\n // Remove trailing newline\n if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1));\n }\n debug.log('convert', this.container.innerHTML, delta);\n this.container.innerHTML = '';\n return delta;\n }\n }, {\n key: 'dangerouslyPasteHTML',\n value: function dangerouslyPasteHTML(index, html) {\n var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API;\n\n if (typeof index === 'string') {\n this.quill.setContents(this.convert(index), html);\n this.quill.setSelection(0, _quill2.default.sources.SILENT);\n } else {\n var paste = this.convert(html);\n this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source);\n this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT);\n }\n }\n }, {\n key: 'onPaste',\n value: function onPaste(e) {\n var _this2 = this;\n\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n var range = this.quill.getSelection();\n var delta = new _quillDelta2.default().retain(range.index);\n var scrollTop = this.quill.scrollingContainer.scrollTop;\n this.container.focus();\n this.quill.selection.update(_quill2.default.sources.SILENT);\n setTimeout(function () {\n delta = delta.concat(_this2.convert()).delete(range.length);\n _this2.quill.updateContents(delta, _quill2.default.sources.USER);\n // range.length contributes to delta.length()\n _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);\n _this2.quill.scrollingContainer.scrollTop = scrollTop;\n _this2.quill.focus();\n }, 1);\n }\n }, {\n key: 'prepareMatching',\n value: function prepareMatching() {\n var _this3 = this;\n\n var elementMatchers = [],\n textMatchers = [];\n this.matchers.forEach(function (pair) {\n var _pair = _slicedToArray(pair, 2),\n selector = _pair[0],\n matcher = _pair[1];\n\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n [].forEach.call(_this3.container.querySelectorAll(selector), function (node) {\n // TODO use weakmap\n node[DOM_KEY] = node[DOM_KEY] || [];\n node[DOM_KEY].push(matcher);\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n }]);\n\n return Clipboard;\n}(_module2.default);\n\nClipboard.DEFAULTS = {\n matchers: [],\n matchVisual: true\n};\n\nfunction applyFormat(delta, format, value) {\n if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') {\n return Object.keys(format).reduce(function (delta, key) {\n return applyFormat(delta, key, format[key]);\n }, delta);\n } else {\n return delta.reduce(function (delta, op) {\n if (op.attributes && op.attributes[format]) {\n return delta.push(op);\n } else {\n return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes));\n }\n }, new _quillDelta2.default());\n }\n}\n\nfunction computeStyle(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) return {};\n var DOM_KEY = '__ql-computed-style';\n return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n}\n\nfunction deltaEndsWith(delta, text) {\n var endText = \"\";\n for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n var op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1 * text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n var style = computeStyle(node);\n return ['block', 'list-item'].indexOf(style.display) > -1;\n}\n\nfunction traverse(node, elementMatchers, textMatchers) {\n // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce(function (delta, matcher) {\n return matcher(node, delta);\n }, new _quillDelta2.default());\n } else if (node.nodeType === node.ELEMENT_NODE) {\n return [].reduce.call(node.childNodes || [], function (delta, childNode) {\n var childrenDelta = traverse(childNode, elementMatchers, textMatchers);\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n }\n return delta.concat(childrenDelta);\n }, new _quillDelta2.default());\n } else {\n return new _quillDelta2.default();\n }\n}\n\nfunction matchAlias(format, node, delta) {\n return applyFormat(delta, format, true);\n}\n\nfunction matchAttributor(node, delta) {\n var attributes = _parchment2.default.Attributor.Attribute.keys(node);\n var classes = _parchment2.default.Attributor.Class.keys(node);\n var styles = _parchment2.default.Attributor.Style.keys(node);\n var formats = {};\n attributes.concat(classes).concat(styles).forEach(function (name) {\n var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n return delta;\n}\n\nfunction matchBlot(node, delta) {\n var match = _parchment2.default.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof _parchment2.default.Embed) {\n var embed = {};\n var value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n delta = new _quillDelta2.default().insert(embed, match.formats(node));\n }\n } else if (typeof match.formats === 'function') {\n delta = applyFormat(delta, match.blotName, match.formats(node));\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchIgnore() {\n return new _quillDelta2.default();\n}\n\nfunction matchIndent(node, delta) {\n var match = _parchment2.default.query(node);\n if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\\n')) {\n return delta;\n }\n var indent = -1,\n parent = node.parentNode;\n while (!parent.classList.contains('ql-clipboard')) {\n if ((_parchment2.default.query(parent) || {}).blotName === 'list') {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent }));\n}\n\nfunction matchNewline(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchSpacing(node, delta) {\n if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\\n\\n')) {\n var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);\n if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n var formats = {};\n var style = node.style || {};\n if (style.fontStyle && computeStyle(node).fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n if (parseFloat(style.textIndent || 0) > 0) {\n // Could be 0.5in\n delta = new _quillDelta2.default().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchText(node, delta) {\n var text = node.data;\n // Word represents empty line with  \n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) {\n return delta;\n }\n if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n // eslint-disable-next-line func-style\n var replacer = function replacer(collapse, match) {\n match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return match.length < 1 && collapse ? ' ' : match;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\nexports.default = Clipboard;\nexports.matchAttributor = matchAttributor;\nexports.matchBlot = matchBlot;\nexports.matchNewline = matchNewline;\nexports.matchSpacing = matchSpacing;\nexports.matchText = matchText;\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getLastChangeIndex = exports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar History = function (_Module) {\n _inherits(History, _Module);\n\n function History(quill, options) {\n _classCallCheck(this, History);\n\n var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options));\n\n _this.lastRecorded = 0;\n _this.ignoreChange = false;\n _this.clear();\n _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) {\n if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return;\n if (!_this.options.userOnly || source === _quill2.default.sources.USER) {\n _this.record(delta, oldDelta);\n } else {\n _this.transform(delta);\n }\n });\n _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this));\n _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this));\n if (/Win/i.test(navigator.platform)) {\n _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this));\n }\n return _this;\n }\n\n _createClass(History, [{\n key: 'change',\n value: function change(source, dest) {\n if (this.stack[source].length === 0) return;\n var delta = this.stack[source].pop();\n this.stack[dest].push(delta);\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta[source], _quill2.default.sources.USER);\n this.ignoreChange = false;\n var index = getLastChangeIndex(delta[source]);\n this.quill.setSelection(index);\n }\n }, {\n key: 'clear',\n value: function clear() {\n this.stack = { undo: [], redo: [] };\n }\n }, {\n key: 'cutoff',\n value: function cutoff() {\n this.lastRecorded = 0;\n }\n }, {\n key: 'record',\n value: function record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n var undoDelta = this.quill.getContents().diff(oldDelta);\n var timestamp = Date.now();\n if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n var delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta.undo);\n changeDelta = delta.redo.compose(changeDelta);\n } else {\n this.lastRecorded = timestamp;\n }\n this.stack.undo.push({\n redo: changeDelta,\n undo: undoDelta\n });\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n }, {\n key: 'redo',\n value: function redo() {\n this.change('redo', 'undo');\n }\n }, {\n key: 'transform',\n value: function transform(delta) {\n this.stack.undo.forEach(function (change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n this.stack.redo.forEach(function (change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n }\n }, {\n key: 'undo',\n value: function undo() {\n this.change('undo', 'redo');\n }\n }]);\n\n return History;\n}(_module2.default);\n\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false\n};\n\nfunction endsWithNewlineChange(delta) {\n var lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(function (attr) {\n return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(delta) {\n var deleteLength = delta.reduce(function (length, op) {\n length += op.delete || 0;\n return length;\n }, 0);\n var changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\nexports.default = History;\nexports.getLastChangeIndex = getLastChangeIndex;\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.IndentClass = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar IdentAttributor = function (_Parchment$Attributor) {\n _inherits(IdentAttributor, _Parchment$Attributor);\n\n function IdentAttributor() {\n _classCallCheck(this, IdentAttributor);\n\n return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments));\n }\n\n _createClass(IdentAttributor, [{\n key: 'add',\n value: function add(node, value) {\n if (value === '+1' || value === '-1') {\n var indent = this.value(node) || 0;\n value = value === '+1' ? indent + 1 : indent - 1;\n }\n if (value === 0) {\n this.remove(node);\n return true;\n } else {\n return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value);\n }\n }\n }, {\n key: 'canAdd',\n value: function canAdd(node, value) {\n return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value));\n }\n }, {\n key: 'value',\n value: function value(node) {\n return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN\n }\n }]);\n\n return IdentAttributor;\n}(_parchment2.default.Attributor.Class);\n\nvar IndentClass = new IdentAttributor('indent', 'ql-indent', {\n scope: _parchment2.default.Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n});\n\nexports.IndentClass = IndentClass;\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Blockquote = function (_Block) {\n _inherits(Blockquote, _Block);\n\n function Blockquote() {\n _classCallCheck(this, Blockquote);\n\n return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments));\n }\n\n return Blockquote;\n}(_block2.default);\n\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\nexports.default = Blockquote;\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Header = function (_Block) {\n _inherits(Header, _Block);\n\n function Header() {\n _classCallCheck(this, Header);\n\n return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments));\n }\n\n _createClass(Header, null, [{\n key: 'formats',\n value: function formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n }]);\n\n return Header;\n}(_block2.default);\n\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\nexports.default = Header;\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.ListItem = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _container = __webpack_require__(23);\n\nvar _container2 = _interopRequireDefault(_container);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ListItem = function (_Block) {\n _inherits(ListItem, _Block);\n\n function ListItem() {\n _classCallCheck(this, ListItem);\n\n return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments));\n }\n\n _createClass(ListItem, [{\n key: 'format',\n value: function format(name, value) {\n if (name === List.blotName && !value) {\n this.replaceWith(_parchment2.default.create(this.statics.scope));\n } else {\n _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value);\n }\n }\n }, {\n key: 'remove',\n value: function remove() {\n if (this.prev == null && this.next == null) {\n this.parent.remove();\n } else {\n _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this);\n }\n }\n }, {\n key: 'replaceWith',\n value: function replaceWith(name, value) {\n this.parent.isolate(this.offset(this.parent), this.length());\n if (name === this.parent.statics.blotName) {\n this.parent.replaceWith(name, value);\n return this;\n } else {\n this.parent.unwrap();\n return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value);\n }\n }\n }], [{\n key: 'formats',\n value: function formats(domNode) {\n return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode);\n }\n }]);\n\n return ListItem;\n}(_block2.default);\n\nListItem.blotName = 'list-item';\nListItem.tagName = 'LI';\n\nvar List = function (_Container) {\n _inherits(List, _Container);\n\n _createClass(List, null, [{\n key: 'create',\n value: function create(value) {\n var tagName = value === 'ordered' ? 'OL' : 'UL';\n var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName);\n if (value === 'checked' || value === 'unchecked') {\n node.setAttribute('data-checked', value === 'checked');\n }\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n if (domNode.tagName === 'OL') return 'ordered';\n if (domNode.tagName === 'UL') {\n if (domNode.hasAttribute('data-checked')) {\n return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked';\n } else {\n return 'bullet';\n }\n }\n return undefined;\n }\n }]);\n\n function List(domNode) {\n _classCallCheck(this, List);\n\n var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode));\n\n var listEventHandler = function listEventHandler(e) {\n if (e.target.parentNode !== domNode) return;\n var format = _this2.statics.formats(domNode);\n var blot = _parchment2.default.find(e.target);\n if (format === 'checked') {\n blot.format('list', 'unchecked');\n } else if (format === 'unchecked') {\n blot.format('list', 'checked');\n }\n };\n\n domNode.addEventListener('touchstart', listEventHandler);\n domNode.addEventListener('mousedown', listEventHandler);\n return _this2;\n }\n\n _createClass(List, [{\n key: 'format',\n value: function format(name, value) {\n if (this.children.length > 0) {\n this.children.tail.format(name, value);\n }\n }\n }, {\n key: 'formats',\n value: function formats() {\n // We don't inherit from FormatBlot\n return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode));\n }\n }, {\n key: 'insertBefore',\n value: function insertBefore(blot, ref) {\n if (blot instanceof ListItem) {\n _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref);\n } else {\n var index = ref == null ? this.length() : ref.offset(this);\n var after = this.split(index);\n after.parent.insertBefore(blot, after);\n }\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context);\n var next = this.next;\n if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) {\n next.moveChildren(this);\n next.remove();\n }\n }\n }, {\n key: 'replace',\n value: function replace(target) {\n if (target.statics.blotName !== this.statics.blotName) {\n var item = _parchment2.default.create(this.statics.defaultChild);\n target.moveChildren(item);\n this.appendChild(item);\n }\n _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target);\n }\n }]);\n\n return List;\n}(_container2.default);\n\nList.blotName = 'list';\nList.scope = _parchment2.default.Scope.BLOCK_BLOT;\nList.tagName = ['OL', 'UL'];\nList.defaultChild = 'list-item';\nList.allowedChildren = [ListItem];\n\nexports.ListItem = ListItem;\nexports.default = List;\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _bold = __webpack_require__(39);\n\nvar _bold2 = _interopRequireDefault(_bold);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Italic = function (_Bold) {\n _inherits(Italic, _Bold);\n\n function Italic() {\n _classCallCheck(this, Italic);\n\n return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments));\n }\n\n return Italic;\n}(_bold2.default);\n\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexports.default = Italic;\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Script = function (_Inline) {\n _inherits(Script, _Inline);\n\n function Script() {\n _classCallCheck(this, Script);\n\n return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments));\n }\n\n _createClass(Script, null, [{\n key: 'create',\n value: function create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n } else if (value === 'sub') {\n return document.createElement('sub');\n } else {\n return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value);\n }\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n }]);\n\n return Script;\n}(_inline2.default);\n\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexports.default = Script;\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Strike = function (_Inline) {\n _inherits(Strike, _Inline);\n\n function Strike() {\n _classCallCheck(this, Strike);\n\n return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments));\n }\n\n return Strike;\n}(_inline2.default);\n\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexports.default = Strike;\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Underline = function (_Inline) {\n _inherits(Underline, _Inline);\n\n function Underline() {\n _classCallCheck(this, Underline);\n\n return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments));\n }\n\n return Underline;\n}(_inline2.default);\n\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexports.default = Underline;\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _link = __webpack_require__(15);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ATTRIBUTES = ['alt', 'height', 'width'];\n\nvar Image = function (_Parchment$Embed) {\n _inherits(Image, _Parchment$Embed);\n\n function Image() {\n _classCallCheck(this, Image);\n\n return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments));\n }\n\n _createClass(Image, [{\n key: 'format',\n value: function format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value);\n }\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n return ATTRIBUTES.reduce(function (formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n }, {\n key: 'match',\n value: function match(url) {\n return (/\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url)\n );\n }\n }, {\n key: 'sanitize',\n value: function sanitize(url) {\n return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n }, {\n key: 'value',\n value: function value(domNode) {\n return domNode.getAttribute('src');\n }\n }]);\n\n return Image;\n}(_parchment2.default.Embed);\n\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\nexports.default = Image;\n\n/***/ }),\n/* 71 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _block = __webpack_require__(3);\n\nvar _link = __webpack_require__(15);\n\nvar _link2 = _interopRequireDefault(_link);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ATTRIBUTES = ['height', 'width'];\n\nvar Video = function (_BlockEmbed) {\n _inherits(Video, _BlockEmbed);\n\n function Video() {\n _classCallCheck(this, Video);\n\n return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments));\n }\n\n _createClass(Video, [{\n key: 'format',\n value: function format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value);\n }\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n return ATTRIBUTES.reduce(function (formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n }, {\n key: 'sanitize',\n value: function sanitize(url) {\n return _link2.default.sanitize(url);\n }\n }, {\n key: 'value',\n value: function value(domNode) {\n return domNode.getAttribute('src');\n }\n }]);\n\n return Video;\n}(_block.BlockEmbed);\n\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\nexports.default = Video;\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.FormulaBlot = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _embed = __webpack_require__(33);\n\nvar _embed2 = _interopRequireDefault(_embed);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar FormulaBlot = function (_Embed) {\n _inherits(FormulaBlot, _Embed);\n\n function FormulaBlot() {\n _classCallCheck(this, FormulaBlot);\n\n return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments));\n }\n\n _createClass(FormulaBlot, null, [{\n key: 'create',\n value: function create(value) {\n var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value);\n if (typeof value === 'string') {\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00'\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n }, {\n key: 'value',\n value: function value(domNode) {\n return domNode.getAttribute('data-value');\n }\n }]);\n\n return FormulaBlot;\n}(_embed2.default);\n\nFormulaBlot.blotName = 'formula';\nFormulaBlot.className = 'ql-formula';\nFormulaBlot.tagName = 'SPAN';\n\nvar Formula = function (_Module) {\n _inherits(Formula, _Module);\n\n _createClass(Formula, null, [{\n key: 'register',\n value: function register() {\n _quill2.default.register(FormulaBlot, true);\n }\n }]);\n\n function Formula() {\n _classCallCheck(this, Formula);\n\n var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this));\n\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n return _this2;\n }\n\n return Formula;\n}(_module2.default);\n\nexports.FormulaBlot = FormulaBlot;\nexports.default = Formula;\n\n/***/ }),\n/* 73 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.CodeToken = exports.CodeBlock = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar SyntaxCodeBlock = function (_CodeBlock) {\n _inherits(SyntaxCodeBlock, _CodeBlock);\n\n function SyntaxCodeBlock() {\n _classCallCheck(this, SyntaxCodeBlock);\n\n return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments));\n }\n\n _createClass(SyntaxCodeBlock, [{\n key: 'replaceWith',\n value: function replaceWith(block) {\n this.domNode.textContent = this.domNode.textContent;\n this.attach();\n _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block);\n }\n }, {\n key: 'highlight',\n value: function highlight(_highlight) {\n var text = this.domNode.textContent;\n if (this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n this.domNode.innerHTML = _highlight(text);\n this.domNode.normalize();\n this.attach();\n }\n this.cachedText = text;\n }\n }\n }]);\n\n return SyntaxCodeBlock;\n}(_code2.default);\n\nSyntaxCodeBlock.className = 'ql-syntax';\n\nvar CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', {\n scope: _parchment2.default.Scope.INLINE\n});\n\nvar Syntax = function (_Module) {\n _inherits(Syntax, _Module);\n\n _createClass(Syntax, null, [{\n key: 'register',\n value: function register() {\n _quill2.default.register(CodeToken, true);\n _quill2.default.register(SyntaxCodeBlock, true);\n }\n }]);\n\n function Syntax(quill, options) {\n _classCallCheck(this, Syntax);\n\n var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options));\n\n if (typeof _this2.options.highlight !== 'function') {\n throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');\n }\n var timer = null;\n _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {\n clearTimeout(timer);\n timer = setTimeout(function () {\n _this2.highlight();\n timer = null;\n }, _this2.options.interval);\n });\n _this2.highlight();\n return _this2;\n }\n\n _createClass(Syntax, [{\n key: 'highlight',\n value: function highlight() {\n var _this3 = this;\n\n if (this.quill.selection.composing) return;\n this.quill.update(_quill2.default.sources.USER);\n var range = this.quill.getSelection();\n this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) {\n code.highlight(_this3.options.highlight);\n });\n this.quill.update(_quill2.default.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, _quill2.default.sources.SILENT);\n }\n }\n }]);\n\n return Syntax;\n}(_module2.default);\n\nSyntax.DEFAULTS = {\n highlight: function () {\n if (window.hljs == null) return null;\n return function (text) {\n var result = window.hljs.highlightAuto(text);\n return result.value;\n };\n }(),\n interval: 1000\n};\n\nexports.CodeBlock = SyntaxCodeBlock;\nexports.CodeToken = CodeToken;\nexports.default = Syntax;\n\n/***/ }),\n/* 74 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addControls = exports.default = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:toolbar');\n\nvar Toolbar = function (_Module) {\n _inherits(Toolbar, _Module);\n\n function Toolbar(quill, options) {\n _classCallCheck(this, Toolbar);\n\n var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options));\n\n if (Array.isArray(_this.options.container)) {\n var container = document.createElement('div');\n addControls(container, _this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n _this.container = container;\n } else if (typeof _this.options.container === 'string') {\n _this.container = document.querySelector(_this.options.container);\n } else {\n _this.container = _this.options.container;\n }\n if (!(_this.container instanceof HTMLElement)) {\n var _ret;\n\n return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret);\n }\n _this.container.classList.add('ql-toolbar');\n _this.controls = [];\n _this.handlers = {};\n Object.keys(_this.options.handlers).forEach(function (format) {\n _this.addHandler(format, _this.options.handlers[format]);\n });\n [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) {\n _this.attach(input);\n });\n _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) {\n if (type === _quill2.default.events.SELECTION_CHANGE) {\n _this.update(range);\n }\n });\n _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {\n var _this$quill$selection = _this.quill.selection.getRange(),\n _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1),\n range = _this$quill$selection2[0]; // quill.getSelection triggers update\n\n\n _this.update(range);\n });\n return _this;\n }\n\n _createClass(Toolbar, [{\n key: 'addHandler',\n value: function addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n }, {\n key: 'attach',\n value: function attach(input) {\n var _this2 = this;\n\n var format = [].find.call(input.classList, function (className) {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (this.handlers[format] == null) {\n if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n debug.warn('ignoring attaching to disabled format', format, input);\n return;\n }\n if (_parchment2.default.query(format) == null) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n }\n var eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, function (e) {\n var value = void 0;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n var selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n _this2.quill.focus();\n\n var _quill$selection$getR = _this2.quill.selection.getRange(),\n _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1),\n range = _quill$selection$getR2[0];\n\n if (_this2.handlers[format] != null) {\n _this2.handlers[format].call(_this2, value);\n } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) {\n value = prompt('Enter ' + format);\n if (!value) return;\n _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER);\n } else {\n _this2.quill.format(format, value, _quill2.default.sources.USER);\n }\n _this2.update(range);\n });\n // TODO use weakmap\n this.controls.push([format, input]);\n }\n }, {\n key: 'update',\n value: function update(range) {\n var formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(function (pair) {\n var _pair = _slicedToArray(pair, 2),\n format = _pair[0],\n input = _pair[1];\n\n if (input.tagName === 'SELECT') {\n var option = void 0;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n var value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\\\"/g, '\\\\\"');\n }\n option = input.querySelector('option[value=\"' + value + '\"]');\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else {\n if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value');\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n }\n });\n }\n }]);\n\n return Toolbar;\n}(_module2.default);\n\nToolbar.DEFAULTS = {};\n\nfunction addButton(container, format, value) {\n var input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add('ql-' + format);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(function (controls) {\n var group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(function (control) {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n var format = Object.keys(control)[0];\n var value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n var input = document.createElement('select');\n input.classList.add('ql-' + format);\n values.forEach(function (value) {\n var option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean: function clean() {\n var _this3 = this;\n\n var range = this.quill.getSelection();\n if (range == null) return;\n if (range.length == 0) {\n var formats = this.quill.getFormat();\n Object.keys(formats).forEach(function (name) {\n // Clean functionality in existing apps only clean inline formats\n if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) {\n _this3.quill.format(name, false);\n }\n });\n } else {\n this.quill.removeFormat(range, _quill2.default.sources.USER);\n }\n },\n direction: function direction(value) {\n var align = this.quill.getFormat()['align'];\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', _quill2.default.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, _quill2.default.sources.USER);\n }\n this.quill.format('direction', value, _quill2.default.sources.USER);\n },\n indent: function indent(value) {\n var range = this.quill.getSelection();\n var formats = this.quill.getFormat(range);\n var indent = parseInt(formats.indent || 0);\n if (value === '+1' || value === '-1') {\n var modifier = value === '+1' ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, _quill2.default.sources.USER);\n }\n },\n link: function link(value) {\n if (value === true) {\n value = prompt('Enter link URL:');\n }\n this.quill.format('link', value, _quill2.default.sources.USER);\n },\n list: function list(value) {\n var range = this.quill.getSelection();\n var formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats['list'] === 'checked' || formats['list'] === 'unchecked') {\n this.quill.format('list', false, _quill2.default.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', _quill2.default.sources.USER);\n }\n } else {\n this.quill.format('list', value, _quill2.default.sources.USER);\n }\n }\n }\n};\n\nexports.default = Toolbar;\nexports.addControls = addControls;\n\n/***/ }),\n/* 75 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 76 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 77 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 78 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 79 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 80 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 81 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 82 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 83 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 84 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 85 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 86 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 87 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 88 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 89 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 90 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 91 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 92 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 93 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 94 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 95 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 96 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 97 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 98 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 99 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 100 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 101 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 102 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 103 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 104 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 105 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 106 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 107 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.BubbleTooltip = undefined;\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _emitter = __webpack_require__(9);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _base = __webpack_require__(44);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _selection = __webpack_require__(22);\n\nvar _icons = __webpack_require__(26);\n\nvar _icons2 = _interopRequireDefault(_icons);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']];\n\nvar BubbleTheme = function (_BaseTheme) {\n _inherits(BubbleTheme, _BaseTheme);\n\n function BubbleTheme(quill, options) {\n _classCallCheck(this, BubbleTheme);\n\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n\n var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options));\n\n _this.quill.container.classList.add('ql-bubble');\n return _this;\n }\n\n _createClass(BubbleTheme, [{\n key: 'extendToolbar',\n value: function extendToolbar(toolbar) {\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);\n }\n }]);\n\n return BubbleTheme;\n}(_base2.default);\n\nBubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function link(value) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n }\n }\n }\n }\n});\n\nvar BubbleTooltip = function (_BaseTooltip) {\n _inherits(BubbleTooltip, _BaseTooltip);\n\n function BubbleTooltip(quill, bounds) {\n _classCallCheck(this, BubbleTooltip);\n\n var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds));\n\n _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) {\n if (type !== _emitter2.default.events.SELECTION_CHANGE) return;\n if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) {\n _this2.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n _this2.root.style.left = '0px';\n _this2.root.style.width = '';\n _this2.root.style.width = _this2.root.offsetWidth + 'px';\n var lines = _this2.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n _this2.position(_this2.quill.getBounds(range));\n } else {\n var lastLine = lines[lines.length - 1];\n var index = _this2.quill.getIndex(lastLine);\n var length = Math.min(lastLine.length() - 1, range.index + range.length - index);\n var _bounds = _this2.quill.getBounds(new _selection.Range(index, length));\n _this2.position(_bounds);\n }\n } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) {\n _this2.hide();\n }\n });\n return _this2;\n }\n\n _createClass(BubbleTooltip, [{\n key: 'listen',\n value: function listen() {\n var _this3 = this;\n\n _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this);\n this.root.querySelector('.ql-close').addEventListener('click', function () {\n _this3.root.classList.remove('ql-editing');\n });\n this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(function () {\n if (_this3.root.classList.contains('ql-hidden')) return;\n var range = _this3.quill.getSelection();\n if (range != null) {\n _this3.position(_this3.quill.getBounds(range));\n }\n }, 1);\n });\n }\n }, {\n key: 'cancel',\n value: function cancel() {\n this.show();\n }\n }, {\n key: 'position',\n value: function position(reference) {\n var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference);\n var arrow = this.root.querySelector('.ql-tooltip-arrow');\n arrow.style.marginLeft = '';\n if (shift === 0) return shift;\n arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px';\n }\n }]);\n\n return BubbleTooltip;\n}(_base.BaseTooltip);\n\nBubbleTooltip.TEMPLATE = ['', '
    ', '', '', '
    '].join('');\n\nexports.BubbleTooltip = BubbleTooltip;\nexports.default = BubbleTheme;\n\n/***/ }),\n/* 108 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _emitter = __webpack_require__(9);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _base = __webpack_require__(44);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _link = __webpack_require__(15);\n\nvar _link2 = _interopRequireDefault(_link);\n\nvar _selection = __webpack_require__(22);\n\nvar _icons = __webpack_require__(26);\n\nvar _icons2 = _interopRequireDefault(_icons);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']];\n\nvar SnowTheme = function (_BaseTheme) {\n _inherits(SnowTheme, _BaseTheme);\n\n function SnowTheme(quill, options) {\n _classCallCheck(this, SnowTheme);\n\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n\n var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options));\n\n _this.quill.container.classList.add('ql-snow');\n return _this;\n }\n\n _createClass(SnowTheme, [{\n key: 'extendToolbar',\n value: function extendToolbar(toolbar) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) {\n toolbar.handlers['link'].call(toolbar, !context.format.link);\n });\n }\n }\n }]);\n\n return SnowTheme;\n}(_base2.default);\n\nSnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function link(value) {\n if (value) {\n var range = this.quill.getSelection();\n if (range == null || range.length == 0) return;\n var preview = this.quill.getText(range);\n if (/^\\S+@\\S+\\.\\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {\n preview = 'mailto:' + preview;\n }\n var tooltip = this.quill.theme.tooltip;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n }\n }\n }\n }\n});\n\nvar SnowTooltip = function (_BaseTooltip) {\n _inherits(SnowTooltip, _BaseTooltip);\n\n function SnowTooltip(quill, bounds) {\n _classCallCheck(this, SnowTooltip);\n\n var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds));\n\n _this2.preview = _this2.root.querySelector('a.ql-preview');\n return _this2;\n }\n\n _createClass(SnowTooltip, [{\n key: 'listen',\n value: function listen() {\n var _this3 = this;\n\n _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this);\n this.root.querySelector('a.ql-action').addEventListener('click', function (event) {\n if (_this3.root.classList.contains('ql-editing')) {\n _this3.save();\n } else {\n _this3.edit('link', _this3.preview.textContent);\n }\n event.preventDefault();\n });\n this.root.querySelector('a.ql-remove').addEventListener('click', function (event) {\n if (_this3.linkRange != null) {\n var range = _this3.linkRange;\n _this3.restoreFocus();\n _this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER);\n delete _this3.linkRange;\n }\n event.preventDefault();\n _this3.hide();\n });\n this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) {\n if (range == null) return;\n if (range.length === 0 && source === _emitter2.default.sources.USER) {\n var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index),\n _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),\n link = _quill$scroll$descend2[0],\n offset = _quill$scroll$descend2[1];\n\n if (link != null) {\n _this3.linkRange = new _selection.Range(range.index - offset, link.length());\n var preview = _link2.default.formats(link.domNode);\n _this3.preview.textContent = preview;\n _this3.preview.setAttribute('href', preview);\n _this3.show();\n _this3.position(_this3.quill.getBounds(_this3.linkRange));\n return;\n }\n } else {\n delete _this3.linkRange;\n }\n _this3.hide();\n });\n }\n }, {\n key: 'show',\n value: function show() {\n _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this);\n this.root.removeAttribute('data-mode');\n }\n }]);\n\n return SnowTooltip;\n}(_base.BaseTooltip);\n\nSnowTooltip.TEMPLATE = ['', '', '', ''].join('');\n\nexports.default = SnowTheme;\n\n/***/ })\n/******/ ])[\"default\"];\n});\n\n\n// WEBPACK FOOTER //\n// quill.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 45);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap bc1e3bc04ac5f71cbeee","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = require(\"./blot/abstract/container\");\nvar format_1 = require(\"./blot/abstract/format\");\nvar leaf_1 = require(\"./blot/abstract/leaf\");\nvar scroll_1 = require(\"./blot/scroll\");\nvar inline_1 = require(\"./blot/inline\");\nvar block_1 = require(\"./blot/block\");\nvar embed_1 = require(\"./blot/embed\");\nvar text_1 = require(\"./blot/text\");\nvar attributor_1 = require(\"./attributor/attributor\");\nvar class_1 = require(\"./attributor/class\");\nvar style_1 = require(\"./attributor/style\");\nvar store_1 = require(\"./attributor/store\");\nvar Registry = require(\"./registry\");\nvar Parchment = {\n Scope: Registry.Scope,\n create: Registry.create,\n find: Registry.find,\n query: Registry.query,\n register: Registry.register,\n Container: container_1.default,\n Format: format_1.default,\n Leaf: leaf_1.default,\n Embed: embed_1.default,\n Scroll: scroll_1.default,\n Block: block_1.default,\n Inline: inline_1.default,\n Text: text_1.default,\n Attributor: {\n Attribute: attributor_1.default,\n Class: class_1.default,\n Style: style_1.default,\n Store: store_1.default,\n },\n};\nexports.default = Parchment;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/parchment.ts\n// module id = 0\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ParchmentError = /** @class */ (function (_super) {\n __extends(ParchmentError, _super);\n function ParchmentError(message) {\n var _this = this;\n message = '[Parchment] ' + message;\n _this = _super.call(this, message) || this;\n _this.message = message;\n _this.name = _this.constructor.name;\n return _this;\n }\n return ParchmentError;\n}(Error));\nexports.ParchmentError = ParchmentError;\nvar attributes = {};\nvar classes = {};\nvar tags = {};\nvar types = {};\nexports.DATA_KEY = '__blot';\nvar Scope;\n(function (Scope) {\n Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n})(Scope = exports.Scope || (exports.Scope = {}));\nfunction create(input, value) {\n var match = query(input);\n if (match == null) {\n throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n }\n var BlotClass = match;\n var node = \n // @ts-ignore\n input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value);\n return new BlotClass(node, value);\n}\nexports.create = create;\nfunction find(node, bubble) {\n if (bubble === void 0) { bubble = false; }\n if (node == null)\n return null;\n // @ts-ignore\n if (node[exports.DATA_KEY] != null)\n return node[exports.DATA_KEY].blot;\n if (bubble)\n return find(node.parentNode, bubble);\n return null;\n}\nexports.find = find;\nfunction query(query, scope) {\n if (scope === void 0) { scope = Scope.ANY; }\n var match;\n if (typeof query === 'string') {\n match = types[query] || attributes[query];\n // @ts-ignore\n }\n else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) {\n match = types['text'];\n }\n else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = types['block'];\n }\n else if (query & Scope.LEVEL & Scope.INLINE) {\n match = types['inline'];\n }\n }\n else if (query instanceof HTMLElement) {\n var names = (query.getAttribute('class') || '').split(/\\s+/);\n for (var i in names) {\n match = classes[names[i]];\n if (match)\n break;\n }\n match = match || tags[query.tagName];\n }\n if (match == null)\n return null;\n // @ts-ignore\n if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)\n return match;\n return null;\n}\nexports.query = query;\nfunction register() {\n var Definitions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n Definitions[_i] = arguments[_i];\n }\n if (Definitions.length > 1) {\n return Definitions.map(function (d) {\n return register(d);\n });\n }\n var Definition = Definitions[0];\n if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n throw new ParchmentError('Invalid definition');\n }\n else if (Definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n types[Definition.blotName || Definition.attrName] = Definition;\n if (typeof Definition.keyName === 'string') {\n attributes[Definition.keyName] = Definition;\n }\n else {\n if (Definition.className != null) {\n classes[Definition.className] = Definition;\n }\n if (Definition.tagName != null) {\n if (Array.isArray(Definition.tagName)) {\n Definition.tagName = Definition.tagName.map(function (tagName) {\n return tagName.toUpperCase();\n });\n }\n else {\n Definition.tagName = Definition.tagName.toUpperCase();\n }\n var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n tagNames.forEach(function (tag) {\n if (tags[tag] == null || Definition.className == null) {\n tags[tag] = Definition;\n }\n });\n }\n }\n return Definition;\n}\nexports.register = register;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/registry.ts\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = target[name];\n\t\t\t\tcopy = options[name];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\ttarget[name] = extend(deep, clone, copy);\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/extend/index.js\n// module id = 2\n// module chunks = 0","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Break from './break';\nimport Inline from './inline';\nimport TextBlot from './text';\n\n\nconst NEWLINE_LENGTH = 1;\n\n\nclass BlockEmbed extends Parchment.Embed {\n attach() {\n super.attach();\n this.attributes = new Parchment.Attributor.Store(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), extend(this.formats(), this.attributes.values()));\n }\n\n format(name, value) {\n let attribute = Parchment.query(name, Parchment.Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index, length, name, value) {\n this.format(name, value);\n }\n\n insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n let block = Parchment.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n super.insertAt(index, value, def);\n }\n }\n}\nBlockEmbed.scope = Parchment.Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\n\nclass Block extends Parchment.Block {\n constructor(domNode) {\n super(domNode);\n this.cache = {};\n }\n\n delta() {\n if (this.cache.delta == null) {\n this.cache.delta = this.descendants(Parchment.Leaf).reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n } else {\n return delta.insert(leaf.value(), bubbleFormats(leaf));\n }\n }, new Delta()).insert('\\n', bubbleFormats(this));\n }\n return this.cache.delta;\n }\n\n deleteAt(index, length) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(index, Math.min(length, this.length() - index - 1), name, value);\n }\n this.cache = {};\n }\n\n insertAt(index, value, def) {\n if (def != null) return super.insertAt(index, value, def);\n if (value.length === 0) return;\n let lines = value.split('\\n');\n let text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n let block = this;\n lines.reduce(function(index, line) {\n block = block.split(index, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot, ref) {\n let head = this.children.head;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target, ref) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index) {\n return super.path(index, true);\n }\n\n removeChild(child) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index, force = false) {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n let clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n } else {\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n } else {\n let next = super.split(index, force);\n this.cache = {};\n return next;\n }\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = 'break';\nBlock.allowedChildren = [Inline, Parchment.Embed, TextBlot];\n\n\nfunction bubbleFormats(blot, formats = {}) {\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = extend(formats, blot.formats());\n }\n if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats);\n}\n\n\nexport { bubbleFormats, BlockEmbed, Block as default };\n\n\n\n// WEBPACK FOOTER //\n// ./blots/block.js","var diff = require('fast-diff');\nvar equal = require('deep-equal');\nvar extend = require('extend');\nvar op = require('./op');\n\n\nvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\n\nvar Delta = function (ops) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n};\n\n\nDelta.prototype.insert = function (text, attributes) {\n var newOp = {};\n if (text.length === 0) return this;\n newOp.insert = text;\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype['delete'] = function (length) {\n if (length <= 0) return this;\n return this.push({ 'delete': length });\n};\n\nDelta.prototype.retain = function (length, attributes) {\n if (length <= 0) return this;\n var newOp = { retain: length };\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype.push = function (newOp) {\n var index = this.ops.length;\n var lastOp = this.ops[index - 1];\n newOp = extend(true, {}, newOp);\n if (typeof lastOp === 'object') {\n if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {\n this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (equal(newOp.attributes, lastOp.attributes)) {\n if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n};\n\nDelta.prototype.chop = function () {\n var lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n};\n\nDelta.prototype.filter = function (predicate) {\n return this.ops.filter(predicate);\n};\n\nDelta.prototype.forEach = function (predicate) {\n this.ops.forEach(predicate);\n};\n\nDelta.prototype.map = function (predicate) {\n return this.ops.map(predicate);\n};\n\nDelta.prototype.partition = function (predicate) {\n var passed = [], failed = [];\n this.forEach(function(op) {\n var target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n};\n\nDelta.prototype.reduce = function (predicate, initial) {\n return this.ops.reduce(predicate, initial);\n};\n\nDelta.prototype.changeLength = function () {\n return this.reduce(function (length, elem) {\n if (elem.insert) {\n return length + op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n};\n\nDelta.prototype.length = function () {\n return this.reduce(function (length, elem) {\n return length + op.length(elem);\n }, 0);\n};\n\nDelta.prototype.slice = function (start, end) {\n start = start || 0;\n if (typeof end !== 'number') end = Infinity;\n var ops = [];\n var iter = op.iterator(this.ops);\n var index = 0;\n while (index < end && iter.hasNext()) {\n var nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += op.length(nextOp);\n }\n return new Delta(ops);\n};\n\n\nDelta.prototype.compose = function (other) {\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (typeof otherOp.retain === 'number') {\n var newOp = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length;\n } else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n if (attributes) newOp.attributes = attributes;\n delta.push(newOp);\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.concat = function (other) {\n var delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n};\n\nDelta.prototype.diff = function (other, index) {\n if (this.ops === other.ops) {\n return new Delta();\n }\n var strings = [this, other].map(function (delta) {\n return delta.map(function (op) {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n var prep = (delta === other) ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n }).join('');\n });\n var delta = new Delta();\n var diffResult = diff(strings[0], strings[1], index);\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n diffResult.forEach(function (component) {\n var length = component[1].length;\n while (length > 0) {\n var opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n delta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n delta['delete'](opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n var thisOp = thisIter.next(opLength);\n var otherOp = otherIter.next(opLength);\n if (equal(thisOp.insert, otherOp.insert)) {\n delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));\n } else {\n delta.push(otherOp)['delete'](opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return delta.chop();\n};\n\nDelta.prototype.eachLine = function (predicate, newline) {\n newline = newline || '\\n';\n var iter = op.iterator(this.ops);\n var line = new Delta();\n var i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') return;\n var thisOp = iter.peek();\n var start = op.length(thisOp) - iter.peekLength();\n var index = typeof thisOp.insert === 'string' ?\n thisOp.insert.indexOf(newline, start) - start : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n};\n\nDelta.prototype.transform = function (other, priority) {\n priority = !!priority;\n if (typeof other === 'number') {\n return this.transformPosition(other, priority);\n }\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {\n delta.retain(op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (thisOp['delete']) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp['delete']) {\n delta.push(otherOp);\n } else {\n // We retain either their retain or insert\n delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.transformPosition = function (index, priority) {\n priority = !!priority;\n var thisIter = op.iterator(this.ops);\n var offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n var length = thisIter.peekLength();\n var nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n};\n\n\nmodule.exports = Delta;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/quill-delta/lib/delta.js\n// module id = 4\n// module chunks = 0","import Text from './text';\nimport Parchment from 'parchment';\n\n\nclass Inline extends Parchment.Inline {\n static compare(self, other) {\n let selfIndex = Inline.order.indexOf(self);\n let otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n } else if (self === other) {\n return 0;\n } else if (self < other) {\n return -1;\n } else {\n return 1;\n }\n }\n\n formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && Parchment.query(name, Parchment.Scope.BLOT)) {\n let blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n if (this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n let parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\nInline.allowedChildren = [Inline, Parchment.Embed, Text];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = [\n 'cursor', 'inline', // Must be lower\n 'underline', 'strike', 'italic', 'bold', 'script',\n 'link', 'code' // Must be higher\n];\n\n\nexport default Inline;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/inline.js","import './polyfill';\nimport Delta from 'quill-delta';\nimport Editor from './editor';\nimport Emitter from './emitter';\nimport Module from './module';\nimport Parchment from 'parchment';\nimport Selection, { Range } from './selection';\nimport extend from 'extend';\nimport logger from './logger';\nimport Theme from './theme';\n\nlet debug = logger('quill');\n\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static find(node) {\n return node.__quill || Parchment.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(path, target, overwrite = false) {\n if (typeof path !== 'string') {\n let name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register('formats/' + name, path, target);\n } else {\n Object.keys(path).forEach((key) => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if ((path.startsWith('blots/') || path.startsWith('formats/')) &&\n target.blotName !== 'abstract') {\n Parchment.register(target);\n } else if (path.startsWith('modules') && typeof target.register === 'function') {\n target.register();\n }\n }\n }\n\n constructor(container, options = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n let html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n this.container.__quill = this;\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new Emitter();\n this.scroll = Parchment.create(this.root, {\n emitter: this.emitter,\n whitelist: this.options.formats\n });\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options);\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n let range = this.selection.lastRange;\n let index = range && range.length === 0 ? range.index : undefined;\n modify.call(this, () => {\n return this.editor.update(null, mutations, index);\n }, source);\n });\n let contents = this.clipboard.convert(`
    ${html}


    `);\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n }\n\n addContainer(container, refNode = null) {\n if (typeof container === 'string') {\n let className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1*length);\n }\n\n disable() {\n this.enable(false);\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n let scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value, source = Emitter.sources.API) {\n return modify.call(this, () => {\n let range = this.getSelection(true);\n let change = new Delta();\n if (range == null) {\n return change;\n } else if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, { [name]: value });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, { [name]: value });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index, length = 0) {\n let bounds;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n let containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index = this.getSelection(true), length = 0) {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n } else {\n return this.editor.getFormat(index.index, index.length);\n }\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines(index = 0, length = Number.MAX_VALUE) {\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n } else {\n return this.scroll.lines(index, length);\n }\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection(focus = false) {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getText(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value, source = Quill.sources.API) {\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats;\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return !this.container.classList.contains('ql-disabled');\n }\n\n off() {\n return this.emitter.off.apply(this.emitter, arguments);\n }\n\n on() {\n return this.emitter.on.apply(this.emitter, arguments);\n }\n\n once() {\n return this.emitter.once.apply(this.emitter, arguments);\n }\n\n pasteHTML(index, html, source) {\n this.clipboard.dangerouslyPasteHTML(index, html, source);\n }\n\n removeFormat(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n let length = this.getLength();\n let deleted = this.editor.deleteText(0, length);\n let applied = this.editor.applyDelta(delta);\n let lastOp = applied.ops[applied.ops.length - 1];\n if (lastOp != null && typeof(lastOp.insert) === 'string' && lastOp.insert[lastOp.insert.length-1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n let ret = deleted.compose(applied);\n return ret;\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(index, length), source);\n if (source !== Emitter.sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text, source = Emitter.sources.API) {\n let delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source = Emitter.sources.USER) {\n let change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n return change;\n }\n\n updateContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n}\nQuill.DEFAULTS = {\n bounds: null,\n formats: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n scrollingContainer: null,\n strict: true,\n theme: 'default'\n};\nQuill.events = Emitter.events;\nQuill.sources = Emitter.sources;\n// eslint-disable-next-line no-undef\nQuill.version = typeof(QUILL_VERSION) === 'undefined' ? 'dev' : QUILL_VERSION;\n\nQuill.imports = {\n 'delta' : Delta,\n 'parchment' : Parchment,\n 'core/module' : Module,\n 'core/theme' : Theme\n};\n\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend(true, {\n container: container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true\n }\n }, userConfig);\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = Theme;\n } else {\n userConfig.theme = Quill.import(`themes/${userConfig.theme}`);\n if (userConfig.theme == null) {\n throw new Error(`Invalid theme ${userConfig.theme}. Did you register it?`);\n }\n }\n let themeConfig = extend(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(function(config) {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(function(module) {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n let moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n let moduleConfig = moduleNames.reduce(function(config, name) {\n let moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(`Cannot load ${name} module. Are you sure you registered it?`);\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (userConfig.modules != null && userConfig.modules.toolbar &&\n userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n userConfig = extend(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(function(key) {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(function(config, name) {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n }, {});\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === Emitter.sources.USER) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n let oldDelta = this.editor.delta;\n let change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n let args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value, value = name, name = length, length = index.length, index = index.index;\n } else {\n length = index.length, index = index.index;\n }\n } else if (typeof length !== 'number') {\n source = value, value = name, name = length, length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start, end;\n if (index instanceof Delta) {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n return index.transformPosition(pos, source !== Emitter.sources.USER);\n });\n } else {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n if (pos < index || (pos === index && source === Emitter.sources.USER)) return pos;\n if (length >= 0) {\n return pos + length;\n } else {\n return Math.max(index, pos + length);\n }\n });\n }\n return new Range(start, end - start);\n}\n\n\nexport { expandConfig, overload, Quill as default };\n\n\n\n// WEBPACK FOOTER //\n// ./core/quill.js","class Module {\n constructor(quill, options = {}) {\n this.quill = quill;\n this.options = options;\n }\n}\nModule.DEFAULTS = {};\n\n\nexport default Module;\n\n\n\n// WEBPACK FOOTER //\n// ./core/module.js","import Parchment from 'parchment';\n\nclass TextBlot extends Parchment.Text { }\n\nexport default TextBlot;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/text.js","import EventEmitter from 'eventemitter3';\nimport logger from './logger';\n\nlet debug = logger('quill:events');\n\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach(function(eventName) {\n document.addEventListener(eventName, (...args) => {\n [].slice.call(document.querySelectorAll('.ql-container')).forEach((node) => {\n // TODO use WeakMap\n if (node.__quill && node.__quill.emitter) {\n node.__quill.emitter.handleDOM(...args);\n }\n });\n });\n});\n\n\nclass Emitter extends EventEmitter {\n constructor() {\n super();\n this.listeners = {};\n this.on('error', debug.error);\n }\n\n emit() {\n debug.log.apply(debug, arguments);\n super.emit.apply(this, arguments);\n }\n\n handleDOM(event, ...args) {\n (this.listeners[event.type] || []).forEach(function({ node, handler }) {\n if (event.target === node || node.contains(event.target)) {\n handler(event, ...args);\n }\n });\n }\n\n listenDOM(eventName, node, handler) {\n if (!this.listeners[eventName]) {\n this.listeners[eventName] = [];\n }\n this.listeners[eventName].push({ node, handler })\n }\n}\n\nEmitter.events = {\n EDITOR_CHANGE : 'editor-change',\n SCROLL_BEFORE_UPDATE : 'scroll-before-update',\n SCROLL_OPTIMIZE : 'scroll-optimize',\n SCROLL_UPDATE : 'scroll-update',\n SELECTION_CHANGE : 'selection-change',\n TEXT_CHANGE : 'text-change'\n};\nEmitter.sources = {\n API : 'api',\n SILENT : 'silent',\n USER : 'user'\n};\n\n\nexport default Emitter;\n\n\n\n// WEBPACK FOOTER //\n// ./core/emitter.js","let levels = ['error', 'warn', 'log', 'info'];\nlet level = 'warn';\n\nfunction debug(method, ...args) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method](...args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce(function(logger, method) {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\ndebug.level = namespace.level = function(newLevel) {\n level = newLevel;\n};\n\n\nexport default namespace;\n\n\n\n// WEBPACK FOOTER //\n// ./core/logger.js","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = require(\"../registry\");\nvar Attributor = /** @class */ (function () {\n function Attributor(attrName, keyName, options) {\n if (options === void 0) { options = {}; }\n this.attrName = attrName;\n this.keyName = keyName;\n var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n if (options.scope != null) {\n // Ignore type bits, force attribute bit\n this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n }\n else {\n this.scope = Registry.Scope.ATTRIBUTE;\n }\n if (options.whitelist != null)\n this.whitelist = options.whitelist;\n }\n Attributor.keys = function (node) {\n return [].map.call(node.attributes, function (item) {\n return item.name;\n });\n };\n Attributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.setAttribute(this.keyName, value);\n return true;\n };\n Attributor.prototype.canAdd = function (node, value) {\n var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n if (match == null)\n return false;\n if (this.whitelist == null)\n return true;\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n }\n else {\n return this.whitelist.indexOf(value) > -1;\n }\n };\n Attributor.prototype.remove = function (node) {\n node.removeAttribute(this.keyName);\n };\n Attributor.prototype.value = function (node) {\n var value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n };\n return Attributor;\n}());\nexports.default = Attributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/attributor/attributor.ts\n// module id = 11\n// module chunks = 0","var pSlice = Array.prototype.slice;\nvar objectKeys = require('./lib/keys.js');\nvar isArguments = require('./lib/is_arguments.js');\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n if (!opts) opts = {};\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected, opts);\n }\n}\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n}\n\nfunction objEquiv(a, b, opts) {\n var i, key;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n var ka = objectKeys(a),\n kb = objectKeys(b);\n } catch (e) {//happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) return false;\n }\n return typeof a === typeof b;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/deep-equal/index.js\n// module id = 12\n// module chunks = 0","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Inline from '../blots/inline';\nimport TextBlot from '../blots/text';\n\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\n\nclass CodeBlock extends Block {\n static create(value) {\n let domNode = super.create(value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n\n static formats() {\n return true;\n }\n\n delta() {\n let text = this.domNode.textContent;\n if (text.endsWith('\\n')) { // Should always be true\n text = text.slice(0, -1);\n }\n return text.split('\\n').reduce((delta, frag) => {\n return delta.insert(frag).insert('\\n', this.formats());\n }, new Delta());\n }\n\n format(name, value) {\n if (name === this.statics.blotName && value) return;\n let [text, ] = this.descendant(TextBlot, this.length() - 1);\n if (text != null) {\n text.deleteAt(text.length() - 1, 1);\n }\n super.format(name, value);\n }\n\n formatAt(index, length, name, value) {\n if (length === 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK) == null ||\n (name === this.statics.blotName && value === this.statics.formats(this.domNode))) {\n return;\n }\n let nextNewline = this.newlineIndex(index);\n if (nextNewline < 0 || nextNewline >= index + length) return;\n let prevNewline = this.newlineIndex(index, true) + 1;\n let isolateLength = nextNewline - prevNewline + 1;\n let blot = this.isolate(prevNewline, isolateLength);\n let next = blot.next;\n blot.format(name, value);\n if (next instanceof CodeBlock) {\n next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n }\n }\n\n insertAt(index, value, def) {\n if (def != null) return;\n let [text, offset] = this.descendant(TextBlot, index);\n text.insertAt(offset, value);\n }\n\n length() {\n let length = this.domNode.textContent.length;\n if (!this.domNode.textContent.endsWith('\\n')) {\n return length + 1;\n }\n return length;\n }\n\n newlineIndex(searchIndex, reverse = false) {\n if (!reverse) {\n let offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n return offset > -1 ? searchIndex + offset : -1;\n } else {\n return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n }\n }\n\n optimize(context) {\n if (!this.domNode.textContent.endsWith('\\n')) {\n this.appendChild(Parchment.create('text', '\\n'));\n }\n super.optimize(context);\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n next.optimize(context);\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n super.replace(target);\n [].slice.call(this.domNode.querySelectorAll('*')).forEach(function(node) {\n let blot = Parchment.find(node);\n if (blot == null) {\n node.parentNode.removeChild(node);\n } else if (blot instanceof Parchment.Embed) {\n blot.remove();\n } else {\n blot.unwrap();\n }\n });\n }\n}\nCodeBlock.blotName = 'code-block';\nCodeBlock.tagName = 'PRE';\nCodeBlock.TAB = ' ';\n\n\nexport { Code, CodeBlock as default };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/code.js","import Parchment from 'parchment';\n\n\nclass Break extends Parchment.Embed {\n static value() {\n return undefined;\n }\n\n insertInto(parent, ref) {\n if (parent.children.length === 0) {\n super.insertInto(parent, ref);\n } else {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\n\nexport default Break;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/break.js","import Inline from '../blots/inline';\n\n\nclass Link extends Inline {\n static create(value) {\n let node = super.create(value);\n value = this.sanitize(value);\n node.setAttribute('href', value);\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n\n format(name, value) {\n if (name !== this.statics.blotName || !value) return super.format(name, value);\n value = this.constructor.sanitize(value);\n this.domNode.setAttribute('href', value);\n }\n}\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\nLink.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];\n\n\nfunction sanitize(url, protocols) {\n let anchor = document.createElement('a');\n anchor.href = url;\n let protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\n\nexport { Link as default, sanitize };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/link.js","import Keyboard from '../modules/keyboard';\nimport DropdownIcon from '../assets/icons/dropdown.svg';\n\nlet optionsCounter = 0;\n\nfunction toggleAriaAttribute(element, attribute) {\n element.setAttribute(attribute, !(element.getAttribute(attribute) === 'true'));\n}\n\nclass Picker {\n constructor(select) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n this.select.parentNode.insertBefore(this.container, this.select);\n\n this.label.addEventListener('mousedown', () => {\n this.togglePicker();\n });\n this.label.addEventListener('keydown', (event) => {\n switch(event.keyCode) {\n // Allows the \"Enter\" key to open the picker\n case Keyboard.keys.ENTER:\n this.togglePicker();\n break;\n\n // Allows the \"Escape\" key to close the picker\n case Keyboard.keys.ESCAPE:\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n\n buildItem(option) {\n let item = document.createElement('span');\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n\n item.classList.add('ql-picker-item');\n if (option.hasAttribute('value')) {\n item.setAttribute('data-value', option.getAttribute('value'));\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n item.addEventListener('keydown', (event) => {\n switch(event.keyCode) {\n // Allows the \"Enter\" key to select an item\n case Keyboard.keys.ENTER:\n this.selectItem(item, true);\n event.preventDefault();\n break;\n\n // Allows the \"Escape\" key to close the picker\n case Keyboard.keys.ESCAPE:\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n\n return item;\n }\n\n buildLabel() {\n let label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = DropdownIcon;\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n\n buildOptions() {\n let options = document.createElement('span');\n options.classList.add('ql-picker-options');\n\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n options.tabIndex = '-1';\n\n // Need a unique id for aria-controls\n options.id = `ql-picker-options-${optionsCounter}`;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n\n this.options = options;\n\n [].slice.call(this.select.options).forEach((option) => {\n let item = this.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n\n buildPicker() {\n [].slice.call(this.select.attributes).forEach((item) => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n\n escape() {\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(() => this.label.focus(), 1);\n }\n\n close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n this.options.setAttribute('aria-hidden', 'true');\n }\n\n selectItem(item, trigger = false) {\n let selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);\n if (item.hasAttribute('data-value')) {\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n if (typeof Event === 'function') {\n this.select.dispatchEvent(new Event('change'));\n } else if (typeof Event === 'object') { // IE11\n let event = document.createEvent('Event');\n event.initEvent('change', true, true);\n this.select.dispatchEvent(event);\n }\n this.close();\n }\n }\n\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n let item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex];\n option = this.select.options[this.select.selectedIndex];\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n let isActive = option != null && option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n\n\nexport default Picker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/picker.js","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar linked_list_1 = require(\"../../collection/linked-list\");\nvar shadow_1 = require(\"./shadow\");\nvar Registry = require(\"../../registry\");\nvar ContainerBlot = /** @class */ (function (_super) {\n __extends(ContainerBlot, _super);\n function ContainerBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.build();\n return _this;\n }\n ContainerBlot.prototype.appendChild = function (other) {\n this.insertBefore(other);\n };\n ContainerBlot.prototype.attach = function () {\n _super.prototype.attach.call(this);\n this.children.forEach(function (child) {\n child.attach();\n });\n };\n ContainerBlot.prototype.build = function () {\n var _this = this;\n this.children = new linked_list_1.default();\n // Need to be reversed for if DOM nodes already in order\n [].slice\n .call(this.domNode.childNodes)\n .reverse()\n .forEach(function (node) {\n try {\n var child = makeBlot(node);\n _this.insertBefore(child, _this.children.head || undefined);\n }\n catch (err) {\n if (err instanceof Registry.ParchmentError)\n return;\n else\n throw err;\n }\n });\n };\n ContainerBlot.prototype.deleteAt = function (index, length) {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.deleteAt(offset, length);\n });\n };\n ContainerBlot.prototype.descendant = function (criteria, index) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n return [child, offset];\n }\n else if (child instanceof ContainerBlot) {\n return child.descendant(criteria, offset);\n }\n else {\n return [null, -1];\n }\n };\n ContainerBlot.prototype.descendants = function (criteria, index, length) {\n if (index === void 0) { index = 0; }\n if (length === void 0) { length = Number.MAX_VALUE; }\n var descendants = [];\n var lengthLeft = length;\n this.children.forEachAt(index, length, function (child, index, length) {\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n descendants.push(child);\n }\n if (child instanceof ContainerBlot) {\n descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return descendants;\n };\n ContainerBlot.prototype.detach = function () {\n this.children.forEach(function (child) {\n child.detach();\n });\n _super.prototype.detach.call(this);\n };\n ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.formatAt(offset, length, name, value);\n });\n };\n ContainerBlot.prototype.insertAt = function (index, value, def) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if (child) {\n child.insertAt(offset, value, def);\n }\n else {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n this.appendChild(blot);\n }\n };\n ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n if (this.statics.allowedChildren != null &&\n !this.statics.allowedChildren.some(function (child) {\n return childBlot instanceof child;\n })) {\n throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n }\n childBlot.insertInto(this, refBlot);\n };\n ContainerBlot.prototype.length = function () {\n return this.children.reduce(function (memo, child) {\n return memo + child.length();\n }, 0);\n };\n ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n this.children.forEach(function (child) {\n targetParent.insertBefore(child, refNode);\n });\n };\n ContainerBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n var child = Registry.create(this.statics.defaultChild);\n this.appendChild(child);\n child.optimize(context);\n }\n else {\n this.remove();\n }\n }\n };\n ContainerBlot.prototype.path = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n var position = [[this, index]];\n if (child instanceof ContainerBlot) {\n return position.concat(child.path(offset, inclusive));\n }\n else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n };\n ContainerBlot.prototype.removeChild = function (child) {\n this.children.remove(child);\n };\n ContainerBlot.prototype.replace = function (target) {\n if (target instanceof ContainerBlot) {\n target.moveChildren(this);\n }\n _super.prototype.replace.call(this, target);\n };\n ContainerBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = this.clone();\n this.parent.insertBefore(after, this.next);\n this.children.forEachAt(index, this.length(), function (child, offset, length) {\n child = child.split(offset, force);\n after.appendChild(child);\n });\n return after;\n };\n ContainerBlot.prototype.unwrap = function () {\n this.moveChildren(this.parent, this.next);\n this.remove();\n };\n ContainerBlot.prototype.update = function (mutations, context) {\n var _this = this;\n var addedNodes = [];\n var removedNodes = [];\n mutations.forEach(function (mutation) {\n if (mutation.target === _this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach(function (node) {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (node.parentNode != null &&\n // @ts-ignore\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return;\n }\n var blot = Registry.find(node);\n if (blot == null)\n return;\n if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n blot.detach();\n }\n });\n addedNodes\n .filter(function (node) {\n return node.parentNode == _this.domNode;\n })\n .sort(function (a, b) {\n if (a === b)\n return 0;\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach(function (node) {\n var refBlot = null;\n if (node.nextSibling != null) {\n refBlot = Registry.find(node.nextSibling);\n }\n var blot = makeBlot(node);\n if (blot.next != refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(_this);\n }\n _this.insertBefore(blot, refBlot || undefined);\n }\n });\n };\n return ContainerBlot;\n}(shadow_1.default));\nfunction makeBlot(node) {\n var blot = Registry.find(node);\n if (blot == null) {\n try {\n blot = Registry.create(node);\n }\n catch (e) {\n blot = Registry.create(Registry.Scope.INLINE);\n [].slice.call(node.childNodes).forEach(function (child) {\n // @ts-ignore\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n }\n }\n return blot;\n}\nexports.default = ContainerBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/abstract/container.ts\n// module id = 17\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"../../attributor/attributor\");\nvar store_1 = require(\"../../attributor/store\");\nvar container_1 = require(\"./container\");\nvar Registry = require(\"../../registry\");\nvar FormatBlot = /** @class */ (function (_super) {\n __extends(FormatBlot, _super);\n function FormatBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.attributes = new store_1.default(_this.domNode);\n return _this;\n }\n FormatBlot.formats = function (domNode) {\n if (typeof this.tagName === 'string') {\n return true;\n }\n else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n };\n FormatBlot.prototype.format = function (name, value) {\n var format = Registry.query(name);\n if (format instanceof attributor_1.default) {\n this.attributes.attribute(format, value);\n }\n else if (value) {\n if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n this.replaceWith(name, value);\n }\n }\n };\n FormatBlot.prototype.formats = function () {\n var formats = this.attributes.values();\n var format = this.statics.formats(this.domNode);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n };\n FormatBlot.prototype.replaceWith = function (name, value) {\n var replacement = _super.prototype.replaceWith.call(this, name, value);\n this.attributes.copy(replacement);\n return replacement;\n };\n FormatBlot.prototype.update = function (mutations, context) {\n var _this = this;\n _super.prototype.update.call(this, mutations, context);\n if (mutations.some(function (mutation) {\n return mutation.target === _this.domNode && mutation.type === 'attributes';\n })) {\n this.attributes.build();\n }\n };\n FormatBlot.prototype.wrap = function (name, value) {\n var wrapper = _super.prototype.wrap.call(this, name, value);\n if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n };\n return FormatBlot;\n}(container_1.default));\nexports.default = FormatBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/abstract/format.ts\n// module id = 18\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar shadow_1 = require(\"./shadow\");\nvar Registry = require(\"../../registry\");\nvar LeafBlot = /** @class */ (function (_super) {\n __extends(LeafBlot, _super);\n function LeafBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LeafBlot.value = function (domNode) {\n return true;\n };\n LeafBlot.prototype.index = function (node, offset) {\n if (this.domNode === node ||\n this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return Math.min(offset, 1);\n }\n return -1;\n };\n LeafBlot.prototype.position = function (index, inclusive) {\n var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n if (index > 0)\n offset += 1;\n return [this.parent.domNode, offset];\n };\n LeafBlot.prototype.value = function () {\n return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;\n var _a;\n };\n LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n return LeafBlot;\n}(shadow_1.default));\nexports.default = LeafBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/abstract/leaf.ts\n// module id = 19\n// module chunks = 0","var equal = require('deep-equal');\nvar extend = require('extend');\n\n\nvar lib = {\n attributes: {\n compose: function (a, b, keepNull) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = extend(true, {}, b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce(function (copy, key) {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (var key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n diff: function(a, b) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {\n if (!equal(a[key], b[key])) {\n attributes[key] = b[key] === undefined ? null : b[key];\n }\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n transform: function (a, b, priority) {\n if (typeof a !== 'object') return b;\n if (typeof b !== 'object') return undefined;\n if (!priority) return b; // b simply overwrites us without priority\n var attributes = Object.keys(b).reduce(function (attributes, key) {\n if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n },\n\n iterator: function (ops) {\n return new Iterator(ops);\n },\n\n length: function (op) {\n if (typeof op['delete'] === 'number') {\n return op['delete'];\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n};\n\n\nfunction Iterator(ops) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n};\n\nIterator.prototype.hasNext = function () {\n return this.peekLength() < Infinity;\n};\n\nIterator.prototype.next = function (length) {\n if (!length) length = Infinity;\n var nextOp = this.ops[this.index];\n if (nextOp) {\n var offset = this.offset;\n var opLength = lib.length(nextOp)\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp['delete'] === 'number') {\n return { 'delete': length };\n } else {\n var retOp = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n};\n\nIterator.prototype.peek = function () {\n return this.ops[this.index];\n};\n\nIterator.prototype.peekLength = function () {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return lib.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n};\n\nIterator.prototype.peekType = function () {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index]['delete'] === 'number') {\n return 'delete';\n } else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n};\n\n\nmodule.exports = lib;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/quill-delta/lib/op.js\n// module id = 20\n// module chunks = 0","var clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/clone/clone.js\n// module id = 21\n// module chunks = 0","import Parchment from 'parchment';\nimport clone from 'clone';\nimport equal from 'deep-equal';\nimport Emitter from './emitter';\nimport logger from './logger';\n\nlet debug = logger('quill:selection');\n\n\nclass Range {\n constructor(index, length = 0) {\n this.index = index;\n this.length = length;\n }\n}\n\n\nclass Selection {\n constructor(scroll, emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n this.cursor = Parchment.create('cursor', this);\n // savedRange is last non-null range\n this.lastRange = this.savedRange = new Range(0, 0);\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown) {\n setTimeout(this.update.bind(this, Emitter.sources.USER), 1);\n }\n });\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type, delta) => {\n if (type === Emitter.events.TEXT_CHANGE && delta.length() > 0) {\n this.update(Emitter.sources.SILENT);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, () => {\n if (!this.hasFocus()) return;\n let native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n // TODO unclear if this has negative side effects\n this.emitter.once(Emitter.events.SCROLL_UPDATE, () => {\n try {\n this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);\n } catch (ignored) {}\n });\n });\n this.emitter.on(Emitter.events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const { startNode, startOffset, endNode, endOffset } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n }\n });\n this.update(Emitter.sources.SILENT);\n }\n\n handleComposition() {\n this.root.addEventListener('compositionstart', () => {\n this.composing = true;\n });\n this.root.addEventListener('compositionend', () => {\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);\n }, 1);\n }\n });\n }\n\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(Emitter.sources.USER);\n });\n }\n\n focus() {\n if (this.hasFocus()) return;\n this.root.focus();\n this.setRange(this.savedRange);\n }\n\n format(format, value) {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[format]) return;\n this.scroll.update();\n let nativeRange = this.getNativeRange();\n if (nativeRange == null || !nativeRange.native.collapsed || Parchment.query(format, Parchment.Scope.BLOCK)) return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n let blot = Parchment.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof Parchment.Leaf) {\n let after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index, length = 0) {\n let scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node, [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n let range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n } else {\n let side = 'left';\n let rect;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0\n };\n }\n }\n\n getNativeRange() {\n let selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n let nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n let range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange() {\n let normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n let range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n\n hasFocus() {\n return document.activeElement === this.root;\n }\n\n normalizedToRange(range) {\n let positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n let indexes = positions.map((position) => {\n let [node, offset] = position;\n let blot = Parchment.find(node, true);\n let index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n } else if (blot instanceof Parchment.Container) {\n return index + blot.length();\n } else {\n return index + blot.index(node, offset);\n }\n });\n let end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n let start = Math.min(end, ...indexes);\n return new Range(start, end-start);\n }\n\n normalizeNative(nativeRange) {\n if (!contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))) {\n return null;\n }\n let range = {\n start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange\n };\n [range.start, range.end].forEach(function(position) {\n let node = position.node, offset = position.offset;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n } else {\n break;\n }\n }\n position.node = node, position.offset = offset;\n });\n return range;\n }\n\n rangeToNative(range) {\n let indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n let args = [];\n let scrollLength = this.scroll.length();\n indexes.forEach((index, i) => {\n index = Math.min(scrollLength - 1, index);\n let node, [leaf, offset] = this.scroll.leaf(index);\n [node, offset] = leaf.position(offset, i !== 0);\n args.push(node, offset);\n });\n if (args.length < 2) {\n args = args.concat(args);\n }\n return args;\n }\n\n scrollIntoView(scrollingContainer) {\n let range = this.lastRange;\n if (range == null) return;\n let bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n let limit = this.scroll.length()-1;\n let [first, ] = this.scroll.line(Math.min(range.index, limit));\n let last = first;\n if (range.length > 0) {\n [last, ] = this.scroll.line(Math.min(range.index + range.length, limit));\n }\n if (first == null || last == null) return;\n let scrollBounds = scrollingContainer.getBoundingClientRect();\n if (bounds.top < scrollBounds.top) {\n scrollingContainer.scrollTop -= (scrollBounds.top - bounds.top);\n } else if (bounds.bottom > scrollBounds.bottom) {\n scrollingContainer.scrollTop += (bounds.bottom - scrollBounds.bottom);\n }\n }\n\n setNativeRange(startNode, startOffset, endNode = startNode, endOffset = startOffset, force = false) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n return;\n }\n let selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n let native = (this.getNativeRange() || {}).native;\n if (native == null || force ||\n startNode !== native.startContainer ||\n startOffset !== native.startOffset ||\n endNode !== native.endContainer ||\n endOffset !== native.endOffset) {\n\n if (startNode.tagName == \"BR\") {\n startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);\n startNode = startNode.parentNode;\n }\n if (endNode.tagName == \"BR\") {\n endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);\n endNode = endNode.parentNode;\n }\n let range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n }\n }\n\n setRange(range, force = false, source = Emitter.sources.API) {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n let args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source = Emitter.sources.USER) {\n let oldRange = this.lastRange;\n let [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!equal(oldRange, this.lastRange)) {\n if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n this.cursor.restore();\n }\n let args = [Emitter.events.SELECTION_CHANGE, clone(this.lastRange), clone(oldRange), source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode;\n } catch (e) {\n return false;\n }\n // IE11 has bug with Text nodes\n // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n if (descendant instanceof Text) {\n descendant = descendant.parentNode;\n }\n return parent.contains(descendant);\n}\n\n\nexport { Range, Selection as default };\n\n\n\n// WEBPACK FOOTER //\n// ./core/selection.js","import Parchment from 'parchment';\nimport Block, { BlockEmbed } from './block';\n\n\nclass Container extends Parchment.Container { }\nContainer.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Container;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/container.js","import Parchment from 'parchment';\n\nclass ColorAttributor extends Parchment.Attributor.Style {\n value(domNode) {\n let value = super.value(domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n return '#' + value.split(',').map(function(component) {\n return ('00' + parseInt(component).toString(16)).slice(-2);\n }).join('');\n }\n}\n\nlet ColorClass = new Parchment.Attributor.Class('color', 'ql-color', {\n scope: Parchment.Scope.INLINE\n});\nlet ColorStyle = new ColorAttributor('color', 'color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/color.js","import clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\nimport Delta from 'quill-delta';\nimport DeltaOp from 'quill-delta/lib/op';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nlet debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\n\nclass Keyboard extends Module {\n static match(evt, binding) {\n binding = normalize(binding);\n if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function(key) {\n return (!!binding[key] !== evt[key] && binding[key] !== null);\n })) {\n return false;\n }\n return binding.key === (evt.which || evt.keyCode);\n }\n\n constructor(quill, options) {\n super(quill, options);\n this.bindings = {};\n Object.keys(this.options.bindings).forEach((name) => {\n if (name === 'list autofill' &&\n quill.scroll.whitelist != null &&\n !quill.scroll.whitelist['list']) {\n return;\n }\n if (this.options.bindings[name]) {\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function() {});\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete);\n } else {\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);\n }\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null },\n { collapsed: true, offset: 0 },\n handleBackspace);\n this.listen();\n }\n\n addBinding(key, context = {}, handler = {}) {\n let binding = normalize(key);\n if (binding == null || binding.key == null) {\n return debug.warn('Attempted to add invalid keyboard binding', binding);\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler: handler };\n }\n binding = extend(binding, context, handler);\n this.bindings[binding.key] = this.bindings[binding.key] || [];\n this.bindings[binding.key].push(binding);\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', (evt) => {\n if (evt.defaultPrevented) return;\n let which = evt.which || evt.keyCode;\n let bindings = (this.bindings[which] || []).filter(function(binding) {\n return Keyboard.match(evt, binding);\n });\n if (bindings.length === 0) return;\n let range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n let [line, offset] = this.quill.getLine(range.index);\n let [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n let [leafEnd, offsetEnd] = range.length === 0 ? [leafStart, offsetStart] : this.quill.getLeaf(range.index + range.length);\n let prefixText = leafStart instanceof Parchment.Text ? leafStart.value().slice(0, offsetStart) : '';\n let suffixText = leafEnd instanceof Parchment.Text ? leafEnd.value().slice(offsetEnd) : '';\n let curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n offset: offset,\n prefix: prefixText,\n suffix: suffixText\n };\n let prevented = bindings.some((binding) => {\n if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n if (binding.empty != null && binding.empty !== curContext.empty) return false;\n if (binding.offset != null && binding.offset !== curContext.offset) return false;\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(function(name) {\n return curContext.format[name] == null;\n })) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (!Object.keys(binding.format).every(function(name) {\n if (binding.format[name] === true) return curContext.format[name] != null;\n if (binding.format[name] === false) return curContext.format[name] == null;\n return equal(binding.format[name], curContext.format[name]);\n })) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n return binding.handler.call(this, range, curContext) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n}\n\nKeyboard.keys = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n DELETE: 46\n};\n\nKeyboard.DEFAULTS = {\n bindings: {\n 'bold' : makeFormatHandler('bold'),\n 'italic' : makeFormatHandler('italic'),\n 'underline' : makeFormatHandler('underline'),\n 'indent': {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: Keyboard.keys.TAB,\n format: ['blockquote', 'indent', 'list'],\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n }\n },\n 'outdent': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n }\n },\n 'outdent backspace': {\n key: Keyboard.keys.BACKSPACE,\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler: function(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n }\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler: function(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n }\n },\n 'tab': {\n key: Keyboard.keys.TAB,\n handler: function(range) {\n this.quill.history.cutoff();\n let delta = new Delta().retain(range.index)\n .delete(range.length)\n .insert('\\t');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n }\n },\n 'list empty enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['list'],\n empty: true,\n handler: function(range, context) {\n this.quill.format('list', false, Quill.sources.USER);\n if (context.format.indent) {\n this.quill.format('indent', false, Quill.sources.USER);\n }\n }\n },\n 'checklist enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: { list: 'checked' },\n handler: function(range) {\n let [line, offset] = this.quill.getLine(range.index);\n let formats = extend({}, line.formats(), { list: 'checked' });\n let delta = new Delta().retain(range.index)\n .insert('\\n', formats)\n .retain(line.length() - offset - 1)\n .retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'header enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler: function(range, context) {\n let [line, offset] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index)\n .insert('\\n', context.format)\n .retain(line.length() - offset - 1)\n .retain(1, { header: null });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'list autofill': {\n key: ' ',\n collapsed: true,\n format: { list: false },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler: function(range, context) {\n let length = context.prefix.length;\n let [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]': case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-': case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', Quill.sources.USER);\n this.quill.history.cutoff();\n let delta = new Delta().retain(range.index - offset)\n .delete(length + 1)\n .retain(line.length() - 2 - offset)\n .retain(1, { list: value });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n }\n },\n 'code exit': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['code-block'],\n prefix: /\\n\\n$/,\n suffix: /^\\s+$/,\n handler: function(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new Delta()\n .retain(range.index + line.length() - offset - 2)\n .retain(1, { 'code-block': null })\n .delete(1);\n this.quill.updateContents(delta, Quill.sources.USER);\n }\n },\n 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false),\n 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true),\n 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),\n 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)\n }\n};\n\nfunction makeEmbedArrowHandler(key, shiftKey) {\n const where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler: function(range) {\n let index = range.index;\n if (key === Keyboard.keys.RIGHT) {\n index += (range.length + 1);\n }\n const [leaf, ] = this.quill.getLeaf(index);\n if (!(leaf instanceof Parchment.Embed)) return true;\n if (key === Keyboard.keys.LEFT) {\n if (shiftKey) {\n this.quill.setSelection(range.index - 1, range.length + 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(range.index - 1, Quill.sources.USER);\n }\n } else {\n if (shiftKey) {\n this.quill.setSelection(range.index, range.length + 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(range.index + range.length + 1, Quill.sources.USER);\n }\n }\n return false;\n }\n };\n}\n\n\nfunction handleBackspace(range, context) {\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let [line, ] = this.quill.getLine(range.index);\n let formats = {};\n if (context.offset === 0) {\n let [prev, ] = this.quill.getLine(range.index - 1);\n if (prev != null && prev.length() > 1) {\n let curFormats = line.formats();\n let prevFormats = this.quill.getFormat(range.index-1, 1);\n formats = DeltaOp.attributes.diff(curFormats, prevFormats) || {};\n }\n }\n // Check for astral symbols\n let length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix) ? 2 : 1;\n this.quill.deleteText(range.index-length, length, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index-length, length, formats, Quill.sources.USER);\n }\n this.quill.focus();\n}\n\nfunction handleDelete(range, context) {\n // Check for astral symbols\n let length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix) ? 2 : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {}, nextLength = 0;\n let [line, ] = this.quill.getLine(range.index);\n if (context.offset >= line.length() - 1) {\n let [next, ] = this.quill.getLine(range.index + 1);\n if (next) {\n let curFormats = line.formats();\n let nextFormats = this.quill.getFormat(range.index, 1);\n formats = DeltaOp.attributes.diff(curFormats, nextFormats) || {};\n nextLength = next.length();\n }\n }\n this.quill.deleteText(range.index, length, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index + nextLength - 1, length, formats, Quill.sources.USER);\n }\n}\n\nfunction handleDeleteRange(range) {\n let lines = this.quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n let firstFormats = lines[0].formats();\n let lastFormats = lines[lines.length - 1].formats();\n formats = DeltaOp.attributes.diff(lastFormats, firstFormats) || {};\n }\n this.quill.deleteText(range, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index, 1, formats, Quill.sources.USER);\n }\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.quill.focus();\n}\n\nfunction handleEnter(range, context) {\n if (range.length > 0) {\n this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n }\n let lineFormats = Object.keys(context.format).reduce(function(lineFormats, format) {\n if (Parchment.query(format, Parchment.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n lineFormats[format] = context.format[format];\n }\n return lineFormats;\n }, {});\n this.quill.insertText(range.index, '\\n', lineFormats, Quill.sources.USER);\n // Earlier scroll.deleteAt might have messed up our selection,\n // so insertText's built in selection preservation is not reliable\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.focus();\n Object.keys(context.format).forEach((name) => {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'link') return;\n this.quill.format(name, context.format[name], Quill.sources.USER);\n });\n}\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: Keyboard.keys.TAB,\n shiftKey: !indent,\n format: {'code-block': true },\n handler: function(range) {\n let CodeBlock = Parchment.query('code-block');\n let index = range.index, length = range.length;\n let [block, offset] = this.quill.scroll.descendant(CodeBlock, index);\n if (block == null) return;\n let scrollIndex = this.quill.getIndex(block);\n let start = block.newlineIndex(offset, true) + 1;\n let end = block.newlineIndex(scrollIndex + offset + length);\n let lines = block.domNode.textContent.slice(start, end).split('\\n');\n offset = 0;\n lines.forEach((line, i) => {\n if (indent) {\n block.insertAt(start + offset, CodeBlock.TAB);\n offset += CodeBlock.TAB.length;\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.startsWith(CodeBlock.TAB)) {\n block.deleteAt(start + offset, CodeBlock.TAB.length);\n offset -= CodeBlock.TAB.length;\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n offset += line.length + 1;\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n }\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0].toUpperCase(),\n shortKey: true,\n handler: function(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n }\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n return normalize({ key: binding });\n }\n if (typeof binding === 'object') {\n binding = clone(binding, false);\n }\n if (typeof binding.key === 'string') {\n if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n binding.key = Keyboard.keys[binding.key.toUpperCase()];\n } else if (binding.key.length === 1) {\n binding.key = binding.key.toUpperCase().charCodeAt(0);\n } else {\n return null;\n }\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\n\nexport { Keyboard as default, SHORTKEY };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/keyboard.js","module.exports = {\n 'align': {\n '' : require('../assets/icons/align-left.svg'),\n 'center' : require('../assets/icons/align-center.svg'),\n 'right' : require('../assets/icons/align-right.svg'),\n 'justify' : require('../assets/icons/align-justify.svg')\n },\n 'background': require('../assets/icons/background.svg'),\n 'blockquote': require('../assets/icons/blockquote.svg'),\n 'bold' : require('../assets/icons/bold.svg'),\n 'clean' : require('../assets/icons/clean.svg'),\n 'code' : require('../assets/icons/code.svg'),\n 'code-block': require('../assets/icons/code.svg'),\n 'color' : require('../assets/icons/color.svg'),\n 'direction' : {\n '' : require('../assets/icons/direction-ltr.svg'),\n 'rtl' : require('../assets/icons/direction-rtl.svg')\n },\n 'float': {\n 'center' : require('../assets/icons/float-center.svg'),\n 'full' : require('../assets/icons/float-full.svg'),\n 'left' : require('../assets/icons/float-left.svg'),\n 'right' : require('../assets/icons/float-right.svg')\n },\n 'formula' : require('../assets/icons/formula.svg'),\n 'header': {\n '1' : require('../assets/icons/header.svg'),\n '2' : require('../assets/icons/header-2.svg')\n },\n 'italic' : require('../assets/icons/italic.svg'),\n 'image' : require('../assets/icons/image.svg'),\n 'indent': {\n '+1' : require('../assets/icons/indent.svg'),\n '-1' : require('../assets/icons/outdent.svg')\n },\n 'link' : require('../assets/icons/link.svg'),\n 'list': {\n 'ordered' : require('../assets/icons/list-ordered.svg'),\n 'bullet' : require('../assets/icons/list-bullet.svg'),\n 'check' : require('../assets/icons/list-check.svg')\n },\n 'script': {\n 'sub' : require('../assets/icons/subscript.svg'),\n 'super' : require('../assets/icons/superscript.svg'),\n },\n 'strike' : require('../assets/icons/strike.svg'),\n 'underline' : require('../assets/icons/underline.svg'),\n 'video' : require('../assets/icons/video.svg')\n};\n\n\n\n// WEBPACK FOOTER //\n// ./ui/icons.js","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = require(\"../../registry\");\nvar ShadowBlot = /** @class */ (function () {\n function ShadowBlot(domNode) {\n this.domNode = domNode;\n // @ts-ignore\n this.domNode[Registry.DATA_KEY] = { blot: this };\n }\n Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n // Hack for accessing inherited static methods\n get: function () {\n return this.constructor;\n },\n enumerable: true,\n configurable: true\n });\n ShadowBlot.create = function (value) {\n if (this.tagName == null) {\n throw new Registry.ParchmentError('Blot definition missing tagName');\n }\n var node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value).toString() === value) {\n value = parseInt(value);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n }\n else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n }\n else {\n node = document.createElement(this.tagName[0]);\n }\n }\n else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n };\n ShadowBlot.prototype.attach = function () {\n if (this.parent != null) {\n this.scroll = this.parent.scroll;\n }\n };\n ShadowBlot.prototype.clone = function () {\n var domNode = this.domNode.cloneNode(false);\n return Registry.create(domNode);\n };\n ShadowBlot.prototype.detach = function () {\n if (this.parent != null)\n this.parent.removeChild(this);\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY];\n };\n ShadowBlot.prototype.deleteAt = function (index, length) {\n var blot = this.isolate(index, length);\n blot.remove();\n };\n ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n var blot = this.isolate(index, length);\n if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n }\n else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n var parent = Registry.create(this.statics.scope);\n blot.wrap(parent);\n parent.format(name, value);\n }\n };\n ShadowBlot.prototype.insertAt = function (index, value, def) {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n var ref = this.split(index);\n this.parent.insertBefore(blot, ref);\n };\n ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n if (refBlot === void 0) { refBlot = null; }\n if (this.parent != null) {\n this.parent.children.remove(this);\n }\n var refDomNode = null;\n parentBlot.children.insertBefore(this, refBlot);\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (this.domNode.parentNode != parentBlot.domNode ||\n this.domNode.nextSibling != refDomNode) {\n parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n }\n this.parent = parentBlot;\n this.attach();\n };\n ShadowBlot.prototype.isolate = function (index, length) {\n var target = this.split(index);\n target.split(length);\n return target;\n };\n ShadowBlot.prototype.length = function () {\n return 1;\n };\n ShadowBlot.prototype.offset = function (root) {\n if (root === void 0) { root = this.parent; }\n if (this.parent == null || this == root)\n return 0;\n return this.parent.children.offset(this) + this.parent.offset(root);\n };\n ShadowBlot.prototype.optimize = function (context) {\n // TODO clean up once we use WeakMap\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY] != null) {\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY].mutations;\n }\n };\n ShadowBlot.prototype.remove = function () {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n };\n ShadowBlot.prototype.replace = function (target) {\n if (target.parent == null)\n return;\n target.parent.insertBefore(this, target.next);\n target.remove();\n };\n ShadowBlot.prototype.replaceWith = function (name, value) {\n var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n replacement.replace(this);\n return replacement;\n };\n ShadowBlot.prototype.split = function (index, force) {\n return index === 0 ? this : this.next;\n };\n ShadowBlot.prototype.update = function (mutations, context) {\n // Nothing to do by default\n };\n ShadowBlot.prototype.wrap = function (name, value) {\n var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next);\n }\n wrapper.appendChild(this);\n return wrapper;\n };\n ShadowBlot.blotName = 'abstract';\n return ShadowBlot;\n}());\nexports.default = ShadowBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/abstract/shadow.ts\n// module id = 27\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nvar class_1 = require(\"./class\");\nvar style_1 = require(\"./style\");\nvar Registry = require(\"../registry\");\nvar AttributorStore = /** @class */ (function () {\n function AttributorStore(domNode) {\n this.attributes = {};\n this.domNode = domNode;\n this.build();\n }\n AttributorStore.prototype.attribute = function (attribute, value) {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n }\n else {\n delete this.attributes[attribute.attrName];\n }\n }\n }\n else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n };\n AttributorStore.prototype.build = function () {\n var _this = this;\n this.attributes = {};\n var attributes = attributor_1.default.keys(this.domNode);\n var classes = class_1.default.keys(this.domNode);\n var styles = style_1.default.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(function (name) {\n var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n if (attr instanceof attributor_1.default) {\n _this.attributes[attr.attrName] = attr;\n }\n });\n };\n AttributorStore.prototype.copy = function (target) {\n var _this = this;\n Object.keys(this.attributes).forEach(function (key) {\n var value = _this.attributes[key].value(_this.domNode);\n target.format(key, value);\n });\n };\n AttributorStore.prototype.move = function (target) {\n var _this = this;\n this.copy(target);\n Object.keys(this.attributes).forEach(function (key) {\n _this.attributes[key].remove(_this.domNode);\n });\n this.attributes = {};\n };\n AttributorStore.prototype.values = function () {\n var _this = this;\n return Object.keys(this.attributes).reduce(function (attributes, name) {\n attributes[name] = _this.attributes[name].value(_this.domNode);\n return attributes;\n }, {});\n };\n return AttributorStore;\n}());\nexports.default = AttributorStore;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/attributor/store.ts\n// module id = 28\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nfunction match(node, prefix) {\n var className = node.getAttribute('class') || '';\n return className.split(/\\s+/).filter(function (name) {\n return name.indexOf(prefix + \"-\") === 0;\n });\n}\nvar ClassAttributor = /** @class */ (function (_super) {\n __extends(ClassAttributor, _super);\n function ClassAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ClassAttributor.keys = function (node) {\n return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n return name\n .split('-')\n .slice(0, -1)\n .join('-');\n });\n };\n ClassAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n this.remove(node);\n node.classList.add(this.keyName + \"-\" + value);\n return true;\n };\n ClassAttributor.prototype.remove = function (node) {\n var matches = match(node, this.keyName);\n matches.forEach(function (name) {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n };\n ClassAttributor.prototype.value = function (node) {\n var result = match(node, this.keyName)[0] || '';\n var value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n };\n return ClassAttributor;\n}(attributor_1.default));\nexports.default = ClassAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/attributor/class.ts\n// module id = 29\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nfunction camelize(name) {\n var parts = name.split('-');\n var rest = parts\n .slice(1)\n .map(function (part) {\n return part[0].toUpperCase() + part.slice(1);\n })\n .join('');\n return parts[0] + rest;\n}\nvar StyleAttributor = /** @class */ (function (_super) {\n __extends(StyleAttributor, _super);\n function StyleAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StyleAttributor.keys = function (node) {\n return (node.getAttribute('style') || '').split(';').map(function (value) {\n var arr = value.split(':');\n return arr[0].trim();\n });\n };\n StyleAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n // @ts-ignore\n node.style[camelize(this.keyName)] = value;\n return true;\n };\n StyleAttributor.prototype.remove = function (node) {\n // @ts-ignore\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n };\n StyleAttributor.prototype.value = function (node) {\n // @ts-ignore\n var value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n };\n return StyleAttributor;\n}(attributor_1.default));\nexports.default = StyleAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/attributor/style.ts\n// module id = 30\n// module chunks = 0","import Parchment from 'parchment';\nimport TextBlot from './text';\n\n\nclass Cursor extends Parchment.Embed {\n static value() {\n return undefined;\n }\n\n constructor(domNode, selection) {\n super(domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this._length = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name, value) {\n if (this._length !== 0) {\n return super.format(name, value);\n }\n let target = this, index = 0;\n while (target != null && target.statics.scope !== Parchment.Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this._length = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this._length = 0;\n }\n }\n\n index(node, offset) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this._length;\n }\n\n position() {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n this.parent = null;\n }\n\n restore() {\n if (this.selection.composing || this.parent == null) return;\n let textNode = this.textNode;\n let range = this.selection.getNativeRange();\n let restoreText, start, end;\n if (range != null && range.start.node === textNode && range.end.node === textNode) {\n [restoreText, start, end] = [textNode, range.start.offset, range.end.offset];\n }\n // Link format will insert text outside of anchor tag\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n if (this.textNode.data !== Cursor.CONTENTS) {\n let text = this.textNode.data.split(Cursor.CONTENTS).join('');\n if (this.next instanceof TextBlot) {\n restoreText = this.next.domNode;\n this.next.insertAt(0, text);\n this.textNode.data = Cursor.CONTENTS;\n } else {\n this.textNode.data = text;\n this.parent.insertBefore(Parchment.create(this.textNode), this);\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n }\n }\n this.remove();\n if (start != null) {\n [start, end] = [start, end].map(function(offset) {\n return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n });\n return {\n startNode: restoreText,\n startOffset: start,\n endNode: restoreText,\n endOffset: end\n };\n }\n }\n\n update(mutations, context) {\n if (mutations.some((mutation) => {\n return mutation.type === 'characterData' && mutation.target === this.textNode;\n })) {\n let range = this.restore();\n if (range) context.range = range;\n }\n }\n\n value() {\n return '';\n }\n}\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = \"\\uFEFF\"; // Zero width no break space\n\n\nexport default Cursor;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/cursor.js","class Theme {\n constructor(quill, options) {\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n init() {\n Object.keys(this.options.modules).forEach((name) => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name) {\n let moduleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n return this.modules[name];\n }\n}\nTheme.DEFAULTS = {\n modules: {}\n};\nTheme.themes = {\n 'default': Theme\n};\n\n\nexport default Theme;\n\n\n\n// WEBPACK FOOTER //\n// ./core/theme.js","import Parchment from 'parchment';\nimport TextBlot from './text';\n\nconst GUARD_TEXT = \"\\uFEFF\";\n\n\nclass Embed extends Parchment.Embed {\n constructor(node) {\n super(node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', false);\n [].slice.call(this.domNode.childNodes).forEach((childNode) => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node) {\n let range, textNode;\n let text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof TextBlot) {\n let prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(Parchment.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof TextBlot) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length\n }\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(Parchment.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations, context) {\n mutations.forEach((mutation) => {\n if (mutation.type === 'characterData' &&\n (mutation.target === this.leftGuard || mutation.target === this.rightGuard)) {\n let range = this.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n}\n\n\nexport default Embed;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/embed.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['right', 'center', 'justify']\n};\n\nlet AlignAttribute = new Parchment.Attributor.Attribute('align', 'align', config);\nlet AlignClass = new Parchment.Attributor.Class('align', 'ql-align', config);\nlet AlignStyle = new Parchment.Attributor.Style('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/align.js","import Parchment from 'parchment';\nimport { ColorAttributor } from './color';\n\nlet BackgroundClass = new Parchment.Attributor.Class('background', 'ql-bg', {\n scope: Parchment.Scope.INLINE\n});\nlet BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { BackgroundClass, BackgroundStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/background.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['rtl']\n};\n\nlet DirectionAttribute = new Parchment.Attributor.Attribute('direction', 'dir', config);\nlet DirectionClass = new Parchment.Attributor.Class('direction', 'ql-direction', config);\nlet DirectionStyle = new Parchment.Attributor.Style('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/direction.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.INLINE,\n whitelist: ['serif', 'monospace']\n};\n\nlet FontClass = new Parchment.Attributor.Class('font', 'ql-font', config);\n\nclass FontStyleAttributor extends Parchment.Attributor.Style {\n value(node) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nlet FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/font.js","import Parchment from 'parchment';\n\nlet SizeClass = new Parchment.Attributor.Class('size', 'ql-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['small', 'large', 'huge']\n});\nlet SizeStyle = new Parchment.Attributor.Style('size', 'font-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['10px', '18px', '32px']\n});\n\nexport { SizeClass, SizeStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/size.js","import Inline from '../blots/inline';\n\nclass Bold extends Inline {\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize(context) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexport default Bold;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/bold.js","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/code.svg\n// module id = 40\n// module chunks = 0","import Picker from './picker';\n\n\nclass ColorPicker extends Picker {\n constructor(select, label) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n [].slice.call(this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function(item) {\n item.classList.add('ql-primary');\n });\n }\n\n buildItem(option) {\n let item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n let colorLabel = this.label.querySelector('.ql-color-label');\n let value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n\n\nexport default ColorPicker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/color-picker.js","import Picker from './picker';\n\n\nclass IconPicker extends Picker {\n constructor(select, icons) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n [].forEach.call(this.container.querySelectorAll('.ql-picker-item'), (item) => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n });\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n item = item || this.defaultItem;\n this.label.innerHTML = item.innerHTML;\n }\n}\n\n\nexport default IconPicker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/icon-picker.js","class Tooltip {\n constructor(quill, boundsContainer) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (this.quill.root === this.quill.scrollingContainer) {\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = (-1*this.quill.root.scrollTop) + 'px';\n });\n }\n this.hide();\n }\n\n hide() {\n this.root.classList.add('ql-hidden');\n }\n\n position(reference) {\n let left = reference.left + reference.width/2 - this.root.offsetWidth/2;\n // root.scrollTop should be 0 if scrollContainer !== root\n let top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = left + 'px';\n this.root.style.top = top + 'px';\n this.root.classList.remove('ql-flip');\n let containerBounds = this.boundsContainer.getBoundingClientRect();\n let rootBounds = this.root.getBoundingClientRect();\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = (left + shift) + 'px';\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = (left + shift) + 'px';\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n let height = rootBounds.bottom - rootBounds.top;\n let verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = (top - verticalShift) + 'px';\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n\n\nexport default Tooltip;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/tooltip.js","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Emitter from '../core/emitter';\nimport Keyboard from '../modules/keyboard';\nimport Theme from '../core/theme';\nimport ColorPicker from '../ui/color-picker';\nimport IconPicker from '../ui/icon-picker';\nimport Picker from '../ui/picker';\nimport Tooltip from '../ui/tooltip';\n\n\nconst ALIGNS = [ false, 'center', 'right', 'justify' ];\n\nconst COLORS = [\n \"#000000\", \"#e60000\", \"#ff9900\", \"#ffff00\", \"#008a00\", \"#0066cc\", \"#9933ff\",\n \"#ffffff\", \"#facccc\", \"#ffebcc\", \"#ffffcc\", \"#cce8cc\", \"#cce0f5\", \"#ebd6ff\",\n \"#bbbbbb\", \"#f06666\", \"#ffc266\", \"#ffff66\", \"#66b966\", \"#66a3e0\", \"#c285ff\",\n \"#888888\", \"#a10000\", \"#b26b00\", \"#b2b200\", \"#006100\", \"#0047b2\", \"#6b24b2\",\n \"#444444\", \"#5c0000\", \"#663d00\", \"#666600\", \"#003700\", \"#002966\", \"#3d1466\"\n];\n\nconst FONTS = [ false, 'serif', 'monospace' ];\n\nconst HEADERS = [ '1', '2', '3', false ];\n\nconst SIZES = [ 'small', false, 'large', 'huge' ];\n\n\nclass BaseTheme extends Theme {\n constructor(quill, options) {\n super(quill, options);\n let listener = (e) => {\n if (!document.body.contains(quill.root)) {\n return document.body.removeEventListener('click', listener);\n }\n if (this.tooltip != null && !this.tooltip.root.contains(e.target) &&\n document.activeElement !== this.tooltip.textbox && !this.quill.hasFocus()) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach(function(picker) {\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n }\n\n addModule(name) {\n let module = super.addModule(name);\n if (name === 'toolbar') {\n this.extendToolbar(module);\n }\n return module;\n }\n\n buildButtons(buttons, icons) {\n buttons.forEach((button) => {\n let className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach((name) => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n button.innerHTML = icons[name][''] + icons[name]['rtl'];\n } else if (typeof icons[name] === 'string') {\n button.innerHTML = icons[name];\n } else {\n let value = button.value || '';\n if (value != null && icons[name][value]) {\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n\n buildPickers(selects, icons) {\n this.pickers = selects.map((select) => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n return new IconPicker(select, icons.align);\n } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {\n let format = select.classList.contains('ql-background') ? 'background' : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');\n }\n return new ColorPicker(select, icons[format]);\n } else {\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new Picker(select);\n }\n });\n let update = () => {\n this.pickers.forEach(function(picker) {\n picker.update();\n });\n };\n this.quill.on(Emitter.events.EDITOR_CHANGE, update);\n }\n}\nBaseTheme.DEFAULTS = extend(true, {}, Theme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula: function() {\n this.quill.theme.tooltip.edit('formula');\n },\n image: function() {\n let fileInput = this.container.querySelector('input.ql-image[type=file]');\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon');\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n if (fileInput.files != null && fileInput.files[0] != null) {\n let reader = new FileReader();\n reader.onload = (e) => {\n let range = this.quill.getSelection(true);\n this.quill.updateContents(new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ image: e.target.result })\n , Emitter.sources.USER);\n this.quill.setSelection(range.index + 1, Emitter.sources.SILENT);\n fileInput.value = \"\";\n }\n reader.readAsDataURL(fileInput.files[0]);\n }\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video: function() {\n this.quill.theme.tooltip.edit('video');\n }\n }\n }\n }\n});\n\n\nclass BaseTooltip extends Tooltip {\n constructor(quill, boundsContainer) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n\n listen() {\n this.textbox.addEventListener('keydown', (event) => {\n if (Keyboard.match(event, 'enter')) {\n this.save();\n event.preventDefault();\n } else if (Keyboard.match(event, 'escape')) {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n\n cancel() {\n this.hide();\n }\n\n edit(mode = 'link', preview = null) {\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n this.position(this.quill.getBounds(this.quill.selection.savedRange));\n this.textbox.select();\n this.textbox.setAttribute('placeholder', this.textbox.getAttribute(`data-${mode}`) || '');\n this.root.setAttribute('data-mode', mode);\n }\n\n restoreFocus() {\n let scrollTop = this.quill.scrollingContainer.scrollTop;\n this.quill.focus();\n this.quill.scrollingContainer.scrollTop = scrollTop;\n }\n\n save() {\n let value = this.textbox.value;\n switch(this.root.getAttribute('data-mode')) {\n case 'link': {\n let scrollTop = this.quill.root.scrollTop;\n if (this.linkRange) {\n this.quill.formatText(this.linkRange, 'link', value, Emitter.sources.USER);\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, Emitter.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video': {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula': {\n if (!value) break;\n let range = this.quill.getSelection(true);\n if (range != null) {\n let index = range.index + range.length;\n this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, Emitter.sources.USER);\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER);\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER);\n }\n break;\n }\n default:\n }\n this.textbox.value = '';\n this.hide();\n }\n}\n\n\nfunction extractVideoUrl(url) {\n let match = url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/) ||\n url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0';\n }\n if (match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/)) { // eslint-disable-line no-cond-assign\n return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/';\n }\n return url;\n}\n\nfunction fillSelect(select, values, defaultValue = false) {\n values.forEach(function(value) {\n let option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', value);\n }\n select.appendChild(option);\n });\n}\n\n\nexport { BaseTooltip, BaseTheme as default };\n\n\n\n// WEBPACK FOOTER //\n// ./themes/base.js","import Quill from './core';\n\nimport { AlignClass, AlignStyle } from './formats/align';\nimport { DirectionAttribute, DirectionClass, DirectionStyle } from './formats/direction';\nimport { IndentClass as Indent } from './formats/indent';\n\nimport Blockquote from './formats/blockquote';\nimport Header from './formats/header';\nimport List, { ListItem } from './formats/list';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background';\nimport { ColorClass, ColorStyle } from './formats/color';\nimport { FontClass, FontStyle } from './formats/font';\nimport { SizeClass, SizeStyle } from './formats/size';\n\nimport Bold from './formats/bold';\nimport Italic from './formats/italic';\nimport Link from './formats/link';\nimport Script from './formats/script';\nimport Strike from './formats/strike';\nimport Underline from './formats/underline';\n\nimport Image from './formats/image';\nimport Video from './formats/video';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code';\n\nimport Formula from './modules/formula';\nimport Syntax from './modules/syntax';\nimport Toolbar from './modules/toolbar';\n\nimport Icons from './ui/icons';\nimport Picker from './ui/picker';\nimport ColorPicker from './ui/color-picker';\nimport IconPicker from './ui/icon-picker';\nimport Tooltip from './ui/tooltip';\n\nimport BubbleTheme from './themes/bubble';\nimport SnowTheme from './themes/snow';\n\n\nQuill.register({\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle\n}, true);\n\n\nQuill.register({\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'formats/list/item': ListItem,\n\n 'modules/formula': Formula,\n 'modules/syntax': Syntax,\n 'modules/toolbar': Toolbar,\n\n 'themes/bubble': BubbleTheme,\n 'themes/snow': SnowTheme,\n\n 'ui/icons': Icons,\n 'ui/picker': Picker,\n 'ui/icon-picker': IconPicker,\n 'ui/color-picker': ColorPicker,\n 'ui/tooltip': Tooltip\n}, true);\n\n\nexport default Quill;\n\n\n\n// WEBPACK FOOTER //\n// ./quill.js","import Parchment from 'parchment';\nimport Quill from './core/quill';\n\nimport Block, { BlockEmbed } from './blots/block';\nimport Break from './blots/break';\nimport Container from './blots/container';\nimport Cursor from './blots/cursor';\nimport Embed from './blots/embed';\nimport Inline from './blots/inline';\nimport Scroll from './blots/scroll';\nimport TextBlot from './blots/text';\n\nimport Clipboard from './modules/clipboard';\nimport History from './modules/history';\nimport Keyboard from './modules/keyboard';\n\nQuill.register({\n 'blots/block' : Block,\n 'blots/block/embed' : BlockEmbed,\n 'blots/break' : Break,\n 'blots/container' : Container,\n 'blots/cursor' : Cursor,\n 'blots/embed' : Embed,\n 'blots/inline' : Inline,\n 'blots/scroll' : Scroll,\n 'blots/text' : TextBlot,\n\n 'modules/clipboard' : Clipboard,\n 'modules/history' : History,\n 'modules/keyboard' : Keyboard\n});\n\nParchment.register(Block, Break, Cursor, Inline, Scroll, TextBlot);\n\n\nexport default Quill;\n\n\n\n// WEBPACK FOOTER //\n// ./core.js","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LinkedList = /** @class */ (function () {\n function LinkedList() {\n this.head = this.tail = null;\n this.length = 0;\n }\n LinkedList.prototype.append = function () {\n var nodes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodes[_i] = arguments[_i];\n }\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n };\n LinkedList.prototype.contains = function (node) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n if (cur === node)\n return true;\n }\n return false;\n };\n LinkedList.prototype.insertBefore = function (node, refNode) {\n if (!node)\n return;\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n }\n else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n }\n else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n };\n LinkedList.prototype.offset = function (target) {\n var index = 0, cur = this.head;\n while (cur != null) {\n if (cur === target)\n return index;\n index += cur.length();\n cur = cur.next;\n }\n return -1;\n };\n LinkedList.prototype.remove = function (node) {\n if (!this.contains(node))\n return;\n if (node.prev != null)\n node.prev.next = node.next;\n if (node.next != null)\n node.next.prev = node.prev;\n if (node === this.head)\n this.head = node.next;\n if (node === this.tail)\n this.tail = node.prev;\n this.length -= 1;\n };\n LinkedList.prototype.iterator = function (curNode) {\n if (curNode === void 0) { curNode = this.head; }\n // TODO use yield when we can\n return function () {\n var ret = curNode;\n if (curNode != null)\n curNode = curNode.next;\n return ret;\n };\n };\n LinkedList.prototype.find = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var cur, next = this.iterator();\n while ((cur = next())) {\n var length = cur.length();\n if (index < length ||\n (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) {\n return [cur, index];\n }\n index -= length;\n }\n return [null, 0];\n };\n LinkedList.prototype.forEach = function (callback) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n callback(cur);\n }\n };\n LinkedList.prototype.forEachAt = function (index, length, callback) {\n if (length <= 0)\n return;\n var _a = this.find(index), startNode = _a[0], offset = _a[1];\n var cur, curIndex = index - offset, next = this.iterator(startNode);\n while ((cur = next()) && curIndex < index + length) {\n var curLength = cur.length();\n if (index > curIndex) {\n callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n }\n else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n }\n };\n LinkedList.prototype.map = function (callback) {\n return this.reduce(function (memo, cur) {\n memo.push(callback(cur));\n return memo;\n }, []);\n };\n LinkedList.prototype.reduce = function (callback, memo) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n memo = callback(memo, cur);\n }\n return memo;\n };\n return LinkedList;\n}());\nexports.default = LinkedList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/collection/linked-list.ts\n// module id = 47\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = require(\"./abstract/container\");\nvar Registry = require(\"../registry\");\nvar OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\nvar MAX_OPTIMIZE_ITERATIONS = 100;\nvar ScrollBlot = /** @class */ (function (_super) {\n __extends(ScrollBlot, _super);\n function ScrollBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.scroll = _this;\n _this.observer = new MutationObserver(function (mutations) {\n _this.update(mutations);\n });\n _this.observer.observe(_this.domNode, OBSERVER_CONFIG);\n _this.attach();\n return _this;\n }\n ScrollBlot.prototype.detach = function () {\n _super.prototype.detach.call(this);\n this.observer.disconnect();\n };\n ScrollBlot.prototype.deleteAt = function (index, length) {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(function (child) {\n child.remove();\n });\n }\n else {\n _super.prototype.deleteAt.call(this, index, length);\n }\n };\n ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n this.update();\n _super.prototype.formatAt.call(this, index, length, name, value);\n };\n ScrollBlot.prototype.insertAt = function (index, value, def) {\n this.update();\n _super.prototype.insertAt.call(this, index, value, def);\n };\n ScrollBlot.prototype.optimize = function (mutations, context) {\n var _this = this;\n if (mutations === void 0) { mutations = []; }\n if (context === void 0) { context = {}; }\n _super.prototype.optimize.call(this, context);\n // We must modify mutations directly, cannot make copy and then modify\n var records = [].slice.call(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0)\n mutations.push(records.pop());\n // TODO use WeakMap\n var mark = function (blot, markParent) {\n if (markParent === void 0) { markParent = true; }\n if (blot == null || blot === _this)\n return;\n if (blot.domNode.parentNode == null)\n return;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [];\n }\n if (markParent)\n mark(blot.parent);\n };\n var optimize = function (blot) {\n // Post-order traversal\n if (\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY] == null ||\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations == null) {\n return;\n }\n if (blot instanceof container_1.default) {\n blot.children.forEach(optimize);\n }\n blot.optimize(context);\n };\n var remaining = mutations;\n for (var i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(Registry.find(mutation.previousSibling, false));\n [].forEach.call(mutation.addedNodes, function (node) {\n var child = Registry.find(node, false);\n mark(child, false);\n if (child instanceof container_1.default) {\n child.children.forEach(function (grandChild) {\n mark(grandChild, false);\n });\n }\n });\n }\n else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = [].slice.call(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0)\n mutations.push(records.pop());\n }\n };\n ScrollBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (context === void 0) { context = {}; }\n mutations = mutations || this.observer.takeRecords();\n // TODO use WeakMap\n mutations\n .map(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return null;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n return blot;\n }\n else {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n return null;\n }\n })\n .forEach(function (blot) {\n if (blot == null ||\n blot === _this ||\n //@ts-ignore\n blot.domNode[Registry.DATA_KEY] == null)\n return;\n // @ts-ignore\n blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);\n });\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY].mutations != null) {\n // @ts-ignore\n _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);\n }\n this.optimize(mutations, context);\n };\n ScrollBlot.blotName = 'scroll';\n ScrollBlot.defaultChild = 'block';\n ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n ScrollBlot.tagName = 'DIV';\n return ScrollBlot;\n}(container_1.default));\nexports.default = ScrollBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/scroll.ts\n// module id = 48\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = require(\"./abstract/format\");\nvar Registry = require(\"../registry\");\n// Shallow object comparison\nfunction isEqual(obj1, obj2) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length)\n return false;\n // @ts-ignore\n for (var prop in obj1) {\n // @ts-ignore\n if (obj1[prop] !== obj2[prop])\n return false;\n }\n return true;\n}\nvar InlineBlot = /** @class */ (function (_super) {\n __extends(InlineBlot, _super);\n function InlineBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n InlineBlot.formats = function (domNode) {\n if (domNode.tagName === InlineBlot.tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n InlineBlot.prototype.format = function (name, value) {\n var _this = this;\n if (name === this.statics.blotName && !value) {\n this.children.forEach(function (child) {\n if (!(child instanceof format_1.default)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n _this.attributes.copy(child);\n });\n this.unwrap();\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n InlineBlot.prototype.formatAt = function (index, length, name, value) {\n if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n var blot = this.isolate(index, length);\n blot.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n InlineBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n var formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n var next = this.next;\n if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n next.moveChildren(this);\n next.remove();\n }\n };\n InlineBlot.blotName = 'inline';\n InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n InlineBlot.tagName = 'SPAN';\n return InlineBlot;\n}(format_1.default));\nexports.default = InlineBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/inline.ts\n// module id = 49\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = require(\"./abstract/format\");\nvar Registry = require(\"../registry\");\nvar BlockBlot = /** @class */ (function (_super) {\n __extends(BlockBlot, _super);\n function BlockBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BlockBlot.formats = function (domNode) {\n var tagName = Registry.query(BlockBlot.blotName).tagName;\n if (domNode.tagName === tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n BlockBlot.prototype.format = function (name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n return;\n }\n else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n BlockBlot.prototype.formatAt = function (index, length, name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n BlockBlot.prototype.insertAt = function (index, value, def) {\n if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n // Insert text or inline\n _super.prototype.insertAt.call(this, index, value, def);\n }\n else {\n var after = this.split(index);\n var blot = Registry.create(value, def);\n after.parent.insertBefore(blot, after);\n }\n };\n BlockBlot.prototype.update = function (mutations, context) {\n if (navigator.userAgent.match(/Trident/)) {\n this.build();\n }\n else {\n _super.prototype.update.call(this, mutations, context);\n }\n };\n BlockBlot.blotName = 'block';\n BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n BlockBlot.tagName = 'P';\n return BlockBlot;\n}(format_1.default));\nexports.default = BlockBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/block.ts\n// module id = 50\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = require(\"./abstract/leaf\");\nvar EmbedBlot = /** @class */ (function (_super) {\n __extends(EmbedBlot, _super);\n function EmbedBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EmbedBlot.formats = function (domNode) {\n return undefined;\n };\n EmbedBlot.prototype.format = function (name, value) {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n };\n EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n EmbedBlot.prototype.formats = function () {\n return this.statics.formats(this.domNode);\n };\n return EmbedBlot;\n}(leaf_1.default));\nexports.default = EmbedBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/embed.ts\n// module id = 51\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = require(\"./abstract/leaf\");\nvar Registry = require(\"../registry\");\nvar TextBlot = /** @class */ (function (_super) {\n __extends(TextBlot, _super);\n function TextBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.text = _this.statics.value(_this.domNode);\n return _this;\n }\n TextBlot.create = function (value) {\n return document.createTextNode(value);\n };\n TextBlot.value = function (domNode) {\n var text = domNode.data;\n // @ts-ignore\n if (text['normalize'])\n text = text['normalize']();\n return text;\n };\n TextBlot.prototype.deleteAt = function (index, length) {\n this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n };\n TextBlot.prototype.index = function (node, offset) {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n };\n TextBlot.prototype.insertAt = function (index, value, def) {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n }\n else {\n _super.prototype.insertAt.call(this, index, value, def);\n }\n };\n TextBlot.prototype.length = function () {\n return this.text.length;\n };\n TextBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n }\n else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), this.next.value());\n this.next.remove();\n }\n };\n TextBlot.prototype.position = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return [this.domNode, index];\n };\n TextBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = Registry.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next);\n this.text = this.statics.value(this.domNode);\n return after;\n };\n TextBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this.domNode;\n })) {\n this.text = this.statics.value(this.domNode);\n }\n };\n TextBlot.prototype.value = function () {\n return this.text;\n };\n TextBlot.blotName = 'text';\n TextBlot.scope = Registry.Scope.INLINE_BLOT;\n return TextBlot;\n}(leaf_1.default));\nexports.default = TextBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parchment/src/blot/text.ts\n// module id = 52\n// module chunks = 0","let elem = document.createElement('div');\nelem.classList.toggle('test-class', false);\nif (elem.classList.contains('test-class')) {\n let _toggle = DOMTokenList.prototype.toggle;\n DOMTokenList.prototype.toggle = function(token, force) {\n if (arguments.length > 1 && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n}\n\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function(searchString, position){\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function(searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n}\n\nif (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, \"find\", {\n value: function(predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n }\n });\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n // Disable resizing in Firefox\n document.execCommand(\"enableObjectResizing\", false, false);\n // Disable automatic linkifying in IE11\n document.execCommand(\"autoUrlDetect\", false, false);\n});\n\n\n\n// WEBPACK FOOTER //\n// ./core/polyfill.js","/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int} cursor_pos Expected edit position in text1 (optional)\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos) {\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n // Check cursor_pos within bounds\n if (cursor_pos < 0 || text1.length < cursor_pos) {\n cursor_pos = null;\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs);\n if (cursor_pos != null) {\n diffs = fix_cursor(diffs, cursor_pos);\n }\n diffs = fix_emoji(diffs);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [[DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n */\nfunction diff_cleanupMerge(diffs) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL,\n text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n if (count_delete === 0) {\n diffs.splice(pointer - count_insert,\n count_delete + count_insert, [DIFF_INSERT, text_insert]);\n } else if (count_insert === 0) {\n diffs.splice(pointer - count_delete,\n count_delete + count_insert, [DIFF_DELETE, text_delete]);\n } else {\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert, [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]);\n }\n pointer = pointer - count_delete - count_insert +\n (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n};\n\n\nvar diff = diff_main;\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n\n/*\n * Modify a diff such that the cursor position points to the start of a change:\n * E.g.\n * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)\n * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]\n * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)\n * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} A tuple [cursor location in the modified diff, modified diff]\n */\nfunction cursor_normalize_diff (diffs, cursor_pos) {\n if (cursor_pos === 0) {\n return [DIFF_EQUAL, diffs];\n }\n for (var current_pos = 0, i = 0; i < diffs.length; i++) {\n var d = diffs[i];\n if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {\n var next_pos = current_pos + d[1].length;\n if (cursor_pos === next_pos) {\n return [i + 1, diffs];\n } else if (cursor_pos < next_pos) {\n // copy to prevent side effects\n diffs = diffs.slice();\n // split d into two diff changes\n var split_pos = cursor_pos - current_pos;\n var d_left = [d[0], d[1].slice(0, split_pos)];\n var d_right = [d[0], d[1].slice(split_pos)];\n diffs.splice(i, 1, d_left, d_right);\n return [i + 1, diffs];\n } else {\n current_pos = next_pos;\n }\n }\n }\n throw new Error('cursor_pos is out of bounds!')\n}\n\n/*\n * Modify a diff such that the edit position is \"shifted\" to the proposed edit location (cursor_position).\n *\n * Case 1)\n * Check if a naive shift is possible:\n * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)\n * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result\n * Case 2)\n * Check if the following shifts are possible:\n * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']\n * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']\n * ^ ^\n * d d_next\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} Array of diff tuples\n */\nfunction fix_cursor (diffs, cursor_pos) {\n var norm = cursor_normalize_diff(diffs, cursor_pos);\n var ndiffs = norm[1];\n var cursor_pointer = norm[0];\n var d = ndiffs[cursor_pointer];\n var d_next = ndiffs[cursor_pointer + 1];\n\n if (d == null) {\n // Text was deleted from end of original string,\n // cursor is now out of bounds in new string\n return diffs;\n } else if (d[0] !== DIFF_EQUAL) {\n // A modification happened at the cursor location.\n // This is the expected outcome, so we can return the original diff.\n return diffs;\n } else {\n if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {\n // Case 1)\n // It is possible to perform a naive shift\n ndiffs.splice(cursor_pointer, 2, d_next, d)\n return merge_tuples(ndiffs, cursor_pointer, 2)\n } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {\n // Case 2)\n // d[1] is a prefix of d_next[1]\n // We can assume that d_next[0] !== 0, since d[0] === 0\n // Shift edit locations..\n ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);\n var suffix = d_next[1].slice(d[1].length);\n if (suffix.length > 0) {\n ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);\n }\n return merge_tuples(ndiffs, cursor_pointer, 3)\n } else {\n // Not possible to perform any modification\n return diffs;\n }\n }\n}\n\n/*\n * Check diff did not split surrogate pairs.\n * Ex. [0, '\\uD83D'], [-1, '\\uDC36'], [1, '\\uDC2F'] -> [-1, '\\uD83D\\uDC36'], [1, '\\uD83D\\uDC2F']\n * '\\uD83D\\uDC36' === '🐶', '\\uD83D\\uDC2F' === '🐯'\n *\n * @param {Array} diffs Array of diff tuples\n * @return {Array} Array of diff tuples\n */\nfunction fix_emoji (diffs) {\n var compact = false;\n var starts_with_pair_end = function(str) {\n return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF;\n }\n var ends_with_pair_start = function(str) {\n return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF;\n }\n for (var i = 2; i < diffs.length; i += 1) {\n if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) &&\n diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) &&\n diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) {\n compact = true;\n\n diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1];\n diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1];\n\n diffs[i-2][1] = diffs[i-2][1].slice(0, -1);\n }\n }\n if (!compact) {\n return diffs;\n }\n var fixed_diffs = [];\n for (var i = 0; i < diffs.length; i += 1) {\n if (diffs[i][1].length > 0) {\n fixed_diffs.push(diffs[i]);\n }\n }\n return fixed_diffs;\n}\n\n/*\n * Try to merge tuples with their neigbors in a given range.\n * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']\n *\n * @param {Array} diffs Array of diff tuples.\n * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).\n * @param {Int} length Number of consecutive elements to check.\n * @return {Array} Array of merged diff tuples.\n */\nfunction merge_tuples (diffs, start, length) {\n // Check from (start-1) to (start+length).\n for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {\n if (i + 1 < diffs.length) {\n var left_d = diffs[i];\n var right_d = diffs[i+1];\n if (left_d[0] === right_d[1]) {\n diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);\n }\n }\n }\n return diffs;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/fast-diff/diff.js\n// module id = 54\n// module chunks = 0","exports = module.exports = typeof Object.keys === 'function'\n ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/deep-equal/lib/keys.js\n// module id = 55\n// module chunks = 0","var supportsArgumentsClass = (function(){\n return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n return object &&\n typeof object == 'object' &&\n typeof object.length == 'number' &&\n Object.prototype.hasOwnProperty.call(object, 'callee') &&\n !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n false;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/deep-equal/lib/is_arguments.js\n// module id = 56\n// module chunks = 0","import Delta from 'quill-delta';\nimport DeltaOp from 'quill-delta/lib/op';\nimport Parchment from 'parchment';\nimport CodeBlock from '../formats/code';\nimport CursorBlot from '../blots/cursor';\nimport Block, { bubbleFormats } from '../blots/block';\nimport Break from '../blots/break';\nimport clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\n\n\nconst ASCII = /^[ -~]*$/;\n\n\nclass Editor {\n constructor(scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta) {\n let consumeNextNewline = false;\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n delta = normalizeDelta(delta);\n delta.reduce((index, op) => {\n let length = op.retain || op.delete || op.insert.length || 1;\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n let text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (index >= scrollLength && !text.endsWith('\\n')) {\n consumeNextNewline = true;\n }\n this.scroll.insertAt(index, text);\n let [line, offset] = this.scroll.line(index);\n let formats = extend({}, bubbleFormats(line));\n if (line instanceof Block) {\n let [leaf, ] = line.descendant(Parchment.Leaf, offset);\n formats = extend(formats, bubbleFormats(leaf));\n }\n attributes = DeltaOp.attributes.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n let key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach((name) => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n delta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batchEnd();\n return this.update(delta);\n }\n\n deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(index, length, formats = {}) {\n this.scroll.update();\n Object.keys(formats).forEach((format) => {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[format]) return;\n let lines = this.scroll.lines(index, Math.max(length, 1));\n let lengthRemaining = length;\n lines.forEach((line) => {\n let lineLength = line.length();\n if (!(line instanceof CodeBlock)) {\n line.format(format, formats[format]);\n } else {\n let codeIndex = index - line.offset(this.scroll);\n let codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n line.formatAt(codeIndex, codeLength, format, formats[format]);\n }\n lengthRemaining -= lineLength;\n });\n });\n this.scroll.optimize();\n return this.update(new Delta().retain(index).retain(length, clone(formats)));\n }\n\n formatText(index, length, formats = {}) {\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).retain(length, clone(formats)));\n }\n\n getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n\n getDelta() {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index, length = 0) {\n let lines = [], leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(function(path) {\n let [blot, ] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof Parchment.Leaf) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(Parchment.Leaf, index, length);\n }\n let formatsArr = [lines, leaves].map(function(blots) {\n if (blots.length === 0) return {};\n let formats = bubbleFormats(blots.shift());\n while (Object.keys(formats).length > 0) {\n let blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return extend.apply(extend, formatsArr);\n }\n\n getText(index, length) {\n return this.getContents(index, length).filter(function(op) {\n return typeof op.insert === 'string';\n }).map(function(op) {\n return op.insert;\n }).join('');\n }\n\n insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(index, text, formats = {}) {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).insert(text, clone(formats)));\n }\n\n isBlank() {\n if (this.scroll.children.length == 0) return true;\n if (this.scroll.children.length > 1) return false;\n let block = this.scroll.children.head;\n if (block.statics.blotName !== Block.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n removeFormat(index, length) {\n let text = this.getText(index, length);\n let [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0, suffix = new Delta();\n if (line != null) {\n if (!(line instanceof CodeBlock)) {\n suffixLength = line.length() - offset;\n } else {\n suffixLength = line.newlineIndex(offset) - offset + 1;\n }\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n let contents = this.getContents(index, length + suffixLength);\n let diff = contents.diff(new Delta().insert(text).concat(suffix));\n let delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(change, mutations = [], cursorIndex = undefined) {\n let oldDelta = this.delta;\n if (mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n mutations[0].target.data.match(ASCII) &&\n Parchment.find(mutations[0].target)) {\n // Optimization for character changes\n let textBlot = Parchment.find(mutations[0].target);\n let formats = bubbleFormats(textBlot);\n let index = textBlot.offset(this.scroll);\n let oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n let oldText = new Delta().insert(oldValue);\n let newText = new Delta().insert(textBlot.value());\n let diffDelta = new Delta().retain(index).concat(oldText.diff(newText, cursorIndex));\n change = diffDelta.reduce(function(delta, op) {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n } else {\n return delta.push(op);\n }\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !equal(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, cursorIndex);\n }\n }\n return change;\n }\n}\n\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce(function(merged, name) {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce(function(delta, op) {\n if (op.insert === 1) {\n let attributes = clone(op.attributes);\n delete attributes['image'];\n return delta.insert({ image: op.attributes.image }, attributes);\n }\n if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n op = clone(op);\n if (op.attributes.list) {\n op.attributes.list = 'ordered';\n } else {\n op.attributes.list = 'bullet';\n delete op.attributes.bullet;\n }\n }\n if (typeof op.insert === 'string') {\n let text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return delta.insert(text, op.attributes);\n }\n return delta.push(op);\n }, new Delta());\n}\n\n\nexport default Editor;\n\n\n\n// WEBPACK FOOTER //\n// ./core/editor.js","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/eventemitter3/index.js\n// module id = 58\n// module chunks = 0","import Parchment from 'parchment';\nimport Emitter from '../core/emitter';\nimport Block, { BlockEmbed } from './block';\nimport Break from './break';\nimport CodeBlock from '../formats/code';\nimport Container from './container';\n\n\nfunction isLine(blot) {\n return (blot instanceof Block || blot instanceof BlockEmbed);\n}\n\n\nclass Scroll extends Parchment.Scroll {\n constructor(domNode, config) {\n super(domNode);\n this.emitter = config.emitter;\n if (Array.isArray(config.whitelist)) {\n this.whitelist = config.whitelist.reduce(function(whitelist, format) {\n whitelist[format] = true;\n return whitelist;\n }, {});\n }\n // Some reason fixes composition issues with character languages in Windows/Chrome, Safari\n this.domNode.addEventListener('DOMNodeInserted', function() {});\n this.optimize();\n this.enable();\n }\n\n batchStart() {\n this.batch = true;\n }\n\n batchEnd() {\n this.batch = false;\n this.optimize();\n }\n\n deleteAt(index, length) {\n let [first, offset] = this.line(index);\n let [last, ] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n if (first instanceof CodeBlock) {\n let newlineIndex = first.newlineIndex(first.length(), true);\n if (newlineIndex > -1) {\n first = first.split(newlineIndex + 1);\n if (first === last) {\n this.optimize();\n return;\n }\n }\n } else if (last instanceof CodeBlock) {\n let newlineIndex = last.newlineIndex(0);\n if (newlineIndex > -1) {\n last.split(newlineIndex + 1);\n }\n }\n let ref = last.children.head instanceof Break ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled);\n }\n\n formatAt(index, length, format, value) {\n if (this.whitelist != null && !this.whitelist[format]) return;\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index, value, def) {\n if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n if (index >= this.length()) {\n if (def == null || Parchment.query(value, Parchment.Scope.BLOCK) == null) {\n let blot = Parchment.create(this.statics.defaultChild);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n value = value.slice(0, -1);\n }\n blot.insertAt(0, value, def);\n } else {\n let embed = Parchment.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot, ref) {\n if (blot.statics.scope === Parchment.Scope.INLINE_BLOT) {\n let wrapper = Parchment.create(this.statics.defaultChild);\n wrapper.appendChild(blot);\n blot = wrapper;\n }\n super.insertBefore(blot, ref);\n }\n\n leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n\n line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE) {\n let getLines = (blot, index, length) => {\n let lines = [], lengthLeft = length;\n blot.children.forEachAt(index, length, function(child, index, length) {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof Parchment.Container) {\n lines = lines.concat(getLines(child, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(mutations = [], context = {}) {\n if (this.batch === true) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index) {\n return super.path(index).slice(1); // Exclude self\n }\n\n update(mutations) {\n if (this.batch === true) return;\n let source = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n}\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = 'block';\nScroll.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Scroll;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/scroll.js","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nimport { AlignAttribute, AlignStyle } from '../formats/align';\nimport { BackgroundStyle } from '../formats/background';\nimport CodeBlock from '../formats/code';\nimport { ColorStyle } from '../formats/color';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction';\nimport { FontStyle } from '../formats/font';\nimport { SizeStyle } from '../formats/size';\n\nlet debug = logger('quill:clipboard');\n\n\nconst DOM_KEY = '__ql-matcher';\n\nconst CLIPBOARD_CONFIG = [\n [Node.TEXT_NODE, matchText],\n [Node.TEXT_NODE, matchNewline],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchSpacing],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['li', matchIndent],\n ['b', matchAlias.bind(matchAlias, 'bold')],\n ['i', matchAlias.bind(matchAlias, 'italic')],\n ['style', matchIgnore]\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [\n AlignAttribute,\n DirectionAttribute\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\n\nclass Clipboard extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.quill.root.addEventListener('paste', this.onPaste.bind(this));\n this.container = this.quill.addContainer('ql-clipboard');\n this.container.setAttribute('contenteditable', true);\n this.container.setAttribute('tabindex', -1);\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers).forEach(([selector, matcher]) => {\n if (!options.matchVisual && matcher === matchSpacing) return;\n this.addMatcher(selector, matcher);\n });\n }\n\n addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert(html) {\n if (typeof html === 'string') {\n this.container.innerHTML = html.replace(/\\>\\r?\\n +\\<'); // Remove spaces between tags\n return this.convert();\n }\n const formats = this.quill.getFormat(this.quill.selection.savedRange.index);\n if (formats[CodeBlock.blotName]) {\n const text = this.container.innerText;\n this.container.innerHTML = '';\n return new Delta().insert(text, { [CodeBlock.blotName]: formats[CodeBlock.blotName] });\n }\n let [elementMatchers, textMatchers] = this.prepareMatching();\n let delta = traverse(this.container, elementMatchers, textMatchers);\n // Remove trailing newline\n if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n delta = delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n debug.log('convert', this.container.innerHTML, delta);\n this.container.innerHTML = '';\n return delta;\n }\n\n dangerouslyPasteHTML(index, html, source = Quill.sources.API) {\n if (typeof index === 'string') {\n this.quill.setContents(this.convert(index), html);\n this.quill.setSelection(0, Quill.sources.SILENT);\n } else {\n let paste = this.convert(html);\n this.quill.updateContents(new Delta().retain(index).concat(paste), source);\n this.quill.setSelection(index + paste.length(), Quill.sources.SILENT);\n }\n }\n\n onPaste(e) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n let range = this.quill.getSelection();\n let delta = new Delta().retain(range.index);\n let scrollTop = this.quill.scrollingContainer.scrollTop;\n this.container.focus();\n this.quill.selection.update(Quill.sources.SILENT);\n setTimeout(() => {\n delta = delta.concat(this.convert()).delete(range.length);\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(delta.length() - range.length, Quill.sources.SILENT);\n this.quill.scrollingContainer.scrollTop = scrollTop;\n this.quill.focus();\n }, 1);\n }\n\n prepareMatching() {\n let elementMatchers = [], textMatchers = [];\n this.matchers.forEach((pair) => {\n let [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n [].forEach.call(this.container.querySelectorAll(selector), (node) => {\n // TODO use weakmap\n node[DOM_KEY] = node[DOM_KEY] || [];\n node[DOM_KEY].push(matcher);\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\nClipboard.DEFAULTS = {\n matchers: [],\n matchVisual: true\n};\n\n\nfunction applyFormat(delta, format, value) {\n if (typeof format === 'object') {\n return Object.keys(format).reduce(function(delta, key) {\n return applyFormat(delta, key, format[key]);\n }, delta);\n } else {\n return delta.reduce(function(delta, op) {\n if (op.attributes && op.attributes[format]) {\n return delta.push(op);\n } else {\n return delta.insert(op.insert, extend({}, {[format]: value}, op.attributes));\n }\n }, new Delta());\n }\n}\n\nfunction computeStyle(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) return {};\n const DOM_KEY = '__ql-computed-style';\n return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n}\n\nfunction deltaEndsWith(delta, text) {\n let endText = \"\";\n for (let i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n let op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1*text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n let style = computeStyle(node);\n return ['block', 'list-item'].indexOf(style.display) > -1;\n}\n\nfunction traverse(node, elementMatchers, textMatchers) { // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce(function(delta, matcher) {\n return matcher(node, delta);\n }, new Delta());\n } else if (node.nodeType === node.ELEMENT_NODE) {\n return [].reduce.call(node.childNodes || [], (delta, childNode) => {\n let childrenDelta = traverse(childNode, elementMatchers, textMatchers);\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n childrenDelta = (childNode[DOM_KEY] || []).reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n } else {\n return new Delta();\n }\n}\n\n\nfunction matchAlias(format, node, delta) {\n return applyFormat(delta, format, true);\n}\n\nfunction matchAttributor(node, delta) {\n let attributes = Parchment.Attributor.Attribute.keys(node);\n let classes = Parchment.Attributor.Class.keys(node);\n let styles = Parchment.Attributor.Style.keys(node);\n let formats = {};\n attributes.concat(classes).concat(styles).forEach((name) => {\n let attr = Parchment.query(name, Parchment.Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name]\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n return delta;\n}\n\nfunction matchBlot(node, delta) {\n let match = Parchment.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof Parchment.Embed) {\n let embed = {};\n let value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n delta = new Delta().insert(embed, match.formats(node));\n }\n } else if (typeof match.formats === 'function') {\n delta = applyFormat(delta, match.blotName, match.formats(node));\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchIndent(node, delta) {\n let match = Parchment.query(node);\n if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\\n')) {\n return delta;\n }\n let indent = -1, parent = node.parentNode;\n while (!parent.classList.contains('ql-clipboard')) {\n if ((Parchment.query(parent) || {}).blotName === 'list') {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.compose(new Delta().retain(delta.length() - 1).retain(1, { indent: indent}));\n}\n\nfunction matchNewline(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (isLine(node) || (delta.length() > 0 && node.nextSibling && isLine(node.nextSibling))) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchSpacing(node, delta) {\n if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\\n\\n')) {\n let nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);\n if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight*1.5) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n let formats = {};\n let style = node.style || {};\n if (style.fontStyle && computeStyle(node).fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') ||\n parseInt(computeStyle(node).fontWeight) >= 700)) {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n if (parseFloat(style.textIndent || 0) > 0) { // Could be 0.5in\n delta = new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchText(node, delta) {\n let text = node.data;\n // Word represents empty line with  \n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) {\n return delta;\n }\n if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n // eslint-disable-next-line func-style\n let replacer = function(collapse, match) {\n match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return match.length < 1 && collapse ? ' ' : match;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if ((node.previousSibling == null && isLine(node.parentNode)) ||\n (node.previousSibling != null && isLine(node.previousSibling))) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if ((node.nextSibling == null && isLine(node.parentNode)) ||\n (node.nextSibling != null && isLine(node.nextSibling))) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\n\nexport { Clipboard as default, matchAttributor, matchBlot, matchNewline, matchSpacing, matchText };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/clipboard.js","import Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\n\n\nclass History extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.lastRecorded = 0;\n this.ignoreChange = false;\n this.clear();\n this.quill.on(Quill.events.EDITOR_CHANGE, (eventName, delta, oldDelta, source) => {\n if (eventName !== Quill.events.TEXT_CHANGE || this.ignoreChange) return;\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(delta, oldDelta);\n } else {\n this.transform(delta);\n }\n });\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, this.undo.bind(this));\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, this.redo.bind(this));\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, this.redo.bind(this));\n }\n }\n\n change(source, dest) {\n if (this.stack[source].length === 0) return;\n let delta = this.stack[source].pop();\n this.stack[dest].push(delta);\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta[source], Quill.sources.USER);\n this.ignoreChange = false;\n let index = getLastChangeIndex(delta[source]);\n this.quill.setSelection(index);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = this.quill.getContents().diff(oldDelta);\n let timestamp = Date.now();\n if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n let delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta.undo);\n changeDelta = delta.redo.compose(changeDelta);\n } else {\n this.lastRecorded = timestamp;\n }\n this.stack.undo.push({\n redo: changeDelta,\n undo: undoDelta\n });\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta) {\n this.stack.undo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n this.stack.redo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n}\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false\n};\n\nfunction endsWithNewlineChange(delta) {\n let lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(function(attr) {\n return Parchment.query(attr, Parchment.Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(delta) {\n let deleteLength = delta.reduce(function(length, op) {\n length += (op.delete || 0);\n return length;\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\n\nexport { History as default, getLastChangeIndex };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/history.js","import Parchment from 'parchment';\n\nclass IdentAttributor extends Parchment.Attributor.Class {\n add(node, value) {\n if (value === '+1' || value === '-1') {\n let indent = this.value(node) || 0;\n value = (value === '+1' ? (indent + 1) : (indent - 1));\n }\n if (value === 0) {\n this.remove(node);\n return true;\n } else {\n return super.add(node, value);\n }\n }\n\n canAdd(node, value) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value));\n }\n\n value(node) {\n return parseInt(super.value(node)) || undefined; // Don't return NaN\n }\n}\n\nlet IndentClass = new IdentAttributor('indent', 'ql-indent', {\n scope: Parchment.Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n});\n\nexport { IndentClass };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/indent.js","import Block from '../blots/block';\n\n\nclass Blockquote extends Block {}\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\n\nexport default Blockquote;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/blockquote.js","import Block from '../blots/block';\n\n\nclass Header extends Block {\n static formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\n\nexport default Header;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/header.js","import Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Container from '../blots/container';\n\n\nclass ListItem extends Block {\n static formats(domNode) {\n return domNode.tagName === this.tagName ? undefined : super.formats(domNode);\n }\n\n format(name, value) {\n if (name === List.blotName && !value) {\n this.replaceWith(Parchment.create(this.statics.scope));\n } else {\n super.format(name, value);\n }\n }\n\n remove() {\n if (this.prev == null && this.next == null) {\n this.parent.remove();\n } else {\n super.remove();\n }\n }\n\n replaceWith(name, value) {\n this.parent.isolate(this.offset(this.parent), this.length());\n if (name === this.parent.statics.blotName) {\n this.parent.replaceWith(name, value);\n return this;\n } else {\n this.parent.unwrap();\n return super.replaceWith(name, value);\n }\n }\n}\nListItem.blotName = 'list-item';\nListItem.tagName = 'LI';\n\n\nclass List extends Container {\n static create(value) {\n let tagName = value === 'ordered' ? 'OL' : 'UL';\n let node = super.create(tagName);\n if (value === 'checked' || value === 'unchecked') {\n node.setAttribute('data-checked', value === 'checked');\n }\n return node;\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'OL') return 'ordered';\n if (domNode.tagName === 'UL') {\n if (domNode.hasAttribute('data-checked')) {\n return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked';\n } else {\n return 'bullet';\n }\n }\n return undefined;\n }\n\n constructor(domNode) {\n super(domNode);\n const listEventHandler = (e) => {\n if (e.target.parentNode !== domNode) return;\n let format = this.statics.formats(domNode);\n let blot = Parchment.find(e.target);\n if (format === 'checked') {\n blot.format('list', 'unchecked');\n } else if(format === 'unchecked') {\n blot.format('list', 'checked');\n }\n }\n\n domNode.addEventListener('touchstart', listEventHandler);\n domNode.addEventListener('mousedown', listEventHandler);\n }\n\n format(name, value) {\n if (this.children.length > 0) {\n this.children.tail.format(name, value);\n }\n }\n\n formats() {\n // We don't inherit from FormatBlot\n return { [this.statics.blotName]: this.statics.formats(this.domNode) };\n }\n\n insertBefore(blot, ref) {\n if (blot instanceof ListItem) {\n super.insertBefore(blot, ref);\n } else {\n let index = ref == null ? this.length() : ref.offset(this);\n let after = this.split(index);\n after.parent.insertBefore(blot, after);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n next.domNode.tagName === this.domNode.tagName &&\n next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n if (target.statics.blotName !== this.statics.blotName) {\n let item = Parchment.create(this.statics.defaultChild);\n target.moveChildren(item);\n this.appendChild(item);\n }\n super.replace(target);\n }\n}\nList.blotName = 'list';\nList.scope = Parchment.Scope.BLOCK_BLOT;\nList.tagName = ['OL', 'UL'];\nList.defaultChild = 'list-item';\nList.allowedChildren = [ListItem];\n\n\nexport { ListItem, List as default };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/list.js","import Bold from './bold';\n\nclass Italic extends Bold { }\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexport default Italic;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/italic.js","import Inline from '../blots/inline';\n\nclass Script extends Inline {\n static create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n } else if (value === 'sub') {\n return document.createElement('sub');\n } else {\n return super.create(value);\n }\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexport default Script;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/script.js","import Inline from '../blots/inline';\n\nclass Strike extends Inline { }\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexport default Strike;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/strike.js","import Inline from '../blots/inline';\n\nclass Underline extends Inline { }\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexport default Underline;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/underline.js","import Parchment from 'parchment';\nimport { sanitize } from '../formats/link';\n\nconst ATTRIBUTES = [\n 'alt',\n 'height',\n 'width'\n];\n\n\nclass Image extends Parchment.Embed {\n static create(value) {\n let node = super.create(value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static sanitize(url) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\n\nexport default Image;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/image.js","import { BlockEmbed } from '../blots/block';\nimport Link from '../formats/link';\n\nconst ATTRIBUTES = [\n 'height',\n 'width'\n];\n\n\nclass Video extends BlockEmbed {\n static create(value) {\n let node = super.create(value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static sanitize(url) {\n return Link.sanitize(url);\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\n\nexport default Video;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/video.js","import Embed from '../blots/embed';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\n\n\nclass FormulaBlot extends Embed {\n static create(value) {\n let node = super.create(value);\n if (typeof value === 'string') {\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00'\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n\n static value(domNode) {\n return domNode.getAttribute('data-value');\n }\n}\nFormulaBlot.blotName = 'formula';\nFormulaBlot.className = 'ql-formula';\nFormulaBlot.tagName = 'SPAN';\n\n\nclass Formula extends Module {\n static register() {\n Quill.register(FormulaBlot, true);\n }\n\n constructor() {\n super();\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n }\n}\n\n\nexport { FormulaBlot, Formula as default };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/formula.js","import Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\nimport CodeBlock from '../formats/code';\n\n\nclass SyntaxCodeBlock extends CodeBlock {\n replaceWith(block) {\n this.domNode.textContent = this.domNode.textContent;\n this.attach();\n super.replaceWith(block);\n }\n\n highlight(highlight) {\n let text = this.domNode.textContent;\n if (this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n this.domNode.innerHTML = highlight(text);\n this.domNode.normalize();\n this.attach();\n }\n this.cachedText = text;\n }\n }\n}\nSyntaxCodeBlock.className = 'ql-syntax';\n\n\nlet CodeToken = new Parchment.Attributor.Class('token', 'hljs', {\n scope: Parchment.Scope.INLINE\n});\n\n\nclass Syntax extends Module {\n static register() {\n Quill.register(CodeToken, true);\n Quill.register(SyntaxCodeBlock, true);\n }\n\n constructor(quill, options) {\n super(quill, options);\n if (typeof this.options.highlight !== 'function') {\n throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');\n }\n let timer = null;\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, this.options.interval);\n });\n this.highlight();\n }\n\n highlight() {\n if (this.quill.selection.composing) return;\n this.quill.update(Quill.sources.USER);\n let range = this.quill.getSelection();\n this.quill.scroll.descendants(SyntaxCodeBlock).forEach((code) => {\n code.highlight(this.options.highlight);\n });\n this.quill.update(Quill.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n }\n }\n}\nSyntax.DEFAULTS = {\n highlight: (function() {\n if (window.hljs == null) return null;\n return function(text) {\n let result = window.hljs.highlightAuto(text);\n return result.value;\n };\n })(),\n interval: 1000\n};\n\n\nexport { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default};\n\n\n\n// WEBPACK FOOTER //\n// ./modules/syntax.js","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nlet debug = logger('quill:toolbar');\n\n\nclass Toolbar extends Module {\n constructor(quill, options) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n let container = document.createElement('div');\n addControls(container, this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n return debug.error('Container required for toolbar', this.options);\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n Object.keys(this.options.handlers).forEach((format) => {\n this.addHandler(format, this.options.handlers[format]);\n });\n [].forEach.call(this.container.querySelectorAll('button, select'), (input) => {\n this.attach(input);\n });\n this.quill.on(Quill.events.EDITOR_CHANGE, (type, range) => {\n if (type === Quill.events.SELECTION_CHANGE) {\n this.update(range);\n }\n });\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n let [range, ] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n\n attach(input) {\n let format = [].find.call(input.classList, (className) => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (this.handlers[format] == null) {\n if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n debug.warn('ignoring attaching to disabled format', format, input);\n return;\n }\n if (Parchment.query(format) == null) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n }\n let eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, (e) => {\n let value;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n let selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n let [range, ] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (Parchment.query(format).prototype instanceof Parchment.Embed) {\n value = prompt(`Enter ${format}`);\n if (!value) return;\n this.quill.updateContents(new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ [format]: value })\n , Quill.sources.USER);\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n // TODO use weakmap\n this.controls.push([format, input]);\n }\n\n update(range) {\n let formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(function(pair) {\n let [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\\\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else {\n if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n let isActive = formats[format] === input.getAttribute('value') ||\n (formats[format] != null && formats[format].toString() === input.getAttribute('value')) ||\n (formats[format] == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\n\nfunction addButton(container, format, value) {\n let input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add('ql-' + format);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(function(controls) {\n let group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(function(control) {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n let format = Object.keys(control)[0];\n let value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n let input = document.createElement('select');\n input.classList.add('ql-' + format);\n values.forEach(function(value) {\n let option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean: function() {\n let range = this.quill.getSelection();\n if (range == null) return;\n if (range.length == 0) {\n let formats = this.quill.getFormat();\n Object.keys(formats).forEach((name) => {\n // Clean functionality in existing apps only clean inline formats\n if (Parchment.query(name, Parchment.Scope.INLINE) != null) {\n this.quill.format(name, false);\n }\n });\n } else {\n this.quill.removeFormat(range, Quill.sources.USER);\n }\n },\n direction: function(value) {\n let align = this.quill.getFormat()['align'];\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n indent: function(value) {\n let range = this.quill.getSelection();\n let formats = this.quill.getFormat(range);\n let indent = parseInt(formats.indent || 0);\n if (value === '+1' || value === '-1') {\n let modifier = (value === '+1') ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n },\n link: function(value) {\n if (value === true) {\n value = prompt('Enter link URL:');\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n list: function(value) {\n let range = this.quill.getSelection();\n let formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats['list'] === 'checked' || formats['list'] === 'unchecked') {\n this.quill.format('list', false, Quill.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', Quill.sources.USER);\n }\n } else {\n this.quill.format('list', value, Quill.sources.USER);\n }\n }\n }\n}\n\n\nexport { Toolbar as default, addControls };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/toolbar.js","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-left.svg\n// module id = 75\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-center.svg\n// module id = 76\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-right.svg\n// module id = 77\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-justify.svg\n// module id = 78\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/background.svg\n// module id = 79\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/blockquote.svg\n// module id = 80\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/bold.svg\n// module id = 81\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/clean.svg\n// module id = 82\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/color.svg\n// module id = 83\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/direction-ltr.svg\n// module id = 84\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/direction-rtl.svg\n// module id = 85\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-center.svg\n// module id = 86\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-full.svg\n// module id = 87\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-left.svg\n// module id = 88\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-right.svg\n// module id = 89\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/formula.svg\n// module id = 90\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/header.svg\n// module id = 91\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/header-2.svg\n// module id = 92\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/italic.svg\n// module id = 93\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/image.svg\n// module id = 94\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/indent.svg\n// module id = 95\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/outdent.svg\n// module id = 96\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/link.svg\n// module id = 97\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-ordered.svg\n// module id = 98\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-bullet.svg\n// module id = 99\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-check.svg\n// module id = 100\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/subscript.svg\n// module id = 101\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/superscript.svg\n// module id = 102\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/strike.svg\n// module id = 103\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/underline.svg\n// module id = 104\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/video.svg\n// module id = 105\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/dropdown.svg\n// module id = 106\n// module chunks = 0","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\n\nconst TOOLBAR_CONFIG = [\n ['bold', 'italic', 'link'],\n [{ header: 1 }, { header: 2 }, 'blockquote']\n];\n\nclass BubbleTheme extends BaseTheme {\n constructor(quill, options) {\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n\n extendToolbar(toolbar) {\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), icons);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), icons);\n }\n}\nBubbleTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function(value) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n }\n }\n }\n }\n});\n\n\nclass BubbleTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.quill.on(Emitter.events.EDITOR_CHANGE, (type, range, oldRange, source) => {\n if (type !== Emitter.events.SELECTION_CHANGE) return;\n if (range != null && range.length > 0 && source === Emitter.sources.USER) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = this.root.offsetWidth + 'px';\n let lines = this.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n this.position(this.quill.getBounds(range));\n } else {\n let lastLine = lines[lines.length - 1];\n let index = this.quill.getIndex(lastLine);\n let length = Math.min(lastLine.length() - 1, range.index + range.length - index);\n let bounds = this.quill.getBounds(new Range(index, length));\n this.position(bounds);\n }\n } else if (document.activeElement !== this.textbox && this.quill.hasFocus()) {\n this.hide();\n }\n });\n }\n\n listen() {\n super.listen();\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(Emitter.events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n let range = this.quill.getSelection();\n if (range != null) {\n this.position(this.quill.getBounds(range));\n }\n }, 1);\n });\n }\n\n cancel() {\n this.show();\n }\n\n position(reference) {\n let shift = super.position(reference);\n let arrow = this.root.querySelector('.ql-tooltip-arrow');\n arrow.style.marginLeft = '';\n if (shift === 0) return shift;\n arrow.style.marginLeft = (-1*shift - arrow.offsetWidth/2) + 'px';\n }\n}\nBubbleTooltip.TEMPLATE = [\n '',\n '
    ',\n '',\n '',\n '
    '\n].join('');\n\n\nexport { BubbleTooltip, BubbleTheme as default };\n\n\n\n// WEBPACK FOOTER //\n// ./themes/bubble.js","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport LinkBlot from '../formats/link';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\n\nconst TOOLBAR_CONFIG = [\n [{ header: ['1', '2', '3', false] }],\n ['bold', 'italic', 'underline', 'link'],\n [{ list: 'ordered' }, { list: 'bullet' }],\n ['clean']\n];\n\nclass SnowTheme extends BaseTheme {\n constructor(quill, options) {\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n\n extendToolbar(toolbar) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), icons);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), icons);\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function(range, context) {\n toolbar.handlers['link'].call(toolbar, !context.format.link);\n });\n }\n }\n}\nSnowTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function(value) {\n if (value) {\n let range = this.quill.getSelection();\n if (range == null || range.length == 0) return;\n let preview = this.quill.getText(range);\n if (/^\\S+@\\S+\\.\\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {\n preview = 'mailto:' + preview;\n }\n let tooltip = this.quill.theme.tooltip;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n }\n }\n }\n }\n});\n\n\nclass SnowTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.preview = this.root.querySelector('a.ql-preview');\n }\n\n listen() {\n super.listen();\n this.root.querySelector('a.ql-action').addEventListener('click', (event) => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n this.root.querySelector('a.ql-remove').addEventListener('click', (event) => {\n if (this.linkRange != null) {\n let range = this.linkRange;\n this.restoreFocus();\n this.quill.formatText(range, 'link', false, Emitter.sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(Emitter.events.SELECTION_CHANGE, (range, oldRange, source) => {\n if (range == null) return;\n if (range.length === 0 && source === Emitter.sources.USER) {\n let [link, offset] = this.quill.scroll.descendant(LinkBlot, range.index);\n if (link != null) {\n this.linkRange = new Range(range.index - offset, link.length());\n let preview = LinkBlot.formats(link.domNode);\n this.preview.textContent = preview;\n this.preview.setAttribute('href', preview);\n this.show();\n this.position(this.quill.getBounds(this.linkRange));\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.hide();\n });\n }\n\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\nSnowTooltip.TEMPLATE = [\n '',\n '',\n '',\n ''\n].join('');\n\n\nexport default SnowTheme;\n\n\n\n// WEBPACK FOOTER //\n// ./themes/snow.js"],"sourceRoot":""} \ No newline at end of file diff -Nru bibledit-5.0.912/quill/quill.snow.css bibledit-5.0.922/quill/quill.snow.css --- bibledit-5.0.912/quill/quill.snow.css 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/quill/quill.snow.css 2018-03-12 06:39:22.000000000 +0000 @@ -1,36 +1,8 @@ /*! - * Quill Editor v1.1.5 + * Quill Editor v1.3.6 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ .ql-container { box-sizing: border-box; @@ -43,6 +15,9 @@ .ql-container.ql-disabled .ql-tooltip { visibility: hidden; } +.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before { + pointer-events: none; +} .ql-clipboard { left: -100000px; height: 1px; @@ -56,7 +31,6 @@ } .ql-editor { box-sizing: border-box; - cursor: text; line-height: 1.42; height: 100%; outline: none; @@ -68,6 +42,9 @@ white-space: pre-wrap; word-wrap: break-word; } +.ql-editor > * { + cursor: text; +} .ql-editor p, .ql-editor ol, .ql-editor ul, @@ -92,28 +69,56 @@ list-style-type: none; } .ql-editor ul > li::before { - content: '\25CF'; + content: '\2022'; +} +.ql-editor ul[data-checked=true], +.ql-editor ul[data-checked=false] { + pointer-events: none; +} +.ql-editor ul[data-checked=true] > li *, +.ql-editor ul[data-checked=false] > li * { + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before, +.ql-editor ul[data-checked=false] > li::before { + color: #777; + cursor: pointer; + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before { + content: '\2611'; +} +.ql-editor ul[data-checked=false] > li::before { + content: '\2610'; } .ql-editor li::before { display: inline-block; - margin-right: 0.3em; - text-align: right; white-space: nowrap; width: 1.2em; } .ql-editor li:not(.ql-direction-rtl)::before { margin-left: -1.5em; + margin-right: 0.3em; + text-align: right; } -.ql-editor ol li, -.ql-editor ul li { +.ql-editor li.ql-direction-rtl::before { + margin-left: 0.3em; + margin-right: -1.5em; +} +.ql-editor ol li:not(.ql-direction-rtl), +.ql-editor ul li:not(.ql-direction-rtl) { padding-left: 1.5em; } +.ql-editor ol li.ql-direction-rtl, +.ql-editor ul li.ql-direction-rtl { + padding-right: 1.5em; +} .ql-editor ol li { counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; - counter-increment: list-num; + counter-increment: list-0; } .ql-editor ol li:before { - content: counter(list-num, decimal) '. '; + content: counter(list-0, decimal) '. '; } .ql-editor ol li.ql-indent-1 { counter-increment: list-1; @@ -385,8 +390,10 @@ color: rgba(0,0,0,0.6); content: attr(data-placeholder); font-style: italic; + left: 15px; pointer-events: none; position: absolute; + right: 15px; } .ql-snow.ql-toolbar:after, .ql-snow .ql-toolbar:after { @@ -410,12 +417,18 @@ float: left; height: 100%; } +.ql-snow.ql-toolbar button:active:hover, +.ql-snow .ql-toolbar button:active:hover { + outline: none; +} .ql-snow.ql-toolbar input.ql-image[type=file], .ql-snow .ql-toolbar input.ql-image[type=file] { display: none; } .ql-snow.ql-toolbar button:hover, .ql-snow .ql-toolbar button:hover, +.ql-snow.ql-toolbar button:focus, +.ql-snow .ql-toolbar button:focus, .ql-snow.ql-toolbar button.ql-active, .ql-snow .ql-toolbar button.ql-active, .ql-snow.ql-toolbar .ql-picker-label:hover, @@ -430,6 +443,8 @@ } .ql-snow.ql-toolbar button:hover .ql-fill, .ql-snow .ql-toolbar button:hover .ql-fill, +.ql-snow.ql-toolbar button:focus .ql-fill, +.ql-snow .ql-toolbar button:focus .ql-fill, .ql-snow.ql-toolbar button.ql-active .ql-fill, .ql-snow .ql-toolbar button.ql-active .ql-fill, .ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill, @@ -442,6 +457,8 @@ .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill, .ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill, .ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill, +.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill, .ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill, .ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill, .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, @@ -456,6 +473,8 @@ } .ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow .ql-toolbar button:hover .ql-stroke, +.ql-snow.ql-toolbar button:focus .ql-stroke, +.ql-snow .ql-toolbar button:focus .ql-stroke, .ql-snow.ql-toolbar button.ql-active .ql-stroke, .ql-snow .ql-toolbar button.ql-active .ql-stroke, .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke, @@ -468,6 +487,8 @@ .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke, .ql-snow.ql-toolbar button:hover .ql-stroke-miter, .ql-snow .ql-toolbar button:hover .ql-stroke-miter, +.ql-snow.ql-toolbar button:focus .ql-stroke-miter, +.ql-snow .ql-toolbar button:focus .ql-stroke-miter, .ql-snow.ql-toolbar button.ql-active .ql-stroke-miter, .ql-snow .ql-toolbar button.ql-active .ql-stroke-miter, .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter, @@ -480,6 +501,24 @@ .ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter { stroke: #06c; } +@media (pointer: coarse) { + .ql-snow.ql-toolbar button:hover:not(.ql-active), + .ql-snow .ql-toolbar button:hover:not(.ql-active) { + color: #444; + } + .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill, + .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill { + fill: #444; + } + .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter, + .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter { + stroke: #444; + } +} .ql-snow { box-sizing: border-box; } @@ -495,11 +534,15 @@ } .ql-snow .ql-tooltip { position: absolute; + transform: translateY(10px); } .ql-snow .ql-tooltip a { cursor: pointer; text-decoration: none; } +.ql-snow .ql-tooltip.ql-flip { + transform: translateY(-10px); +} .ql-snow .ql-formats { display: inline-block; vertical-align: middle; @@ -588,13 +631,7 @@ } .ql-snow .ql-editor code { font-size: 85%; - padding-bottom: 2px; - padding-top: 2px; -} -.ql-snow .ql-editor code:before, -.ql-snow .ql-editor code:after { - content: "\A0"; - letter-spacing: -2px; + padding: 2px 4px; } .ql-snow .ql-editor pre.ql-syntax { background-color: #23241f; @@ -842,7 +879,6 @@ border: 1px solid #ccc; box-shadow: 0px 0px 5px #ddd; color: #444; - margin-top: 10px; padding: 5px 12px; white-space: nowrap; } diff -Nru bibledit-5.0.912/redirect/index.cpp bibledit-5.0.922/redirect/index.cpp --- bibledit-5.0.912/redirect/index.cpp 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/redirect/index.cpp 2020-11-22 12:42:17.000000000 +0000 @@ -0,0 +1,43 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include + + +string editone_index_url () +{ + return "editone/index"; +} + + +bool editone_index_acl () +{ + return true; +} + + +string editone_index (void * webserver_request) +{ + Webserver_Request * request = (Webserver_Request *) webserver_request; + redirect_browser (request, editone2_index_url ()); + return ""; +} diff -Nru bibledit-5.0.912/redirect/index.h bibledit-5.0.922/redirect/index.h --- bibledit-5.0.912/redirect/index.h 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/redirect/index.h 2020-11-21 21:03:29.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (©) 2003-2020 Teus Benschop. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#ifndef INCLUDED_EDITONE_INDEX_H +#define INCLUDED_EDITONE_INDEX_H + + +#include + + +string editone_index_url (); +bool editone_index_acl (); +string editone_index (void * webserver_request); + + +#endif diff -Nru bibledit-5.0.912/tarball-linux.sh bibledit-5.0.922/tarball-linux.sh --- bibledit-5.0.912/tarball-linux.sh 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.922/tarball-linux.sh 2020-12-03 16:25:19.000000000 +0000 @@ -0,0 +1,171 @@ +#!/bin/bash + +# Copyright (©) 2003-2020 Teus Benschop. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +# This script runs in a Terminal on macOS. +# It requires a Linux machine accessible via the network. +# It refreshes and updates the bibledit sources. +# It generates a tarball for a Linux Bibledit client. + + +BUILDDIR=/tmp/bibledit-linux +echo Build directory at $BUILDDIR +cd $BUILDDIR +if [ $? -ne 0 ]; then exit; fi + + +echo Working in $BUILDDIR + + +# Move the Bibledit Linux GUI sources into place. +mv bibledit.h executable +if [ $? -ne 0 ]; then exit; fi + +mv bibledit.cpp executable +if [ $? -ne 0 ]; then exit; fi + + +# Remove unwanted files. +rm valgrind +rm bibledit +rm dev +rm -rf unittests +find . -name .DS_Store -delete +rm -rf .git +find . -name "*.Po" -delete +rm -rf autom4te.cache +rm -rf *.xcodeproj +rm -rf xcode +#echo Remove macOS extended attributes. +#echo The attributes would make their way into the tarball, +#echo get unpacked within Debian, +#echo and would cause lintian errors. +#xattr -r -c * + + +echo Install build requirements. +sudo apt --yes --assume-yes install build-essential +sudo apt --yes --assume-yes install autoconf +sudo apt --yes --assume-yes install automake +sudo apt --yes --assume-yes install autoconf-archive +sudo apt --yes --assume-yes install git +sudo apt --yes --assume-yes install zip +sudo apt --yes --assume-yes install pkgconf +sudo apt --yes --assume-yes install libcurl4-openssl-dev +sudo apt --yes --assume-yes install libssl-dev +sudo apt --yes --assume-yes install libatspi2.0-dev +sudo apt --yes --assume-yes install libgtk-3-dev +sudo apt --yes --assume-yes install libwebkit2gtk-3.0-dev +sudo apt --yes --assume-yes install libwebkit2gtk-4.0-dev +sudo apt --yes --assume-yes install curl +sudo apt --yes --assume-yes install make +sudo apt --yes --assume-yes install libmimetic-dev + + +# Clean source. +./configure +if [ $? -ne 0 ]; then exit; fi +make distclean +if [ $? -ne 0 ]; then exit; fi + + +# Enable the Linux configuration in config.h. +sed -i.bak 's/ENABLELINUX=no/ENABLELINUX=yes/g' configure.ac +if [ $? -ne 0 ]; then exit; fi +sed -i.bak 's/# linux //g' configure.ac +if [ $? -ne 0 ]; then exit; fi +sed -i.bak 's/.*Tag8.*/AC_DEFINE([HAVE_LINUX], [1], [Enable installation on Linux])/g' configure.ac +if [ $? -ne 0 ]; then exit; fi +# A client does not use the mimetic library. +sed -i.bak '/mimetic/d' configure.ac +if [ $? -ne 0 ]; then exit; fi +# A client does not need the cURL library. +sed -i.bak '/curl/d' configure.ac +if [ $? -ne 0 ]; then exit; fi +sed -i.bak '/CURL/d' configure.ac +if [ $? -ne 0 ]; then exit; fi +# A client does not need the OpenSSL library. +sed -i.bak '/OPENSSL/d' configure.ac +if [ $? -ne 0 ]; then exit; fi + + +# Do not build the unit tests and the generator. +# Rename binary 'server' to 'bibledit'. +sed -i.bak 's/server unittest generate/bibledit/g' Makefile.am +if [ $? -ne 0 ]; then exit; fi +sed -i.bak 's/server_/bibledit_/g' Makefile.am +if [ $? -ne 0 ]; then exit; fi +sed -i.bak '/unittest/d' Makefile.am +if [ $? -ne 0 ]; then exit; fi +sed -i.bak '/generate_/d' Makefile.am +if [ $? -ne 0 ]; then exit; fi +# Update what to distribute. +sed -i.bak 's/bible bibledit/bible/g' Makefile.am +if [ $? -ne 0 ]; then exit; fi +sed -i.bak '/EXTRA_DIST/ s/$/ *.desktop *.xpm *.png *.xml/' Makefile.am +if [ $? -ne 0 ]; then exit; fi +# Do not link with cURL and OpenSSL. +# Both are not used. +# As a result, a Debian package finds itself having unsatisfied dependencies. +# Removing the flags fixes that. +sed -i.bak '/CURL/d' Makefile.am +if [ $? -ne 0 ]; then exit; fi +sed -i.bak '/OPENSSL/d' Makefile.am +if [ $? -ne 0 ]; then exit; fi +# Add the additional Makefile.mk fragment for the Linux app. +echo '' >> Makefile.am +cat Makefile.mk >> Makefile.am +# Remove the consecutive blank lines introduced by the above edit operations. +sed -i.bak '/./,/^$/!d' Makefile.am +if [ $? -ne 0 ]; then exit; fi +# A client does not require the mimetic library. +sed -i.bak '/mimetic/d' Makefile.am +if [ $? -ne 0 ]; then exit; fi +# Do not include "bibledit" in the distribution tarball. +sed -i.bak '/^EXTRA_DIST/ s/bibledit//' Makefile.am +if [ $? -ne 0 ]; then exit; fi + +# Remove bibledit-cloud man file. +rm man/bibledit-cloud.1 +if [ $? -ne 0 ]; then exit; fi +sed -i.bak 's/man\/bibledit-cloud\.1//g' Makefile.am + + +# Update the network port number to a value different from 8080. +# This enables running Bibledit (client) and Bibledit Cloud simultaneously. +sed -i.bak 's/8080/9876/g' config/logic.cpp +if [ $? -ne 0 ]; then exit; fi + + +# Remove .bak files. +find . -name "*.bak" -delete + + +# Create distribution tarball. +./reconfigure +if [ $? -ne 0 ]; then exit; fi +./configure +if [ $? -ne 0 ]; then exit; fi +make dist --jobs=12 +if [ $? -ne 0 ]; then exit; fi + + +# Copy the tarball to the Desktop +rm -f ~/bibledit*gz +cp *.gz ~ +if [ $? -ne 0 ]; then exit; fi diff -Nru bibledit-5.0.912/tarball.sh bibledit-5.0.922/tarball.sh --- bibledit-5.0.912/tarball.sh 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/tarball.sh 2020-12-04 19:58:46.000000000 +0000 @@ -18,10 +18,15 @@ # This script runs in a Terminal on macOS. +# It requires a Linux machine accessible via the network. # It refreshes and updates the bibledit sources. # It generates a tarball for a Linux Bibledit client. +echo Using Debian sid as builder +source ~/scr/sid-ip + + LINUXSOURCE=`dirname $0` cd $LINUXSOURCE if [ $? -ne 0 ]; then exit; fi @@ -46,125 +51,14 @@ echo Done -echo Working in $BUILDDIR -cd $BUILDDIR -if [ $? -ne 0 ]; then exit; fi - - -# Move the Bibledit Linux GUI sources into place. -mv bibledit.h executable -if [ $? -ne 0 ]; then exit; fi -mv bibledit.cpp executable -if [ $? -ne 0 ]; then exit; fi - - -# Remove unwanted files. -rm valgrind -rm bibledit -rm dev -rm -rf unittests -find . -name .DS_Store -delete -rm -rf .git -find . -name "*.Po" -delete -rm -rf autom4te.cache -rm -rf *.xcodeproj -rm -rf xcode -echo Remove macOS extended attributes. -echo The attributes would make their way into the tarball, -echo get unpacked within Debian, -echo and would cause lintian errors. -xattr -r -c * - - -# Clean source. -./configure -if [ $? -ne 0 ]; then exit; fi -make distclean -if [ $? -ne 0 ]; then exit; fi - - -# Enable the Linux configuration in config.h. -sed -i.bak 's/ENABLELINUX=no/ENABLELINUX=yes/g' configure.ac -if [ $? -ne 0 ]; then exit; fi -sed -i.bak 's/# linux //g' configure.ac -if [ $? -ne 0 ]; then exit; fi -sed -i.bak 's/.*Tag8.*/AC_DEFINE([HAVE_LINUX], [1], [Enable installation on Linux])/g' configure.ac -if [ $? -ne 0 ]; then exit; fi -# A client does not use the mimetic library. -sed -i.bak '/mimetic/d' configure.ac -if [ $? -ne 0 ]; then exit; fi -# A client does not need the cURL library. -sed -i.bak '/curl/d' configure.ac -if [ $? -ne 0 ]; then exit; fi -sed -i.bak '/CURL/d' configure.ac -if [ $? -ne 0 ]; then exit; fi -# A client does not need the OpenSSL library. -sed -i.bak '/OPENSSL/d' configure.ac -if [ $? -ne 0 ]; then exit; fi - - -# Do not build the unit tests and the generator. -# Rename binary 'server' to 'bibledit'. -sed -i.bak 's/server unittest generate/bibledit/g' Makefile.am +echo Copying $BUILDDIR to $DEBIANSID and working there +rsync --archive --delete $BUILDDIR/ $DEBIANSID:$BUILDDIR/ +scp tarball-linux.sh $DEBIANSID:. if [ $? -ne 0 ]; then exit; fi -sed -i.bak 's/server_/bibledit_/g' Makefile.am +ssh $DEBIANSID "./tarball-linux.sh" if [ $? -ne 0 ]; then exit; fi -sed -i.bak '/unittest/d' Makefile.am -if [ $? -ne 0 ]; then exit; fi -sed -i.bak '/generate_/d' Makefile.am -if [ $? -ne 0 ]; then exit; fi -# Update what to distribute. -sed -i.bak 's/bible bibledit/bible/g' Makefile.am -if [ $? -ne 0 ]; then exit; fi -sed -i.bak '/EXTRA_DIST/ s/$/ *.desktop *.xpm *.png *.xml/' Makefile.am -if [ $? -ne 0 ]; then exit; fi -# Do not link with cURL and OpenSSL. -# Both are not used. -# As a result, a Debian package finds itself having unsatisfied dependencies. -# Removing the flags fixes that. -sed -i.bak '/CURL/d' Makefile.am -if [ $? -ne 0 ]; then exit; fi -sed -i.bak '/OPENSSL/d' Makefile.am -if [ $? -ne 0 ]; then exit; fi -# Add the additional Makefile.mk fragment for the Linux app. -echo '' >> Makefile.am -cat Makefile.mk >> Makefile.am -# Remove the consecutive blank lines introduced by the above edit operations. -sed -i.bak '/./,/^$/!d' Makefile.am -if [ $? -ne 0 ]; then exit; fi -# A client does not require the mimetic library. -sed -i.bak '/mimetic/d' Makefile.am -if [ $? -ne 0 ]; then exit; fi -# Do not include "bibledit" in the distribution tarball. -sed -i.bak '/^EXTRA_DIST/ s/bibledit//' Makefile.am -if [ $? -ne 0 ]; then exit; fi - -# Remove bibledit-cloud man file. -rm man/bibledit-cloud.1 -if [ $? -ne 0 ]; then exit; fi -sed -i.bak 's/man\/bibledit-cloud\.1//g' Makefile.am - -# Update the network port number to a value different from 8080. -# This enables running Bibledit (client) and Bibledit Cloud simultaneously. -sed -i.bak 's/8080/9876/g' config/logic.cpp -if [ $? -ne 0 ]; then exit; fi - - -# Remove .bak files. -find . -name "*.bak" -delete - - -# Create distribution tarball. -./reconfigure -if [ $? -ne 0 ]; then exit; fi -./configure -if [ $? -ne 0 ]; then exit; fi -make dist --jobs=12 -if [ $? -ne 0 ]; then exit; fi - - -# Copy the tarball to the Desktop +echo Copying resulting tarball rm -f ~/Desktop/bibledit*gz -cp *.gz ~/Desktop -if [ $? -ne 0 ]; then exit; fi +scp $DEBIANSID:"bibledit*gz" ~/Desktop + diff -Nru bibledit-5.0.912/workspace/logic.cpp bibledit-5.0.922/workspace/logic.cpp --- bibledit-5.0.912/workspace/logic.cpp 2020-09-19 18:30:19.000000000 +0000 +++ bibledit-5.0.922/workspace/logic.cpp 2020-11-22 14:20:17.000000000 +0000 @@ -22,7 +22,9 @@ #include #include #include -#include +#include +#include +#include #include #include #include @@ -53,29 +55,29 @@ map urls; switch (id) { case 1: - urls [0] = editone_index_url (); + urls [0] = editone2_index_url (); urls [5] = resource_index_url (); break; case 2: - urls [0] = editone_index_url (); + urls [0] = editone2_index_url (); urls [1] = notes_index_url (); break; case 3: urls [0] = resource_index_url (); - urls [1] = editone_index_url (); + urls [1] = editone2_index_url (); urls [2] = notes_index_url (); break; case 4: - urls [0] = editone_index_url (); + urls [0] = editone2_index_url (); urls [1] = consistency_index_url (); break; case 5: urls [0] = resource_index_url (); - urls [1] = editone_index_url (); + urls [1] = editone2_index_url (); urls [5] = editusfm_index_url (); break; default: - urls [0] = editone_index_url (); + urls [0] = editone2_index_url (); urls [1] = resource_index_url (); urls [2] = notes_index_url (); urls [3] = search_index_url (); @@ -577,7 +579,9 @@ string url = element.second; if (url.empty()) continue; if (url.find (edit_index_url ()) != string::npos) is_bible_editor = true; + if (url.find (edit2_index_url ()) != string::npos) is_bible_editor = true; if (url.find (editone_index_url ()) != string::npos) is_bible_editor = true; + if (url.find (editone2_index_url ()) != string::npos) is_bible_editor = true; if (url.find (editusfm_index_url ()) != string::npos) is_bible_editor = true; if (is_bible_editor) { bible_editor_count++;